public Vec3(Vec4 v) { X = v.X; Y = v.Y; Z = v.Z; W = 1; }
/** * Prodotto matrice-vettore * @param v vettore * @return vettore risultante this*v */ public Vec4 Dot(Vec4 v) { return(new Vec4( this.Row(0).Dot(v), this.Row(1).Dot(v), this.Row(2).Dot(v), this.Row(3).Dot(v) )); }
public Vec4(Vec4 u) { v = new float[4]; v[0] = u.X; v[1] = u.Y; v[2] = u.Z; v[3] = u.W; IsColliding = false; }
public override bool Equals(Object o) { if (o is Vec4) { Vec4 v = (Vec4)o; if (v.X == X && v.Y == Y && v.Z == Z && v.W == W) { return(true); } } return(false); }
void init() { VertexConstatints = new List <VertexConstraint> (); VertexOld = new List <Vec3> (); Force = new Vec4(0, 0, 0, 1); Mass = 0; foreach (var v in VertexNow) { VertexOld.Add(v * 1); } GenerateVertexConstraintsFromFaces(); }
public Vec4 Sub(Vec4 v2) { return this.Add(v2.Mult(-1)); }
public float Dot(Vec4 v2) { return this.X * v2.X + this.Y * v2.Y + this.Z * v2.Z + this.W * v2.W; }
public Vec4 Add(Vec4 v2) { return new Vec4( this.X + v2.X, this.Y + v2.Y, this.Z + v2.Z, this.W + v2.W ); }
public Vec4 Sub(Vec4 v2) { return(this.Add(v2.Mult(-1))); }
public Vec3 Add(Vec3 v2) { Vec4 v = base.Add(v2); return(new Vec3(v.X, v.Y, v.Z)); }
public Capsule() { Radius = 2.0f; Color = new Vec4 (0.8f, 0.3f, 0.5f, 1.0f); Model = IMatrix.Identity (); }
public void ApplyForce(Vec4 force) { Force = Force + force; Console.WriteLine("Applied force" + Force.ToString()); }
/** * Prodotto matrice-vettore * @param v vettore * @return vettore risultante this*v */ public Vec4 Dot(Vec4 v) { return new Vec4( this.Row(0).Dot(v), this.Row(1).Dot(v), this.Row(2).Dot(v), this.Row(3).Dot(v) ); }
public new Vec3 Normalized() { Vec4 v = base.Normalized(); return(new Vec3(v.X, v.Y, v.Z)); }
public new Vec3 Mult(float f) { Vec4 v = base.Mult(f); return(new Vec3(v.X, v.Y, v.Z)); }
public Vec3 Sub(Vec3 v2) { Vec4 v = base.Sub(v2); return(new Vec3(v.X, v.Y, v.Z)); }
void SendUniforms(Vec4 color) { var mv = view.Dot (model.Top ()); var mvp = proj.Dot (mv); GL.UniformMatrix4 (mvpLocation, 1, false, mvp.Direct.ToFloatArray ()); GL.UniformMatrix4 (modeViewLocation, 1, false, mv.Direct.ToFloatArray ()); GL.Uniform1 (distanceLocation,trackball.distance); GL.Uniform1 (useColorLocation, useColor ? 1:0); GL.Uniform4 (colorLocation, 1, color.GetArray()); }
public void ApplyForce(Vec4 force) { Force = Force + force; Console.WriteLine ("Applied force" + Force.ToString ()); }
public Sphere() { Rings = 32; Radius = 4.0f; Segments = 16; Color = new Vec4 (1.0f, 0, 0, 0.5f); Animated = true; }
void init() { VertexConstatints = new List<VertexConstraint> (); VertexOld = new List<Vec3> (); Force = new Vec4 (0, 0, 0, 1); Mass = 0; foreach (var v in VertexNow) VertexOld.Add (v * 1); GenerateVertexConstraintsFromFaces (); }