Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
org.skia.jetskidemo.Vec3 Class Reference

Public Member Functions

 Vec3 (float x, float y, float z)
 
float length ()
 
Vec3 normalize ()
 
Vec3 add (float v)
 
Vec3 mul (float v)
 
float dot (Vec3 v)
 
Vec3 cross (Vec3 v)
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

Definition at line 47 of file CubeActivity.java.

Constructor & Destructor Documentation

◆ Vec3()

org.skia.jetskidemo.Vec3.Vec3 ( float  x,
float  y,
float  z 
)
inline

Definition at line 50 of file CubeActivity.java.

50{ this.x = x; this.y = y; this.z = z; }

Member Function Documentation

◆ add()

Vec3 org.skia.jetskidemo.Vec3.add ( float  v)
inline

Definition at line 59 of file CubeActivity.java.

59 {
60 x += v; y += v; z += v;
61 return this;
62 }

◆ cross()

Vec3 org.skia.jetskidemo.Vec3.cross ( Vec3  v)
inline

Definition at line 73 of file CubeActivity.java.

73 {
74 float xx = y*v.z - z*v.y,
75 yy = z*v.x - x*v.z,
76 zz = x*v.y - y*v.x;
77 x = xx; y = yy; z = zz;
78 return this;
79 }

◆ dot()

float org.skia.jetskidemo.Vec3.dot ( Vec3  v)
inline

Definition at line 69 of file CubeActivity.java.

69 {
70 return x*v.x + y*v.y + z*v.z;
71 }

◆ length()

float org.skia.jetskidemo.Vec3.length ( )
inline

Definition at line 52 of file CubeActivity.java.

52{ return (float)Math.sqrt(x*x + y*y + z*z); }

◆ mul()

Vec3 org.skia.jetskidemo.Vec3.mul ( float  v)
inline

Definition at line 64 of file CubeActivity.java.

64 {
65 x *= v; y *= v; z *= v;
66 return this;
67 }

◆ normalize()

Vec3 org.skia.jetskidemo.Vec3.normalize ( )
inline

Definition at line 54 of file CubeActivity.java.

54 {
55 mul(1/length());
56 return this;
57 }

Member Data Documentation

◆ x

float org.skia.jetskidemo.Vec3.x

Definition at line 48 of file CubeActivity.java.

◆ y

float org.skia.jetskidemo.Vec3.y

Definition at line 48 of file CubeActivity.java.

◆ z

float org.skia.jetskidemo.Vec3.z

Definition at line 48 of file CubeActivity.java.


The documentation for this class was generated from the following file: