MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / onDigitalInputEvent

Method onDigitalInputEvent

physx/samples/samplebridges/SampleBridgesCCT.cpp:74–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void SampleBridges::onDigitalInputEvent(const InputEvent& ie, bool val)
75{
76 switch (ie.m_Id)
77 {
78 case RETRY:
79 {
80 if(val)
81 {
82#ifdef CCT_ON_BRIDGES
83 mActor->reset();
84 mCCTCamera->setView(0,0);
85#endif
86 }
87 }
88 break;
89 case TELEPORT:
90 {
91 if(val)
92 {
93#ifdef CCT_ON_BRIDGES
94 if(mCurrentPlatform==0xffffffff)
95 mCurrentPlatform = 0;
96 else
97 {
98 mCurrentPlatform++;
99 if(mCurrentPlatform==mPlatformManager.getNbPlatforms())
100 mCurrentPlatform = 0;
101 }
102 const KinematicPlatform* platform = mPlatformManager.getPlatforms()[mCurrentPlatform];
103 const float y = 3.0f;
104 #ifdef PLATFORMS_AS_OBSTACLES
105 mActor->teleport(platform->getRenderPose().p+PxVec3(0.0f, y, 0.0f));
106 #else
107 mActor->teleport(platform->getPhysicsPose().p+PxVec3(0.0f, y, 0.0f));
108 #endif
109#endif
110 }
111 }
112 break;
113 case CAMERA_LINK:
114 {
115 if(val)
116 {
117#ifdef CCT_ON_BRIDGES
118 mCCTCamera->setCameraLinkToPhysics(!mCCTCamera->getCameraLinkToPhysics());
119#endif
120 }
121 }
122 break;
123 case DEBUG_RENDER:
124 {
125 if(val)
126 mEnableCCTDebugRender = !mEnableCCTDebugRender;
127 }
128 }
129
130 PhysXSample::onDigitalInputEvent(ie,val);
131}

Callers

nothing calls this directly

Calls 8

getNbPlatformsMethod · 0.80
getPlatformsMethod · 0.80
teleportMethod · 0.80
PxVec3Class · 0.50
resetMethod · 0.45
setViewMethod · 0.45

Tested by

no test coverage detected