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
31class
33{
34public:
35 void NSPhysicsConstraint(void);
36
37
38 virtual void SpawnKey(string, string);
39
40#ifdef SERVER
41 virtual void Save(float);
42 virtual void Restore(string,string);
43 virtual void Input(entity, string, string);
44#endif
45
46 virtual void Spawned(void);
47 virtual void OnRemoveEntity(void);
48
50 nonvirtual void WakeTargets(void);
51
53 nonvirtual void Break(entity);
54
56 nonvirtual constraint_t GetConstraintType(void);
58 nonvirtual entity GetEntity1(void);
60 nonvirtual entity GetEntity2(void);
61
63 nonvirtual void SetConstraintType(constraint_t);
65 nonvirtual void SetEntity1(entity);
67 nonvirtual void SetEntity2(entity);
68 //nonvirtual void SetBone1(float);
69 //nonvirtual void SetBone2(float);
70
72 nonvirtual void SetSliderVelocity(float);
74 nonvirtual void SetSliderMaxVelocity(float);
76 nonvirtual void SetSliderStop(float);
78 nonvirtual void SetSliderFriction(float);
79
81 nonvirtual float GetSliderVelocity(void);
83 nonvirtual float GetSliderMaxVelocity(void);
85 nonvirtual float GetSliderStop(void);
87 nonvirtual float GetSliderFriction(void);
89 nonvirtual float GetConstraintSystemID(void);
90
92 nonvirtual NSPhysicsConstraint Ballsocket(entity, entity, vector, vector, float, bool);
94 nonvirtual NSPhysicsConstraint Weld(entity, entity, float, float, float, bool, bool);
96 nonvirtual NSPhysicsConstraint Rope(entity, entity, vector, vector);
97
98 nonvirtual NSPhysicsConstraint KeepUpright(entity, vector, float);
99
100 nonvirtual void ConstraintThink(void);
101
102private:
103
104 float m_flTorqueLimit;
105 float m_flForceLimit;
106 string m_strEnt1;
107 string m_strEnt2;
108 string m_strBreakSound;
109 string m_strOnBreak;
110 string m_strConstraintSystem;
111};
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:52
This entity class represents constraints for physically-simulated entities.
Definition: NSPhysicsConstraint.h:33
vector(vector) normalize
entity() spawn