Esempio n. 1
0
        public BoxColliderShape(Simulation simulation, Vector3 size)
        {
            var box = new Box(size.X, size.Y, size.Z);

            InternalShape      = box;
            InternalShapeIndex = simulation.AddShape(box);

            DebugPrimitiveMatrix = Matrix.Scaling(size * DebugScaling);
        }
        public CylinderColliderShape(Simulation simulation, float radius, float length)
        {
            Radius = radius;
            Length = length;

            var cylinder = new Cylinder(radius, length);

            InternalShape      = cylinder;
            InternalShapeIndex = simulation.AddShape(cylinder);

            DebugPrimitiveMatrix = Matrix.Scaling(new Vector3(Radius * 2, Length, Radius * 2) * DebugScaling);
        }