Nuclide
Software Development Kit for id Technology
NSPhysicsConstraint.h
1/*
2 * Copyright (c) 2023 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16typedef enum
17{
18 CONSTRAINT_FIXED = -1,
19 CONSTRAINT_INVALID,
20 CONSTRAINT_POINT,
21 CONSTRAINT_HINGE,
22 CONSTRAINT_SLIDER,
23 CONSTRAINT_UNIVERSAL,
24 CONSTRAINT_HINGE2
25} constraint_t;
26
35class
37{
38public:
39 void NSPhysicsConstraint(void);
40
41 virtual void SpawnKey(string, string);
42
43#ifdef SERVER
44 virtual void Save(float);
45 virtual void Restore(string,string);
46 virtual void Input(entity, string, string);
47#endif
48
49 virtual void Spawned(void);
50 virtual void OnRemoveEntity(void);
51
53 nonvirtual void WakeTargets(void);
54
56 nonvirtual void Break(entity);
57
59 nonvirtual constraint_t GetConstraintType(void);
61 nonvirtual entity GetEntity1(void);
63 nonvirtual entity GetEntity2(void);
64
66 nonvirtual void SetConstraintType(constraint_t);
68 nonvirtual void SetEntity1(entity);
70 nonvirtual void SetEntity2(entity);
71 //nonvirtual void SetBone1(float);
72 //nonvirtual void SetBone2(float);
73
75 nonvirtual void SetSliderVelocity(float);
77 nonvirtual void SetSliderMaxVelocity(float);
79 nonvirtual void SetSliderStop(float);
81 nonvirtual void SetSliderFriction(float);
82
84 nonvirtual float GetSliderVelocity(void);
86 nonvirtual float GetSliderMaxVelocity(void);
88 nonvirtual float GetSliderStop(void);
90 nonvirtual float GetSliderFriction(void);
92 nonvirtual float GetConstraintSystemID(void);
93
95 nonvirtual NSPhysicsConstraint Ballsocket(entity, entity, vector, vector, float, bool);
97 nonvirtual NSPhysicsConstraint Weld(entity, entity, float, float, float, bool, bool);
99 nonvirtual NSPhysicsConstraint Rope(entity, entity, vector, vector);
100
101 nonvirtual NSPhysicsConstraint KeepUpright(entity, vector, float);
102
103 nonvirtual void ConstraintThink(void);
104
105private:
106
107 float m_flTorqueLimit;
108 float m_flForceLimit;
109 string m_strEnt1;
110 string m_strEnt2;
111 string m_strBreakSound;
112 string m_strOnBreak;
113 string m_strConstraintSystem;
114};
NSEntity is the lowest of the user-accessible entity class.
Definition: NSEntity.h:54
This entity class represents constraints for physically-simulated entities.
Definition: NSPhysicsConstraint.h:37