Пример #1
0
        /// <summary>
        /// Adds the rigid body to the engine processing pipeline.
        /// </summary>
        /// <param name="rigidBody">The rigid body.</param>
        /// <exception cref="System.Exception">Cannot perform this action when the physics engine is set to CollisionsOnly</exception>
        public void AddRigidBody(RigidBody rigidBody)
        {
            if (discreteDynamicsWorld == null)
            {
                throw new Exception("Cannot perform this action when the physics engine is set to CollisionsOnly");
            }

            discreteDynamicsWorld.AddRigidBody(rigidBody.InternalRigidBody);
        }
Пример #2
0
        internal void AddRigidBody(RigidbodyComponent rigidBody, CollisionFilterGroupFlags group, CollisionFilterGroupFlags mask)
        {
            if (discreteDynamicsWorld == null)
            {
                throw new Exception("Cannot perform this action when the physics engine is set to CollisionsOnly");
            }

            discreteDynamicsWorld.AddRigidBody(rigidBody.InternalRigidBody, (short)group, (short)mask);
        }
Пример #3
0
        /// <summary>
        /// Adds the rigid body to the engine processing pipeline.
        /// </summary>
        /// <param name="rigidBody">The rigid body.</param>
        /// <param name="group">The group.</param>
        /// <param name="mask">The mask.</param>
        /// <exception cref="System.Exception">Cannot perform this action when the physics engine is set to CollisionsOnly</exception>
        public void AddRigidBody(RigidBody rigidBody, CollisionFilterGroupFlags group, CollisionFilterGroupFlags mask)
        {
            if (discreteDynamicsWorld == null)
            {
                throw new Exception("Cannot perform this action when the physics engine is set to CollisionsOnly");
            }

            discreteDynamicsWorld.AddRigidBody(rigidBody.InternalRigidBody, (short)group, (short)mask);

            aliveColliders.Add(rigidBody.InternalRigidBody, rigidBody);

            rigidBody.Simulation = this;
        }