Panda3D
Loading...
Searching...
No Matches
physxJointDesc.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 physxJointDesc.h
10 * @author enn0x
11 * @date 2009-09-28
12 */
13
14#ifndef PHYSXJOINTDESC_H
15#define PHYSXJOINTDESC_H
16
17#include "pandabase.h"
18#include "luse.h"
19
20#include "physxEnums.h"
21#include "physx_includes.h"
22
23class PhysxActor;
24
25/**
26 * Abstract base class for joint descriptors.
27 */
28class EXPCL_PANDAPHYSX PhysxJointDesc : public PhysxEnums {
29
30PUBLISHED:
31 virtual void set_to_default() = 0;
32 virtual bool is_valid() const = 0;
33
34 void set_name(const char *name);
35 void set_joint_flag(PhysxJointFlag flag, bool value);
36 void set_max_force(float force);
37 void set_max_torque(float torque);
38 void set_solver_extrapolation_factor(float factor);
39 void set_global_axis(const LVector3f &axis);
40 void set_global_anchor(const LPoint3f &anchor);
41 void set_local_normal(unsigned int idx, const LVector3f &normal);
42 void set_local_axis(unsigned int idx, const LVector3f &axis);
43 void set_local_anchor(unsigned int idx, const LPoint3f &anchor);
44 void set_actor(unsigned int idx, const PhysxActor &actor);
45
46 const char *get_name() const;
47 bool get_joint_flag(PhysxJointFlag flag) const;
48 float get_max_force() const;
49 float get_max_torque() const;
50 float get_solver_extrapolation_factor() const;
51 LVector3f get_local_normal(unsigned int idx) const;
52 LVector3f get_local_axis(unsigned int idx) const;
53 LPoint3f get_local_anchor(unsigned int idx) const;
54 PhysxActor *get_actor(unsigned int idx) const;
55
56public:
57 virtual NxJointDesc *ptr() const = 0;
58
59private:
60 std::string _name;
61
62protected:
63 INLINE PhysxJointDesc();
64 INLINE ~PhysxJointDesc();
65};
66
67#include "physxJointDesc.I"
68
69#endif // PHYSXJOINTDESC_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
void set_global_anchor(const LPoint3f &anchor)
Set the anchor using a world space point.
void set_solver_extrapolation_factor(float factor)
Set the extrapolation factor for solving joint constraints.
void set_local_normal(unsigned int idx, const LVector3f &normal)
Set the X axis of joint space, in actor[i]'s space, orthogonal to localAxis[i].
void set_local_anchor(unsigned int idx, const LPoint3f &anchor)
Set the attachment point of joint in actor[i]'s space.
void set_global_axis(const LVector3f &axis)
Set the local axis/normal using a world space axis.
void set_name(const char *name)
Sets a possible debug name.
void set_joint_flag(PhysxJointFlag flag, bool value)
Set or clear a single JointFlag.
void set_local_axis(unsigned int idx, const LVector3f &axis)
Set the Z axis of joint space, in actor[i]'s space.
void set_max_force(float force)
Set a possible debug name.
void set_actor(unsigned int idx, const PhysxActor &actor)
Set the two actors connected by the joint.
void set_max_torque(float torque)
Set the maximum angular force (torque) that the joint can withstand before breaking,...
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.