Newton Dynamics  4.00
ndBodyTriggerVolume.h
1 /* Copyright (c) <2003-2022> <Julio Jerez, Newton Game Dynamics>
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty. In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 *
11 * 1. The origin of this software must not be misrepresented; you must not
12 * claim that you wrote the original software. If you use this software
13 * in a product, an acknowledgment in the product documentation would be
14 * appreciated but is not required.
15 *
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 *
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 #ifndef __ND_BODY_TRIGGER_VOLUME_H__
23 #define __ND_BODY_TRIGGER_VOLUME_H__
24 
25 #include "ndCollisionStdafx.h"
26 #include "ndBodyKinematicBase.h"
27 
28 D_MSV_NEWTON_ALIGN_32
30 {
31  public:
32  D_CLASS_REFLECTION(ndBodyTriggerVolume);
33  D_COLLISION_API ndBodyTriggerVolume();
34  D_COLLISION_API ndBodyTriggerVolume(const ndLoadSaveBase::ndLoadDescriptor& desc);
35  D_COLLISION_API virtual ~ndBodyTriggerVolume();
36 
37  ndBodyTriggerVolume* GetAsBodyTriggerVolume();
38 
39  virtual void OnTrigger(ndBodyKinematic* const body, ndFloat32 timestep);
40  virtual void OnTriggerEnter(ndBodyKinematic* const body, ndFloat32 timestep);
41  virtual void OnTriggerExit(ndBodyKinematic* const body, ndFloat32 timestep);
42 
43  D_COLLISION_API virtual void SpecialUpdate(ndFloat32 timestep);
44  D_COLLISION_API virtual void Save(const ndLoadSaveBase::ndSaveDescriptor& desc) const;
45 
46  private:
47  virtual void IntegrateExternalForce(ndFloat32 timestep);
48 
49 } D_GCC_NEWTON_ALIGN_32;
50 
51 inline ndBodyTriggerVolume* ndBodyTriggerVolume::GetAsBodyTriggerVolume()
52 {
53  return this;
54 }
55 
56 inline void ndBodyTriggerVolume::OnTriggerEnter(ndBodyKinematic* const, ndFloat32)
57 {
58  //dAssert(0);
59 }
60 
61 inline void ndBodyTriggerVolume::OnTrigger(ndBodyKinematic* const, ndFloat32)
62 {
63  //dAssert(0);
64 }
65 
66 inline void ndBodyTriggerVolume::OnTriggerExit(ndBodyKinematic* const, ndFloat32)
67 {
68  //dAssert(0);
69 }
70 
71 inline void ndBodyTriggerVolume::IntegrateExternalForce(ndFloat32)
72 {
73 }
74 
75 #endif
ndBodyKinematic
Definition: ndBodyKinematic.h:40
ndBodyKinematicBase
Definition: ndBodyKinematicBase.h:30
ndBodyTriggerVolume
Definition: ndBodyTriggerVolume.h:30
ndLoadSaveBase::ndLoadDescriptor
Definition: ndSaveLoadSytem.h:59
ndLoadSaveBase::ndSaveDescriptor
Definition: ndSaveLoadSytem.h:93