home *** CD-ROM | disk | FTP | other *** search
- class sandy.math.VertexMath extends sandy.math.VectorMath
- {
- function VertexMath()
- {
- super();
- }
- static function negate(v)
- {
- return new sandy.core.data.Vertex(- v.x,- v.y,- v.z);
- }
- static function dot(v, w)
- {
- return v.tx * w.tx + v.ty * w.ty + w.tz * v.tz;
- }
- static function addVertex(v, w)
- {
- return new sandy.core.data.Vertex(v.x + w.x,v.y + w.y,v.z + w.z);
- }
- static function sub(v, w)
- {
- return new sandy.core.data.Vertex(v.x - w.x,v.y - w.y,v.z - w.z,v.tx - w.tx,v.ty - w.ty,v.tz - w.tz);
- }
- static function cross(w, v)
- {
- return new sandy.core.data.Vertex(w.y * v.z - w.z * v.y,w.z * v.x - w.x * v.z,w.x * v.y - w.y * v.x);
- }
- static function clone(v)
- {
- return new sandy.core.data.Vertex(v.x,v.y,v.z);
- }
- }
-