Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
BoxColliderShape.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core.Mathematics;
4 using SiliconStudio.Paradox.Graphics;
5 
6 namespace SiliconStudio.Paradox.Physics
7 {
9  {
10  /// <summary>
11  /// Initializes a new instance of the <see cref="BoxColliderShape"/> class.
12  /// </summary>
13  /// <param name="halfExtents">The half extents.</param>
14  public BoxColliderShape(Vector3 halfExtents)
15  {
16  Type = ColliderShapeTypes.Box;
17  Is2D = false;
18 
19  HalfExtents = halfExtents;
20 
21  InternalShape = new BulletSharp.BoxShape(halfExtents);
22 
23  if (!PhysicsEngine.Singleton.CreateDebugPrimitives) return;
24  DebugPrimitive = GeometricPrimitive.Cube.New(PhysicsEngine.Singleton.DebugGraphicsDevice);
25  DebugPrimitiveScaling = Matrix.Scaling((halfExtents * 2.0f) * 1.01f);
26  }
27 
28  /// <summary>
29  /// Gets the half extents.
30  /// </summary>
31  /// <value>
32  /// The half extents.
33  /// </value>
34  public Vector3 HalfExtents { get; private set; }
35  }
36 }
bool CreateDebugPrimitives
Set to true if you want the engine to create the debug primitives
Represents a three dimensional mathematical vector.
Definition: Vector3.cs:42
BoxColliderShape(Vector3 halfExtents)
Initializes a new instance of the BoxColliderShape class.
using SiliconStudio.Paradox. Physics