5 using SiliconStudio.Core.Mathematics;
6 using SiliconStudio.Paradox.Graphics;
21 Type = ColliderShapeTypes.Capsule;
28 BulletSharp.CapsuleShape shape;
33 var h = radius * 2 + height;
37 shape =
new BulletSharp.CapsuleShapeX(radius, height);
39 rotation = Matrix.RotationZ((float)Math.PI / 2.0f);
43 shape =
new BulletSharp.CapsuleShapeZ(radius, height);
45 rotation = Matrix.RotationX((float)Math.PI / 2.0f);
49 UpAxis = Vector3.UnitY;
50 shape =
new BulletSharp.CapsuleShape(radius, height);
52 rotation = Matrix.Identity;
57 InternalShape =
new BulletSharp.Convex2DShape(shape) { LocalScaling =
new Vector3(1, 1, 0) };
61 InternalShape = shape;
65 DebugPrimitive = GeometricPrimitive.Capsule.New(PhysicsEngine.Singleton.DebugGraphicsDevice);
66 DebugPrimitiveScaling = Matrix.Scaling(
new Vector3(radius * 2, h / 2, radius * 2) * 1.01f) * rotation;
75 public float Radius {
get;
private set; }
83 public float Height {
get;
private set; }
91 public Vector3 UpAxis {
get;
private set; }
bool CreateDebugPrimitives
Set to true if you want the engine to create the debug primitives
Represents a three dimensional mathematical vector.
static readonly Vector3 UnitZ
The Z unit SiliconStudio.Core.Mathematics.Vector3 (0, 0, 1).
CapsuleColliderShape(bool is2D, float radius, float height, Vector3 upAxis)
Initializes a new instance of the CapsuleColliderShape class.
static readonly Vector3 UnitX
The X unit SiliconStudio.Core.Mathematics.Vector3 (1, 0, 0).
using SiliconStudio.Paradox. Physics
SiliconStudio.Core.Mathematics.Vector3 Vector3
Represents a 4x4 mathematical matrix.