/// <summary> /// Kinematic convex hull constructor. /// </summary> /// <param name="core">Engine core.</param> /// <param name="scene">Scene to add physics properties.</param> /// <param name="matrix">Starting transform.</param> /// <param name="points">Points defining convex hull.</param> public PhysicsColliderComponent(DeepCore core, Scene scene, Matrix matrix, List <Vector3> points) : base(core) { // Store references this.scene = scene; // Add physics entity physicsEntity = new ConvexHull(points); physicsEntity.WorldTransform = matrix; scene.Space.Add(physicsEntity); type = PhysicsPrimitiveType.ConvexHull; }
/// <summary> /// Dynamic Box constructor. /// </summary> /// <param name="core">Engine core.</param> /// <param name="scene">Scene to add physics properties.</param> /// <param name="matrix">Starting transform.</param> /// <param name="width">Width of box.</param> /// <param name="height">Height of box.</param> /// <param name="length">Length of box.</param> /// <param name="mass">Mass of box.</param> public PhysicsColliderComponent(DeepCore core, Scene scene, Matrix matrix, float width, float height, float length, float mass) : base(core) { // Store references this.scene = scene; // Add physics entity physicsEntity = new Box(Vector3.Zero, width, height, length, mass); physicsEntity.WorldTransform = matrix; scene.Space.Add(physicsEntity); type = PhysicsPrimitiveType.Box; }
/// <summary> /// Kinematic Sphere constructor. /// </summary> /// <param name="core">Engine core.</param> /// <param name="scene">Scene to add physics properties.</param> /// <param name="matrix">Starting transform.</param> /// <param name="radius">Radius of sphere.</param> public PhysicsColliderComponent(DeepCore core, Scene scene, Matrix matrix, float radius) : base(core) { // Store references this.scene = scene; // Add physics entity physicsEntity = new Sphere(Vector3.Zero, radius); physicsEntity.WorldTransform = matrix; scene.Space.Add(physicsEntity); type = PhysicsPrimitiveType.Sphere; }