/// <summary> /// Adds a child shape. /// </summary> /// <param name="shape">The shape.</param> public void AddChildShape(ColliderShape shape) { colliderShapes.Add(shape); InternalCompoundShape.AddChildShape(shape.PositiveCenterMatrix, shape.InternalShape); shape.Parent = this; }
/// <summary> /// Adds a child shape. /// </summary> /// <param name="shape">The shape.</param> public void AddChildShape(ColliderShape shape) { colliderShapes.Add(shape); var compoundMatrix = Matrix.RotationQuaternion(shape.LocalRotation) * Matrix.Translation(shape.LocalOffset); InternalCompoundShape.AddChildShape(compoundMatrix, shape.InternalShape); shape.Parent = this; }
public CompoundShape(CollisionShape[] shapes, OpenTK.Matrix4[] transforms) { this.shapes.AddRange(shapes); this.transforms.AddRange(transforms); com = new BulletSharp.CompoundShape(); for (var i = 0; i < shapes.Length; i++) { com.AddChildShape(transforms[i], shapes[i].BulletShape); } BulletShape = com; BulletShape.UserObject = this; }
public void AddShape(CollisionShape shape, OpenTK.Matrix4 transform) { com.AddChildShape(transform, shape.BulletShape); transforms.Add(transform); shapes.Add(shape); }