Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ReferenceApplication/ReferenceAppLayer/include/OgreRefAppJointSubtypes.h @ 5

Last change on this file since 5 was 5, checked in by anonymous, 17 years ago

=hoffentlich gehts jetzt

File size: 6.2 KB
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of the OGRE Reference Application, a layer built
4on top of OGRE(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2006 Torus Knot Software Ltd
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23
24You may alternatively use this source under the terms of a specific version of
25the OGRE Unrestricted License provided you have obtained such a license from
26Torus Knot Software Ltd.
27-----------------------------------------------------------------------------
28*/
29#ifndef __REFAPP_JOINTSUBTYPES_H__
30#define __REFAPP_JOINTSUBTYPES_H__
31
32#include "OgreRefAppPrerequisites.h"
33#include "OgreRefAppJoint.h"
34
35namespace OgreRefApp {
36
37    /** Implementation of ball joint. */
38    class _OgreRefAppExport BallJoint : public Joint
39    {
40    public:
41        BallJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
42        ~BallJoint() {}
43        /** Set the anchor point of this joint.
44        @remarks
45            Sets the location, in world space, of the anchor point of this joint, which can be
46            the hinge point or just the origin of joint.
47        */
48        void setAnchorPosition(const Vector3& point);
49
50        /** Sets the axes for this joint.
51        @remarks
52            Has no meaning for this type of joint, so does nothing.
53        */
54        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO) {}
55    protected:
56    };
57
58    /** Implementation of slider joint. */
59    class _OgreRefAppExport SliderJoint : public Joint
60    {
61    public:
62        SliderJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
63        ~SliderJoint() {}
64        /** Set the anchor point of this joint.
65        @remarks
66            Has no meaning for a slider, thus unimplemented.
67        */
68        void setAnchorPosition(const Vector3& point) {}
69
70        /** Sets the axes for this joint.
71        @remarks
72            The meaning of axes for a joint depends on it's type:
73            <ul>
74            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
75            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
76            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
77            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
78            </ul>
79        */
80        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO);
81    protected:
82    };
83
84    /** Implementation of hinge joint. */
85    class _OgreRefAppExport HingeJoint : public Joint
86    {
87    public:
88        HingeJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
89        ~HingeJoint() {}
90        /** Set the anchor point of this joint.
91        */
92        void setAnchorPosition(const Vector3& point);
93
94        /** Sets the axes for this joint.
95        @remarks
96            The meaning of axes for a joint depends on it's type:
97            <ul>
98            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
99            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
100            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
101            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
102            </ul>
103        */
104        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO);
105    protected:
106    };
107
108    /** Implementation of universal joint. */
109    class _OgreRefAppExport UniversalJoint : public Joint
110    {
111    public:
112        UniversalJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
113        ~UniversalJoint() {}
114        /** Set the anchor point of this joint.
115        */
116        void setAnchorPosition(const Vector3& point);
117
118        /** Sets the axes for this joint.
119        @remarks
120            The meaning of axes for a joint depends on it's type:
121            <ul>
122            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
123            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
124            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
125            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
126            </ul>
127        */
128        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO);
129    protected:
130    };
131
132    /** Implementation of hinge2 joint. */
133    class _OgreRefAppExport Hinge2Joint : public Joint
134    {
135    public:
136        Hinge2Joint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
137        ~Hinge2Joint() {}
138        /** Set the anchor point of this joint.
139        */
140        void setAnchorPosition(const Vector3& point);
141
142        /** Sets the axes for this joint.
143        @remarks
144            The meaning of axes for a joint depends on it's type:
145            <ul>
146            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
147            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
148            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
149            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
150            </ul>
151        */
152        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO);
153    protected:
154    };
155
156}
157
158#endif
Note: See TracBrowser for help on using the repository browser.