Panda3D
Loading...
Searching...
No Matches
physxJoint.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file physxJoint.h
10 * @author enn0x
11 * @date 2009-10-02
12 */
13
14#ifndef PHYSXJOINT_H
15#define PHYSXJOINT_H
16
17#include "pandabase.h"
18#include "pointerTo.h"
19#include "luse.h"
20
21#include "physxObject.h"
22#include "physxEnums.h"
23#include "physx_includes.h"
24
25class PhysxActor;
26class PhysxScene;
27
28/**
29 * Abstract base class for the different types of joints. All joints are used
30 * to connect two dynamic actors, or an actor and the environment.
31 */
32class EXPCL_PANDAPHYSX PhysxJoint : public PhysxObject, public PhysxEnums {
33
34PUBLISHED:
35 void release();
36
37 PhysxActor *get_actor(unsigned int idx) const;
38 PhysxScene *get_scene() const;
39
40 void purge_limit_planes();
41
42 void set_name(const char *name);
43 void set_global_anchor(const LPoint3f &anchor);
44 void set_global_axis(const LVector3f &axis);
45 void set_breakable(float maxForce, float maxTorque);
46 void set_solver_extrapolation_factor(float factor);
47 void set_use_acceleration_spring(bool value);
48 void set_limit_point(const LPoint3f &pos, bool isOnActor2=true);
49 void add_limit_plane(const LVector3f &normal, const LPoint3f &pointInPlane, float restitution=0.0f);
50
51 const char *get_name() const;
52 LPoint3f get_global_anchor() const;
53 LVector3f get_global_axis() const;
54 float get_solver_extrapolation_factor() const;
55 bool get_use_acceleration_spring() const;
56
57 INLINE void ls() const;
58 INLINE void ls(std::ostream &out, int indent_level=0) const;
59
60public:
61 static PhysxJoint *factory(NxJointType shapeType);
62
63 virtual NxJoint *ptr() const = 0;
64
65 virtual void link(NxJoint *shapePtr) = 0;
66 virtual void unlink() = 0;
67
68protected:
69 INLINE PhysxJoint();
70
71private:
72 std::string _name;
73
74public:
75 static TypeHandle get_class_type() {
76 return _type_handle;
77 }
78 static void init_type() {
79 PhysxObject::init_type();
80 register_type(_type_handle, "PhysxJoint",
81 PhysxObject::get_class_type());
82 }
83 virtual TypeHandle get_type() const {
84 return get_class_type();
85 }
86 virtual TypeHandle force_init_type() {
87 init_type();
88 return get_class_type();
89 }
90
91private:
92 static TypeHandle _type_handle;
93};
94
95#include "physxJoint.I"
96
97#endif // PHYSXJOINT_H
Actors are the main simulation objects.
Definition physxActor.h:44
This class exists just to provide scoping for the enums shared by PhysX classes.
Definition physxEnums.h:355
Abstract base class for the different types of joints.
Definition physxJoint.h:32
A scene is a collection of bodies, constraints, and effectors which can interact.
Definition physxScene.h:69
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...