public override CollisionProxy CreateBoxCollision(IBoxShape shape, int layer = 1, int mask = -1)
        {
            CollisionObject co = new CollisionObject();

            co.CollisionShape = new BoxShape(shape.HalfSize.ToBullet());
            world.AddCollisionObject(co, (short)layer, (short)mask);
            return(new BulletCollision(co, null));
        }
Пример #2
0
    public AutoMesh SpawnMesh(IBoxShape shape)
    {
        GameObject go   = new GameObject();
        BoxMesh    mesh = go.AddComponent <BoxMesh>();

        mesh.material = defaultMaterial;
        mesh.SetHalfSize(shape.HalfSize.x, shape.HalfSize.y, shape.HalfSize.z);
        return(mesh);
    }
Пример #3
0
        void ILeafVisitorOf <IBoxShape> .Visit(IBoxShape boxShape)
        {
            IModel model;

            if (!_allocatedModels.TryGetValue(boxShape, out model))
            {
                model = _allocatedModels[boxShape] = Models.Cube.Translated(-0.5f, -0.5f, -0.5f).Scaled(boxShape.Descriptor.WidthX,
                                                                                                        boxShape.Descriptor.WidthY,
                                                                                                        boxShape.Descriptor.WidthZ);
            }
            DrawShape(boxShape, model);
        }
 /// <summary>
 /// Create standard box collision
 /// </summary>
 /// <param name="shape">box shape interface</param>
 /// <param name="layer">layer of collision</param>
 /// <param name="mask">mask of collision</param>
 public abstract CollisionProxy CreateBoxCollision(IBoxShape shape, int layer = 1, int mask = -1);
Пример #5
0
 public void CopyStateTo(IBoxShape element)
 {
     element.Descriptor = Descriptor;
 }
Пример #6
0
 public void CopyStateTo(IBoxShape element)
 {
     element.Descriptor = Descriptor;
 }