input
stringlengths
10
828
output
stringlengths
5
107
public mutable vector3f rotate read only vector3f v mutable vector3f result fixme generates garbage mutable quat4f q mul v null mul inverse null if result null return new vector3f q get x q get y q get z else return result set q get x q get y q get z
transform the given vector tt v tt by this quaternion and store the
public float length float row1 get 0 0 get 0 0 get 0 1 get 0 1 get 0 2 get 0 2 float row2 get 1 0 get 1 0 get 1 1 get 1 1 get 1 2 get 1 2 float row3 get 2 0 get 2 0 get 2 1 get 2 1 get 2 2 get 2 2 return float math sqrt row1 row2 row3
compute and return the length of this matrix
public mutable quat4f arc read only vector3f v return arc v null
return a new quat4f containing the shortest rotation arc from this vector
public mutable matrix3f set row int row read only vector3f values return set row 0 values get x set row 1 values get y set row 2 values get z
set the given matrix row to the three values stored in the vector
public mutable matrix4f inverse return inverse this
invert this matrix in place equivalent to
public mutable matrix3f set float values int offset boolean row major if row major return set values offset values offset 1 values offset 2 values offset 3 values offset 4 values offset 5 values offset 6 values offset 7 values offset 8 else return set values offset values offset 3 values offset 6 values offset 1 values offset 4 values offset 7 values offset 2 values offset 5 values offset 8
set all nine values of this matrix from the given array values
public mutable quat4f normalize mutable quat4f result float d length if d 0f throw new arithmetic exception cannot normalize quaternion with 0 length return scale 1f d result
normalize this quaternion and place the normalized quaternion in
public float dot read only vector3f v return get x v get x get y v get y get z v get z
compute and return the dot product between this vector and the given
public mutable vector3f mul read only vector3f r mutable vector3f result if result null result new vector3f return result set get 0 0 r get x get 0 1 r get y get 0 2 r get z get 1 0 r get x get 1 1 r get y get 1 2 r get z get 2 0 r get x get 2 1 r get y get 2 2 r get z
multiply this matrix by the 3x1 matrix represented by the three values in
public mutable matrix3f set read only matrix3f o return set o get 0 0 o get 0 1 o get 0 2 o get 1 0 o get 1 1 o get 1 2 o get 2 0 o get 2 1 o get 2 2
set this matrix to be equal to the given matrix o
public mutable matrix3f set identity return set 1 0 0 0 1 0 0 0 1
reset this matrixs values so that it represents the identity matrix
public float dot float x float y float z return get x x get y y get z z
compute and return the dot product between this vector and the implicit
public mutable matrix3f mul diagonal read only vector3f diag mutable matrix3f result if result null result new matrix3f return result set get 0 0 diag get x get 0 1 diag get y get 0 2 diag get z get 1 0 diag get x get 1 1 diag get y get 1 2 diag get z get 2 0 diag get x get 2 1 diag get y get 2 2 diag get z
multiply this matrix by the diagonal matrix that takes its three
public mutable matrix4f transpose return transpose this
transpose this matrix in place equivalent to
public mutable vector3f normalize return normalize this
normalize this vector in place equivalent to
public mutable vector3f set int index float val switch index case 0 return set x val case 1 return set y val case 2 return set z val default throw new index out of bounds exception index must be in 0 3
set the vector coordinate at index to the given value
public mutable matrix4f set col int col float values int offset return set 0 col values offset set 1 col values offset 1 set 2 col values offset 2 set 3 col values offset 3
set the given matrix column to the values in the values array starting
public mutable vector3f project read only vector3f proj mutable vector3f result return proj scale dot proj proj length squared result
project this vector onto proj and store it in result
public mutable vector3f mul pre read only vector3f r mutable vector3f result if result null result new vector3f return result set get 0 0 r get x get 1 0 r get y get 2 0 r get z get 0 1 r get x get 1 1 r get y get 2 1 r get z get 0 2 r get x get 1 2 r get y get 2 2 r get z
multiply the 1x3 matrix represented by x y z by this matrix or
public mutable matrix4f set col int col read only vector4f values return set 0 col values get x set 1 col values get y set 2 col values get z set 3 col values get w
set the given matrix column to the four values stored in the vector
public float dot float x float y float z float w return get x x get y y get z z get w w
return the dot product between this quaternion and the quaternion
public mutable vector3f cross read only vector3f v mutable vector3f result if result null result new vector3f return result set get y v get z v get y get z get z v get x v get z get x get x v get y v get x get y
compute the cross product this x v and store it in result
public mutable matrix4f set row int row read only vector4f values return set row 0 values get x set row 1 values get y set row 2 values get z set row 3 values get w
set the given matrix row to the four values stored in the vector
public mutable quat4f normalize return normalize this
normalize this quaternion in place equivalent to
public mutable quat4f inverse return inverse this
invert this quaternion in place equivalent to
public mutable matrix4f set read only matrix4f o return set o get 0 0 o get 0 1 o get 0 2 o get 0 3 o get 1 0 o get 1 1 o get 1 2 o get 1 3 o get 2 0 o get 2 1 o get 2 2 o get 2 3 o get 3 0 o get 3 1 o get 3 2 o get 3 3
set this matrix to be equal to the given matrix o
public mutable quat4f set identity return set 0f 0f 0f 1f
set this quaternion to the identity quaternion which is 0 0 0 1
public mutable matrix4f set identity return set 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
reset this matrixs values so that it represents the identity matrix
public mutable quat4f set axis angle read only vector3f axis float angle float d axis length float s float math sin 5f angle d return set axis get x s axis get y s axis get z s float math cos 5f angle
set this quaternion to be the rotation of tt angle tt radians about
public mutable vector3f get axis mutable vector3f result if result null result new vector3f float s2 1f get w get w if s2 0001f return result set 1f 0f 0f arbitrary float s float math sqrt s2 return result set get x s get y s get z s
compute and return the axis of rotation for this quaternion
public mutable vector3f sub read only vector3f v mutable vector3f result return sub v get x v get y v get z result
subtract v from this vector this v and store the subtraction in
public color3f brighter return brighter 1f default factor null
convenience function to get a new color that is brighter than this color
public mutable quat4f set int index float val switch index case 0 return set x val case 1 return set y val case 2 return set z val case 3 return set w val default throw new index out of bounds exception index must be in 0 3
set the quaternion coordinate at index to the given value
public color3f darker return darker default factor null
convenience function to get a new color that is darker than this color
public color3f darker float factor color3f result if factor 0f factor 1f throw new illegal argument exception darkening factor must be in the range 0 1 not factor if result null result new color3f return result set math max 0f factor get red hdr math max 0f factor get green hdr math max 0f factor get blue hdr
get a darker version of this color
public mutable quat4f inverse mutable quat4f result if result null result new quat4f return result set get x get y get z get w
compute the inverse of this quaternion and store it in tt result tt
public float get int component switch component case 0 return get red case 1 return get green case 2 return get blue default throw new index out of bounds exception component must be between 0 and 2 not component
get the clamped color value for tt component tt
public float length squared return get x get x get y get y get z get z get w get w
compute the length of this vector squared
public float get hdr int component switch component case 0 return get red hdr case 1 return get green hdr case 2 return get blue hdr default throw new index out of bounds exception component must be between 0 and 2 not component
get the unclamped color value for tt component tt
public mutable vector3f solve read only vector3f ans mutable vector3f result return solve ans get x ans get y ans get z result
solve the linear system of equations and store the resultant values of
public mutable vector3f scale float scalar mutable vector3f result if result null result new vector3f return result set scalar get x scalar get y scalar get z
scale this vector by the given scalar scalar this and store it in
public float distance read only vector4f v return float math sqrt distance squared v
compute the distance between this vector and tt v tt treating both
public void get float vals int offset vals offset 0 get red vals offset 1 get green vals offset 2 get blue
copy the clamped color values of this color into tt vals tt starting
public float distance squared read only vector4f v float dx get x v get x float dy get y v get y float dz get z v get z float dw get w v get w return dx dx dy dy dz dz dw dw
compute the square of the distance between this and tt v tt treating
public mutable vector3f normalize mutable vector3f result float d length if d 0f throw new arithmetic exception can t normalize 0 vector return scale 1f d result
normalize this vector to be of length 1 and store it in result
public float angle read only vector4f v return float math acos dot v length v length
compute and return the shortest angle between this vector and v
public boolean equals read only color3f color boolean as hdr if color null return false if as hdr return float compare get red hdr color get red hdr 0 float compare get green hdr color get green hdr 0 float compare get blue hdr color get blue hdr 0 else return float compare get red color get red 0 float compare get green color get green 0 float compare get blue color get blue 0
determine if the two colors are equal
public float dot read only vector4f v return dot v get x v get y v get z v get w
compute and return the dot product between this vector and the given
public void get float vals int offset vals offset get x vals offset 1 get y vals offset 2 get z vals offset 3 get w
store the four component values of this quaternion into vals starting at
public float trace return get 0 0 get 1 1 get 2 2
compute the trace of this matrix
public void get float vals int offset vals offset get x vals offset 1 get y vals offset 2 get z
store the three component values of this vector into vals starting at
public mutable matrix3f transpose mutable matrix3f result if result null result new matrix3f return result set get 0 0 get 1 0 get 2 0 get 0 1 get 1 1 get 2 1 get 0 2 get 1 2 get 2 2
store the transpose of this matrix into result and return result
public mutable vector4f project read only vector4f proj mutable vector4f result return proj scale dot proj proj length squared result
project this vector onto proj and store it in result
public mutable vector3f get col int col mutable vector3f store if store null store new vector3f return store set get 0 col get 1 col get 2 col
store the three column values for the given column index into the vector
public mutable vector4f sub read only vector4f v mutable vector4f result return sub v get x v get y v get z v get w result
subtract v from this vector this v and store the subtraction in
public boolean equals read only quat4f q return q null get x q get x get y q get y get z q get z get w q get w
return true if these two quaternions are numerically equal
public read only vector3f get col int col return new column vector col
return a read only vector3f that wraps the specified column of this matrix
public boolean epsilon equals read only quat4f q float eps if q null return false float tx math abs get x q get x float ty math abs get y q get y float tz math abs get z q get z float tw math abs get w q get w return tx eps ty eps tz eps tw eps
determine if these two quaternions are equal within an error range of eps
public void get col int col float store int offset store offset get 0 col store offset 1 get 1 col store offset 2 get 2 col
store the three column values for the given column index into the float
public mutable vector4f scale float scalar mutable vector4f result if result null result new vector4f return result set scalar get x scalar get y scalar get z scalar get w
scale this vector by the given scalar scalar this and store it in
public boolean equals read only vector3f e return e null get x e get x get y e get y get z e get z
return true if these two vectors are numerically equal
public mutable vector4f normalize mutable vector4f result float d length if d 0f throw new arithmetic exception cannot normalize 0 vector return scale 1 d result
normalize this vector to be of length 1 and store it in result
public boolean epsilon equals read only vector3f v float eps if v null return false if math abs get x v get x eps return false if math abs get y v get y eps return false if math abs get z v get z eps return false return true
determine if these two vectors are equal within an error range of eps
public vector3f get min return min
return the vector coordinate of this axis aligned boxs minimum corner
public read only vector3f get row int row return new row vector row
return a read only vector3f that wraps the specified row of this matrix
public vector3f get max return max
return the vector coordinate of this axis aligned boxs maximum corner
public read only vector3f get as vector3f return new reduced vector
return a read only vector3f that wraps this 4 component vector
public mutable vector3f get center return get center null
create and return a new vector3f containing the center location of this
public mutable vector3f get center mutable vector3f result return min add max result scale 5f
compute the center location of this axis aligned box and store it within
public mutable vector4f solve read only vector4f ans mutable vector4f result the system is b a x and we re solving for x which becomes a 1 b x mutable matrix4f inv inverse inverse get return inv mul ans result
solve the linear system of equations and store the resultant values of
public boolean equals read only vector4f v return v null get x v get x get y v get y get z v get z get w v get w
return true if these two vectors are numerically equal
public boolean equals read only matrix3f e return e null get 0 0 e get 0 0 get 0 1 e get 0 1 get 0 2 e get 0 2 get 1 0 e get 1 0 get 1 1 e get 1 1 get 1 2 e get 1 2 get 2 0 e get 2 0 get 2 1 e get 2 1 get 2 2 e get 2 2
return true if these two matrices are numerically equal
public boolean epsilon equals read only vector4f v float eps if v null return false float tx math abs get x v get x float ty math abs get y v get y float tz math abs get z v get z float tw math abs get w v get w return tx eps ty eps tz eps tw eps
determine if these two vectors are equal within an error range of eps
public boolean intersects axis aligned box other return max get x other min get x min get x other max get x max get y other min get y min get y other max get y max get z other min get z min get z other max get z
return true if this axis aligned box and tt other tt intersect
public mutable vector4f solve float ax float ay float az float aw mutable vector4f result return solve new vector4f ax ay az aw result
solve the linear system of equations and store the resultant values of
public boolean contains axis aligned box other return min get x other min get x max get x other max get x min get y other min get y max get y other max get y min get z other min get z max get z other max get z
return true if tt other tt is completely contained within the extents
public float trace return get 0 0 get 1 1 get 2 2 get 3 3
compute the trace of this matrix
public axis aligned box intersect axis aligned box other axis aligned box result if result null result new axis aligned box in the event that min max there is no true intersection result min set math max min get x other min get x math max min get y other min get y math max min get z other min get z result max set math min max get x other max get x math min max get y other max get y math min max get z other max get z return result
compute the intersection of this axis aligned box and tt other tt and
public void set int plane bits this plane bits plane bits
adjust this plane state to use the given bit set of frustum planes
public mutable matrix4f transpose mutable matrix4f result if result null result new matrix4f return result set get 0 0 get 1 0 get 2 0 get 3 0 get 0 1 get 1 1 get 2 1 get 3 1 get 0 2 get 1 2 get 2 2 get 3 2 get 0 3 get 1 3 get 2 3 get 3 3
store the transpose of this matrix into result and return result
public void reset plane bits 0
reset this plane state so that all planes require testing
public void set perspective float fov float aspect float near float far if fov 0f fov 180f throw new illegal argument exception field of view must be in 0 180 not fov if aspect 0 throw new illegal argument exception aspect ration must be 0 not aspect float h float math tan math to radians fov 5f near float w h aspect set frustum false w w h h near far
set the frustum to be perspective projection with the given field of view
public mutable vector4f get col int col mutable vector4f store if store null store new vector4f return store set get 0 col get 1 col get 2 col get 3 col
store the four column values for the given column index into the vector
public e remove int index if index 0 index size throw new index out of bounds exception index must be in 0 size 1 e e elements index elements index elements size elements size null return e
remove the item at the given index and return it
public void set ortho float left float right float bottom float top set frustum true left right bottom top 1f 1f
set the frustum to be an orthographic projection that uses the given
public read only vector4f get col int col return new column vector col
return a read only vector4f that wraps the specified column of this matrix
public boolean is orthogonal projection return use ortho
whether or not this view uses a perspective or orthogonal projection
public int index of object item if item null throw new null pointer exception null elements aren t supported for int i 0 i size i if elements i item return i return 1
determine the first index that holds a reference to item
public void get col int col float store int offset store offset get 0 col store offset 1 get 1 col store offset 2 get 2 col store offset 3 get 3 col
store the four column values for the given column index into the float
public void clear boolean fast if fast max fast clear size math max size max fast clear size size 0 else arrays fill elements 0 math max max fast clear size size null max fast clear size 0 size 0
clear this bag of all elements
public float get field of view if use ortho return 1f double fov top math atan frustum top frustum near double fov bottom math atan frustum bottom frustum near return float math to degrees fov top fov bottom
compute and return the field of view along the vertical axis that this
public void trim capacity size
reduce the bags capacity to fit its current size exactly
public read only vector4f get row int row return new row vector row
return a read only vector4f that wraps the specified row of this matrix
public void sort comparator e comparator arrays sort elements 0 size comparator
sort the bag using the given comparator
public void shuffle for int i size i 1 i swap i 1 shuffler next int i
shuffle the elements within this bag randomly
public int get width return this root rc width
return the current width of the top level container
public int get height return this root rc height
return the current height of the top level container
public float get tex coord left return tc l
return the texture coord that represents the left edge within the
public float get tex coord right return tc r
return the texture coord that represents the right edge within the
public float get tex coord top return tc t
return the texture coord that represents the top edge within the