NSPhysicsEntity: Create identifier .isPhysics unique to physics based entities

This commit is contained in:
Marco Cawthorne 2023-09-28 18:43:22 -07:00
parent ee820f3ed1
commit 2fb002aab1
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 13 additions and 4 deletions

View File

@ -120,4 +120,6 @@ public:
nonvirtual void ApplyTorqueCenter(vector); nonvirtual void ApplyTorqueCenter(vector);
/** Called by the physics routine to figure out the impact damage. */ /** Called by the physics routine to figure out the impact damage. */
nonvirtual float CalculateImpactDamage(int,int); nonvirtual float CalculateImpactDamage(int,int);
}; };
noref .bool isPhysics;

View File

@ -14,11 +14,12 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
//#define ODE_MODE 1 #define ODE_MODE 1
void void
NSPhysicsEntity::NSPhysicsEntity(void) NSPhysicsEntity::NSPhysicsEntity(void)
{ {
isPhysics = true;
mass = 1.0f; mass = 1.0f;
m_flInertiaScale = 1.0f; m_flInertiaScale = 1.0f;
@ -412,8 +413,11 @@ NSPhysicsEntity::ApplyForceCenter(vector vecForce)
{ {
if (physics_supported() == TRUE) { if (physics_supported() == TRUE) {
physics_addforce(this, vecForce, [0,0,0]); physics_addforce(this, vecForce, [0,0,0]);
#ifdef ODE_MODE
//velocity += vecForce;
#endif
} else { } else {
velocity = vecForce; velocity += vecForce;
} }
/* make sure touch think is called */ /* make sure touch think is called */
@ -425,8 +429,11 @@ NSPhysicsEntity::ApplyForceOffset(vector vecForce, vector vecOffset)
{ {
if (physics_supported() == TRUE) { if (physics_supported() == TRUE) {
physics_addforce(this, vecForce, vecOffset); physics_addforce(this, vecForce, vecOffset);
#ifdef ODE_MODE
//velocity += vecForce;
#endif
} else { } else {
velocity = vecForce; velocity += vecForce;
} }
/* make sure touch think is called */ /* make sure touch think is called */