Panda3D
Loading...
Searching...
No Matches
physxSphericalJointDesc.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 physxSphericalJointDesc.h
10 * @author enn0x
11 * @date 2009-09-28
12 */
13
14#ifndef PHYSXSPHERICALJOINTDESC_H
15#define PHYSXSPHERICALJOINTDESC_H
16
17#include "pandabase.h"
18
19#include "physxJointDesc.h"
20#include "physx_includes.h"
21
22class PhysxSpringDesc;
24
25/**
26 * Descriptor class for distance joint. See PhysxSphericalJoint.
27 */
28class EXPCL_PANDAPHYSX PhysxSphericalJointDesc : public PhysxJointDesc {
29
30PUBLISHED:
31 INLINE PhysxSphericalJointDesc();
32 INLINE ~PhysxSphericalJointDesc();
33
34 INLINE void set_to_default();
35 INLINE bool is_valid() const;
36
37 void set_projection_distance(float distance);
38 void set_flag(PhysxSphericalJointFlag flag, bool value);
39 void set_swing_axis(const LVector3f &axis);
40 void set_twist_spring(const PhysxSpringDesc &spring);
41 void set_swing_spring(const PhysxSpringDesc &spring);
42 void set_joint_spring(const PhysxSpringDesc &spring);
45 void set_swing_limit(const PhysxJointLimitDesc &limit);
46 void set_projection_mode(PhysxProjectionMode mode);
47
48 float get_projection_distance() const;
49 bool get_flag(PhysxSphericalJointFlag flag) const;
50 LVector3f get_swing_axis() const;
51 PhysxSpringDesc get_twist_spring() const;
52 PhysxSpringDesc get_swing_spring() const;
53 PhysxSpringDesc get_joint_spring() const;
54 PhysxJointLimitDesc get_twist_limit_low() const;
55 PhysxJointLimitDesc get_twist_limit_high() const;
57 PhysxProjectionMode get_projection_mode() const;
58
59public:
60 NxJointDesc *ptr() const { return (NxJointDesc *)&_desc; };
61 NxSphericalJointDesc _desc;
62};
63
65
66#endif // PHYSXSPHERICALJOINTDESC_H
Describes a joint limit.
void set_twist_limit_low(const PhysxJointLimitDesc &low)
Limits rotation around twist axis.
void set_swing_limit(const PhysxJointLimitDesc &limit)
Limits swing of twist axis.
void set_projection_distance(float distance)
Set the distance above which to project joint.
void set_projection_mode(PhysxProjectionMode mode)
Use this to enable joint projection.
void set_to_default()
(re)sets the structure to the default.
void set_joint_spring(const PhysxSpringDesc &spring)
Sets a spring that lets the joint get pulled apart.
void set_swing_spring(const PhysxSpringDesc &spring)
Sets a spring that works against swinging.
void set_twist_spring(const PhysxSpringDesc &spring)
Sets a spring that works against twisting.
bool is_valid() const
Returns true if the descriptor is valid.
void set_swing_axis(const LVector3f &axis)
Set the swing limit axis defined in the joint space of actor 0.
void set_twist_limit_high(const PhysxJointLimitDesc &high)
Limits rotation around twist axis.
void set_flag(PhysxSphericalJointFlag flag, bool value)
Sets or clears a single SphericalJointFlag flag.
PhysxJointLimitDesc get_swing_limit() const
Limits swing of twist axis.
Describes a joint spring.
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.