Last modified: 2013-3-2
Class Jitter3dUtilsInterface
Jitter3dUtils: javascript module for doing Jitter 3d stuff.
Defined in: Jitter3DUtils.js
Constructor Attributes | Constructor Name and Description |
---|---|
Jitter3dUtils: javascript module for doing Jitter 3d stuff.
|
Method Attributes | Method Name and Description |
---|---|
add_quats(q1, q2, q3)
add quats
|
|
axis_to_quat(axis, quat)
convert angle/axis rotation to quaternion.
|
|
build_rotmatrix(m, q)
build rotation matrix m for the quaternion q.
|
|
void |
closest_line_sphere(line_a, line_b, center, r, p1)
set p1 to the point on sphere closest to line segment.
|
intersect_line_quad(line_a, line_b, pos, rot, scale, p1, p2)
return true if the ray defined by the line's two points intersects the quad.
|
|
Boolean |
intersect_line_sphere(line_a, line_b, center, r, p1)
if the ray defined by the line's two points intersects the sphere,
set p1 to the closest point of intersection.
|
no info.
|
|
quat_to_axis(quat, axis)
convert quaternion to angle/axis rotation.
|
|
transform_point(p_in, m)
no info.
|
|
vadd(src1, src2, dst)
add src1 and src2, save the result in dst
|
|
vcopy(v1, v2)
copy the three indicies from v1 to v2
|
|
vcross(v1, v2, cross)
create the cross product of v1 and v2?
|
|
vdiv(src1, src2, dst)
divide src1 and src2, save the result in dst
|
|
vdot(v1, v2)
no info.
|
|
vlength(v)
distance-squared function
|
|
vec3 |
vlength2(v)
cheaper distance-squared function
|
vmul(src1, src2, dst)
multiply src1 and src2, save the result in dst
|
|
vnormal(v)
no info.
|
|
vscale(v, div)
scale the vector
|
|
vset(v, x, y, z)
set all three indicies of v to x, y, z
|
|
vsub(src1, src2, dst)
subtract src1 and src2, save the result in dst
|
|
vzero(v)
set all three indicies of v to 0.0
|
|
xyz_to_axis(xyz, axis)
convert rotation in Euler angles (xyz) to angle/axis rotation.
|
Class Detail
Jitter3dUtilsInterface
()
Jitter3dUtils: javascript module for doing Jitter 3d stuff.
Defined in: Jitter3DUtils.js
- Example:
//TODO
Method Detail
add_quats
(q1, q2, q3)
add quats
- Example:
//TODO
- Parameters:
- {t_vec_4d} q1
- {t_vec_4d} q2
- {t_vec_4d} q3
axis_to_quat
(axis, quat)
convert angle/axis rotation to quaternion.
- Example:
//TODO
- Parameters:
- {t_vec_3d} axis
- {t_vec_4d} quat
build_rotmatrix
(m, q)
build rotation matrix m for the quaternion q.
- Example:
//TODO
- Parameters:
- {t_vec_4d} m
- {t_vec_4d} q
{void}
closest_line_sphere
(line_a, line_b, center, r, p1)
set p1 to the point on sphere closest to line segment.
(x3 - x1)(x2 - x1) + (y3 - y1)(y2 - y1) + (z3 - z1)(z2 - z1)
-----------------------------------------------------------
(x2 - x1)(x2 - x1) + (y2 - y1)(y2 - y1) + (z2 - z1)(z2 - z1)
(x3 - x1)(x2 - x1) + (y3 - y1)(y2 - y1) + (z3 - z1)(z2 - z1)
-----------------------------------------------------------
(x2 - x1)(x2 - x1) + (y2 - y1)(y2 - y1) + (z2 - z1)(z2 - z1)
- Example:
//TODO
- Parameters:
- {t_vec_3d} line_a
- {t_vec_3d} line_b
- {t_vec_3d} center
- {float} r
- {t_vec_3d} p1
intersect_line_quad
(line_a, line_b, pos, rot, scale, p1, p2)
return true if the ray defined by the line's two points intersects the quad.
also sets p2 to the point of intersection with the quad plane in object unit
coords, and p1 to the same point in world coords.
Quad is defined by the unit quad transformed by position, rotation, scale.
- Example:
//TODO
- Parameters:
- {t_vec_3d} line_a
- {t_vec_3d} line_b
- {t_vec_3d} pos
- {t_vec_3d} rot
- {t_vec_3d} scale
- {t_vec_3d} p1
- {t_vec_3d} p2
{Boolean}
intersect_line_sphere
(line_a, line_b, center, r, p1)
if the ray defined by the line's two points intersects the sphere,
set p1 to the closest point of intersection.
- Example:
//TODO
- Parameters:
- {t_vec_3d} line_a
- {t_vec_3d} line_b
- {t_vec_3d} center
- {float} r
- {t_vec_3d} p1
normalize_quat
(q)
no info.
- Example:
//TODO
- Parameters:
- {t_vec_4d} q
quat_to_axis
(quat, axis)
convert quaternion to angle/axis rotation.
- Example:
//TODO
- Parameters:
- {t_vec_4d} quat
- {t_vec_3d} axis
transform_point
(p_in, m)
no info.
- Example:
//TODO
- Parameters:
- p_in
- m
vadd
(src1, src2, dst)
add src1 and src2, save the result in dst
- Example:
//TODO
- Parameters:
- {t_vec_3d} src1
- {t_vec_3d} src2
- {t_vec_3d} dst
vcopy
(v1, v2)
copy the three indicies from v1 to v2
- Example:
//TODO
- Parameters:
- {t_vec_3d} v1
- {t_vec_3d} v2
vcross
(v1, v2, cross)
create the cross product of v1 and v2?
- Example:
//TODO
- Parameters:
- {t_vec_3d} v1
- {t_vec_3d} v2
- {t_vec_3d} cross
vdiv
(src1, src2, dst)
divide src1 and src2, save the result in dst
- Example:
//TODO
- Parameters:
- {t_vec_3d} src1
- {t_vec_3d} src2
- {t_vec_3d} dst
vdot
(v1, v2)
no info.
- Example:
//TODO
- Parameters:
- {t_vec_3d} v1
- {t_vec_3d} v2
vlength
(v)
distance-squared function
- Example:
//TODO
- Parameters:
- {t_vec_3d} v
{vec3}
vlength2
(v)
cheaper distance-squared function
- Example:
//returns this calculation v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
- Parameters:
- {t_vec_3d} v
- Returns:
- {vec3}
vmul
(src1, src2, dst)
multiply src1 and src2, save the result in dst
- Example:
//TODO
- Parameters:
- {t_vec_3d} src1
- {t_vec_3d} src2
- {t_vec_3d} dst
vnormal
(v)
no info.
- Example:
//TODO
- Parameters:
- {t_vec_3d} v
vscale
(v, div)
scale the vector
- Example:
//TODO
- Parameters:
- {t_vec_3d} v
- {float} div
- scale factor
vset
(v, x, y, z)
set all three indicies of v to x, y, z
- Example:
//TODO
- Parameters:
- {t_vec_3d} v
- {float} x
- {float} y
- {float} z
vsub
(src1, src2, dst)
subtract src1 and src2, save the result in dst
- Example:
//TODO
- Parameters:
- {t_vec_3d} src1
- {t_vec_3d} src2
- {t_vec_3d} dst
vzero
(v)
set all three indicies of v to 0.0
- Example:
//TODO
- Parameters:
- {t_vec_3d} v
xyz_to_axis
(xyz, axis)
convert rotation in Euler angles (xyz) to angle/axis rotation.
- Example:
//TODO
- Parameters:
- {t_vec_3d} xyz
- {t_vec_3d} axis