NSPhysicsEntity: Create identifier .isPhysics unique to physics based entities
This commit is contained in:
parent
ee820f3ed1
commit
2fb002aab1
2 changed files with 13 additions and 4 deletions
|
@ -120,4 +120,6 @@ public:
|
|||
nonvirtual void ApplyTorqueCenter(vector);
|
||||
/** Called by the physics routine to figure out the impact damage. */
|
||||
nonvirtual float CalculateImpactDamage(int,int);
|
||||
};
|
||||
};
|
||||
|
||||
noref .bool isPhysics;
|
|
@ -14,11 +14,12 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
//#define ODE_MODE 1
|
||||
#define ODE_MODE 1
|
||||
|
||||
void
|
||||
NSPhysicsEntity::NSPhysicsEntity(void)
|
||||
{
|
||||
isPhysics = true;
|
||||
mass = 1.0f;
|
||||
m_flInertiaScale = 1.0f;
|
||||
|
||||
|
@ -412,8 +413,11 @@ NSPhysicsEntity::ApplyForceCenter(vector vecForce)
|
|||
{
|
||||
if (physics_supported() == TRUE) {
|
||||
physics_addforce(this, vecForce, [0,0,0]);
|
||||
#ifdef ODE_MODE
|
||||
//velocity += vecForce;
|
||||
#endif
|
||||
} else {
|
||||
velocity = vecForce;
|
||||
velocity += vecForce;
|
||||
}
|
||||
|
||||
/* make sure touch think is called */
|
||||
|
@ -425,8 +429,11 @@ NSPhysicsEntity::ApplyForceOffset(vector vecForce, vector vecOffset)
|
|||
{
|
||||
if (physics_supported() == TRUE) {
|
||||
physics_addforce(this, vecForce, vecOffset);
|
||||
#ifdef ODE_MODE
|
||||
//velocity += vecForce;
|
||||
#endif
|
||||
} else {
|
||||
velocity = vecForce;
|
||||
velocity += vecForce;
|
||||
}
|
||||
|
||||
/* make sure touch think is called */
|
||||
|
|
Loading…
Reference in a new issue