ScummVM API documentation
PhysicsJointSlider.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * Copyright (C) 2006-2010 - Frictional Games
24 *
25 * This file is part of HPL1 Engine.
26 */
27
28#ifndef HPL_PHYSICS_JOINT_SLIDER_H
29#define HPL_PHYSICS_JOINT_SLIDER_H
30
31#include "hpl1/engine/physics/PhysicsJoint.h"
32
33namespace hpl {
34
35//-----------------------------------
36
37kSaveData_ChildClass(iPhysicsJoint, iPhysicsJointSlider) {
38 kSaveData_ClassInit(iPhysicsJointSlider) public : float mfMaxDistance;
39 float mfMinDistance;
40 cVector3f mvPin;
41
42 virtual iSaveObject *CreateSaveObject(cSaveObjectHandler * apSaveObjectHandler, cGame * apGame);
43 virtual int GetSaveCreatePrio();
44};
45
46//-----------------------------------
47
49 typedef iPhysicsJoint super;
50
51public:
52 iPhysicsJointSlider(const tString &asName, iPhysicsBody *apParentBody, iPhysicsBody *apChildBody,
53 iPhysicsWorld *apWorld, const cVector3f &avPivotPoint)
54 : iPhysicsJoint(asName, apParentBody, apChildBody, apWorld, avPivotPoint) {}
55 virtual ~iPhysicsJointSlider() {}
62 virtual void SetMaxDistance(float afX) = 0;
67 virtual void SetMinDistance(float afX) = 0;
68 virtual float GetMaxDistance() = 0;
69 virtual float GetMinDistance() = 0;
70
71 ePhysicsJointType GetType() { return ePhysicsJointType_Slider; }
72
73 // SaveObject implementation
75 virtual void SaveToSaveData(iSaveData *apSaveData);
76 virtual void LoadFromSaveData(iSaveData *apSaveData);
77 virtual void SaveDataSetup(cSaveObjectHandler *apSaveObjectHandler, cGame *apGame);
78
79protected:
80 float mfMaxDistance;
81 float mfMinDistance;
82 cVector3f mvPin;
83};
84
85} // namespace hpl
86
87#endif // HPL_PHYSICS_JOINT_SLIDER_H
Definition: str.h:59
Definition: Game.h:91
Definition: SaveGame.h:183
Definition: PhysicsBody.h:117
Definition: PhysicsJoint.h:135
Definition: PhysicsJointSlider.h:48
virtual iSaveData * CreateSaveData()
virtual void LoadFromSaveData(iSaveData *apSaveData)
virtual void SetMaxDistance(float afX)=0
virtual void SetMinDistance(float afX)=0
virtual void SaveToSaveData(iSaveData *apSaveData)
virtual void SaveDataSetup(cSaveObjectHandler *apSaveObjectHandler, cGame *apGame)
Definition: PhysicsWorld.h:115
Definition: SaveGame.h:111
Definition: SaveGame.h:130