4 using System.Collections.Generic;
7 using System.Threading.Tasks;
9 using SiliconStudio.Core.Mathematics;
10 using SiliconStudio.Paradox.Graphics;
23 Type = ColliderShapeTypes.Cylinder;
26 HalfExtents = halfExtents;
34 InternalShape =
new BulletSharp.CylinderShapeX(halfExtents);
36 rotation = Matrix.RotationZ((float)Math.PI / 2.0f);
37 scaling =
new Vector3(halfExtents.
Y * 2.0f, halfExtents.
X * 2.0f, halfExtents.
Z * 2.0f);
41 InternalShape =
new BulletSharp.CylinderShapeZ(halfExtents);
43 rotation = Matrix.RotationX((float)Math.PI / 2.0f);
44 scaling =
new Vector3(halfExtents.
X * 2.0f, halfExtents.
Z * 2.0f, halfExtents.
Y * 2.0f);
48 UpAxis = Vector3.UnitY;
49 InternalShape =
new BulletSharp.CylinderShape(halfExtents);
51 rotation = Matrix.Identity;
52 scaling = halfExtents * 2.0f;
56 DebugPrimitive = GeometricPrimitive.Cylinder.New(PhysicsEngine.Singleton.DebugGraphicsDevice);
57 DebugPrimitiveScaling = Matrix.Scaling(scaling * 1.01f) * rotation;
66 public Vector3 HalfExtents {
get;
private set; }
72 return ((BulletSharp.CylinderShape)InternalShape).Radius;
82 public Vector3 UpAxis {
get;
private set; }
float Y
The Y component of the vector.
bool CreateDebugPrimitives
Set to true if you want the engine to create the debug primitives
CylinderColliderShape(Vector3 halfExtents, Vector3 upAxis)
Initializes a new instance of the CylinderColliderShape class.
float X
The X component of the vector.
Represents a three dimensional mathematical vector.
static readonly Vector3 UnitZ
The Z unit SiliconStudio.Core.Mathematics.Vector3 (0, 0, 1).
static readonly Vector3 UnitX
The X unit SiliconStudio.Core.Mathematics.Vector3 (1, 0, 0).
using SiliconStudio.Paradox. Physics
SiliconStudio.Core.Mathematics.Vector3 Vector3
float Z
The Z component of the vector.
Represents a 4x4 mathematical matrix.