/// <summary> /// Animation that translates the shape in WC fo n game Ticks /// </summary> /// <param name="shape3D">Shape to animate.</param> /// <param name="ticks">Total of ticks to apply the animation.</param> /// <param name="vector3">Vector for the WC translation.</param> public AnimationTranslationWC(Shape3D shape3D, int ticks, Vector3 vector3) { Shape3D = shape3D; Ticks = ticks; TranslationVector = vector3; TicksCount = 0; }
/// <summary> /// Animation that rotates the shape at X with an angle. /// </summary> /// <param name="angle">Rotation angle</param> public AnimationRotateX(Shape3D shape3D, int ticks, float angle) { Shape3D = shape3D; Ticks = ticks; Angle = angle; TicksCount = 0; }
public Shader(ref string vs, ref string fs, Shape3D shape3D) { VertexSource = vs; FragmentSource = fs; Shape3D = shape3D; Build(); }
public Physic(Shape3D shape3D) { this.shape3D = shape3D; Vxyz = Vector3.Zero; AVuvw = Vector3.Zero; Fuvw = Vector3.Zero; Mass = 0f; Iuvw = Vector3.Zero; }
/// <summary> /// Animation that rotates the shape with an axis and an angle. /// </summary> /// <param name="axis">Rotation axis</param> /// <param name="angle">Rotation angle</param> public AnimationRotate(Shape3D shape3D, int ticks, Vector3 axis, float angle) { Shape3D = shape3D; Ticks = ticks; Axis = axis; Angle = angle; TicksCount = 0; IsCenterWC = false; }
public AnimationsManager(Shape3D shape3D) { Shape3D = shape3D; Animations = new List <Animation>(); CurrentAnimationIndex = 0; Runing = true; Loop = false; }
/// <summary> /// Animates the shape for 1 tick. /// </summary> /// <returns>True if ticks count is not equal to total ticks.</returns> public override bool Animate() { if (TicksCount < Ticks) { Shape3D.TranslateWC(TranslationVector.X, TranslationVector.Y, TranslationVector.Z); TicksCount++; return(true); } else { TicksCount = 0; return(false); } }
/// <summary> /// Animates the shape for 1 tick. /// </summary> /// <returns>True if ticks count is not equal to total ticks.</returns> public override bool Animate() { if (TicksCount < Ticks) { Shape3D.RotateX(Angle); TicksCount++; return(true); } else { TicksCount = 0; return(false); } }
public Bounding(Shape3D shape3D, float r, Type type = Type.Sphere) { this.shape3D = shape3D; this.r = r; this.boundingType = type; if (type == Type.Box) { throw new ArgumentException("Bounding Type must be Sphere."); } collisionInXL = true; collisionInXR = true; collisionInYD = true; collisionInYU = true; collisionInZF = true; collisionInZB = true; }
public Bounding(Shape3D shape3D, float boxXLength, float boxYLength, float boxZLength, Type type = Type.Box) { this.shape3D = shape3D; this.boxXLength = boxXLength; this.boxYLength = boxYLength; this.boxZLength = boxZLength; this.boundingType = type; if (type == Type.Sphere) { throw new ArgumentException("Bounding Type must be Box."); } collisionInXL = true; collisionInXR = true; collisionInYD = true; collisionInYU = true; collisionInZF = true; collisionInZB = true; }