예제 #1
0
        void CreateCollider()
        {
            _colliderComponent = new StaticColliderComponent();

            var shape = new StaticMeshColliderShape(colVerts, tris,
                                                    Vector3.One);

            _colliderComponent.ColliderShape = shape;
            _colliderComponent.CanSleep      = true;
            Entity.Add(_colliderComponent);
        }
예제 #2
0
        /// <summary>
        /// Creates the physics collider
        /// </summary>
        private void CreateCollider()
        {
            _colliderComponent = new StaticColliderComponent();
            var shape = new StaticMeshColliderShape(_colVertices, indices, Vector3.One);

            _colliderComponent.ColliderShape = shape;

            // Not sure if this is strictly necessary but can save cpu time according to the docs
            _colliderComponent.CanSleep = true;

            Entity.Add(_colliderComponent);
        }