Browse Source

Band-aid for poorly modelled stairs

Looks like the Cyan modellers didn't extend the stair ramps all the way
down in some places. To compensate, we can now take higher steps but can't
walk on slopes quite as steep as before. I think this should balance out
nicely.
Adam Johnson 13 years ago
parent
commit
0689901c5e
  1. 2
      Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.h
  2. 10
      Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp

2
Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.h

@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsQuat.h" #include "hsQuat.h"
#define PHYSX_ONLY_TRIGGER_FROM_KINEMATIC 1 #define PHYSX_ONLY_TRIGGER_FROM_KINEMATIC 1
#define kSLOPELIMIT (cosf(hsDegreesToRadians(55.f))) #define kSLOPELIMIT (cosf(hsDegreesToRadians(45.f)))
class plCoordinateInterface; class plCoordinateInterface;
class plPhysical; class plPhysical;

10
Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp

@ -71,13 +71,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define kPhysxSkinWidth 0.1f #define kPhysxSkinWidth 0.1f
#define kPhysZOffset ((fRadius + (fHeight / 2)) + kPhysxSkinWidth) #define kPhysZOffset ((fRadius + (fHeight / 2)) + kPhysxSkinWidth)
//#define kSLOPELIMIT (cosf(NxMath::degToRad(55.f)))
//#define kPhysicalHeightFudge 0.4f // this fudge was used for PhysX 2.4
#define kPhysicalHeightFudge 0.0f #define kPhysicalHeightFudge 0.0f
#define STEP_OFFSET 1.f
//#define STEP_OFFSET 1.0f
#define STEP_OFFSET 0.5f
//#define STEP_OFFSET 0.15f
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
@ -99,9 +94,9 @@ public:
plPXPhysicalControllerCore* ac = plPXPhysicalControllerCore::FindController(hit.controller); plPXPhysicalControllerCore* ac = plPXPhysicalControllerCore::FindController(hit.controller);
NxActor& actor = hit.shape->getActor(); NxActor& actor = hit.shape->getActor();
plPXPhysical* phys = (plPXPhysical*)actor.userData; plPXPhysical* phys = (plPXPhysical*)actor.userData;
static float SlopeLimit = kSLOPELIMIT;
hsVector3 normal = plPXConvert::Vector(hit.worldNormal); hsVector3 normal = plPXConvert::Vector(hit.worldNormal);
ac->fMovementInterface->IAddContactNormals(normal); ac->fMovementInterface->IAddContactNormals(normal);
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
plDbgCollisionInfo info; plDbgCollisionInfo info;
info.fNormal = normal; info.fNormal = normal;
@ -124,6 +119,7 @@ public:
} }
ac->fDbgCollisionInfo.Append(info); ac->fDbgCollisionInfo.Append(info);
#endif PLASMA_EXTERNAL_RELEASE #endif PLASMA_EXTERNAL_RELEASE
// If the avatar hit a movable physical, apply some force to it. // If the avatar hit a movable physical, apply some force to it.
hsVector3 dir = plPXConvert::Vector(hit.dir); hsVector3 dir = plPXConvert::Vector(hit.dir);
float dirdotup=dir.fZ; float dirdotup=dir.fZ;

Loading…
Cancel
Save