Nuclide
Software Development Kit for id Tech
NSPhysicsConstraint.h
Go to the documentation of this file.
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{
26
34class
36{
37public:
38 void NSPhysicsConstraint(void);
39
40 virtual void SpawnKey(string, string);
41
42#ifdef SERVER
43 virtual void Save(float);
44 virtual void Restore(string,string);
45 virtual void Input(entity, string, string);
46#endif
47
48 virtual void Spawned(void);
49 virtual void OnRemoveEntity(void);
50
52 nonvirtual void WakeTargets(void);
53
55 nonvirtual void Break(entity);
56
58 nonvirtual constraint_t GetConstraintType(void);
60 nonvirtual entity GetEntity1(void);
62 nonvirtual entity GetEntity2(void);
63
65 nonvirtual void SetConstraintType(constraint_t);
67 nonvirtual void SetEntity1(entity);
69 nonvirtual void SetEntity2(entity);
70 //nonvirtual void SetBone1(float);
71 //nonvirtual void SetBone2(float);
72
74 nonvirtual void SetSliderVelocity(float);
76 nonvirtual void SetSliderMaxVelocity(float);
78 nonvirtual void SetSliderStop(float);
80 nonvirtual void SetSliderFriction(float);
81
83 nonvirtual float GetSliderVelocity(void);
85 nonvirtual float GetSliderMaxVelocity(void);
87 nonvirtual float GetSliderStop(void);
89 nonvirtual float GetSliderFriction(void);
91 nonvirtual float GetConstraintSystemID(void);
92
94 nonvirtual NSPhysicsConstraint Ballsocket(entity, entity, vector, vector, float, bool);
96 nonvirtual NSPhysicsConstraint Weld(entity, entity, float, float, float, bool, bool);
98 nonvirtual NSPhysicsConstraint Rope(entity, entity, vector, vector);
99
100 nonvirtual NSPhysicsConstraint KeepUpright(entity, vector, float);
101
102 nonvirtual void ConstraintThink(void);
103
104private:
105
106 float m_flTorqueLimit;
107 float m_flForceLimit;
108 string m_strEnt1;
109 string m_strEnt2;
110 string m_strBreakSound;
111 string m_strOnBreak;
112 string m_strConstraintSystem;
113};
constraint_t
Definition: NSPhysicsConstraint.h:17
@ CONSTRAINT_HINGE
Hinge joint constraint.
Definition: NSPhysicsConstraint.h:21
@ CONSTRAINT_INVALID
Nothing.
Definition: NSPhysicsConstraint.h:19
@ CONSTRAINT_HINGE2
Hinge 2.
Definition: NSPhysicsConstraint.h:24
@ CONSTRAINT_SLIDER
Slider setup.
Definition: NSPhysicsConstraint.h:22
@ CONSTRAINT_POINT
Point constraint, aka ballsocket or ball constraint, like phys_ballsocket.
Definition: NSPhysicsConstraint.h:20
@ CONSTRAINT_FIXED
Fixed constraint, aka weld, aka phys_constraint.
Definition: NSPhysicsConstraint.h:18
@ CONSTRAINT_UNIVERSAL
Universal? TBA.
Definition: NSPhysicsConstraint.h:23
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:36