ScummVM API documentation
PhysicsWorldNewton.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_WORLD_NEWTON_H
29
#define HPL_PHYSICS_WORLD_NEWTON_H
30
31
#include "hpl1/engine/physics/PhysicsWorld.h"
32
33
#include "hpl1/engine/libraries/newton/Newton.h"
34
35
namespace
hpl
{
36
class
cPhysicsWorldNewton
:
public
iPhysicsWorld
{
37
public
:
38
cPhysicsWorldNewton
();
39
~
cPhysicsWorldNewton
();
40
41
void
Simulate(
float
afTimeStep);
42
43
void
SetMaxTimeStep(
float
afTimeStep);
44
float
GetMaxTimeStep();
45
46
void
SetWorldSize(
const
cVector3f
&avMin,
const
cVector3f
&avMax);
47
cVector3f
GetWorldSizeMin();
48
cVector3f
GetWorldSizeMax();
49
50
void
SetGravity(
const
cVector3f
&avGravity);
51
cVector3f
GetGravity();
52
53
void
SetAccuracyLevel(ePhysicsAccuracy aAccuracy);
54
ePhysicsAccuracy GetAccuracyLevel();
55
56
iCollideShape
*CreateNullShape();
57
iCollideShape
*CreateBoxShape(
const
cVector3f
&avSize,
cMatrixf
*apOffsetMtx);
58
iCollideShape
*CreateSphereShape(
const
cVector3f
&avRadii,
cMatrixf
*apOffsetMtx);
59
iCollideShape
*CreateCylinderShape(
float
afRadius,
float
afHeight,
cMatrixf
*apOffsetMtx);
60
iCollideShape
*CreateCapsuleShape(
float
afRadius,
float
afHeight,
cMatrixf
*apOffsetMtx);
61
iCollideShape
*CreateMeshShape(
iVertexBuffer
*apVtxBuffer);
62
iCollideShape
*CreateCompundShape(
tCollideShapeVec
&avShapes);
63
64
iPhysicsJointBall
*CreateJointBall(
const
tString
&asName,
const
cVector3f
&avPivotPoint,
65
iPhysicsBody
*apParentBody,
iPhysicsBody
*apChildBody);
66
iPhysicsJointHinge
*CreateJointHinge(
const
tString
&asName,
const
cVector3f
&avPivotPoint,
67
const
cVector3f
&avPinDir,
68
iPhysicsBody
*apParentBody,
iPhysicsBody
*apChildBody);
69
iPhysicsJointSlider
*CreateJointSlider(
const
tString
&asName,
const
cVector3f
&avPivotPoint,
70
const
cVector3f
&avPinDir,
71
iPhysicsBody
*apParentBody,
iPhysicsBody
*apChildBody);
72
iPhysicsJointScrew
*CreateJointScrew(
const
tString
&asName,
const
cVector3f
&avPivotPoint,
73
const
cVector3f
&avPinDir,
74
iPhysicsBody
*apParentBody,
iPhysicsBody
*apChildBody);
75
76
iPhysicsBody
*CreateBody(
const
tString
&asName,
iCollideShape
*apShape);
77
78
iCharacterBody
*CreateCharacterBody(
const
tString
&asName,
const
cVector3f
&avSize);
79
80
iPhysicsMaterial
*CreateMaterial(
const
tString
&asName);
81
82
iPhysicsController
*CreateController(
const
tString
&asName);
83
84
void
CastRay(
iPhysicsRayCallback
*apCallback,
85
const
cVector3f
&avOrigin,
const
cVector3f
&avEnd,
86
bool
abCalcDist,
bool
abCalcNormal,
bool
abCalcPoint,
87
bool
abUsePrefilter =
false
);
88
89
bool
CheckShapeCollision(
iCollideShape
*apShapeA,
const
cMatrixf
&a_mtxA,
90
iCollideShape
*apShapeB,
const
cMatrixf
&a_mtxB,
91
cCollideData
&aCollideData,
int
alMaxPoints,
bool
correctNormalDirection =
false
);
92
93
void
RenderDebugGeometry(
iLowLevelGraphics
*apLowLevel,
const
cColor
&aColor);
94
95
NewtonWorld *GetNewtonWorld() {
return
mpNewtonWorld; }
96
97
private
:
98
NewtonWorld *mpNewtonWorld;
99
100
float
*mpTempPoints;
101
float
*mpTempNormals;
102
float
*mpTempDepths;
103
104
cVector3f
mvWorldSizeMin;
105
cVector3f
mvWorldSizeMax;
106
cVector3f
mvGravity;
107
float
mfMaxTimeStep;
108
109
ePhysicsAccuracy mAccuracy;
110
};
111
112
}
// namespace hpl
113
114
#endif // HPL_PHYSICS_WORLD_NEWTON_H
hpl
Definition:
AI.h:36
Common::String
Definition:
str.h:59
hpl::iVertexBuffer
Definition:
VertexBuffer.h:90
Common::Array
Definition:
array.h:52
hpl::iPhysicsRayCallback
Definition:
PhysicsWorld.h:100
hpl::iPhysicsWorld
Definition:
PhysicsWorld.h:115
hpl::cVector3< float >
hpl::iCollideShape
Definition:
CollideShape.h:50
hpl::iPhysicsJointScrew
Definition:
PhysicsJointScrew.h:48
hpl::iPhysicsBody
Definition:
PhysicsBody.h:117
hpl::iPhysicsJointHinge
Definition:
PhysicsJointHinge.h:47
hpl::cPhysicsWorldNewton
Definition:
PhysicsWorldNewton.h:36
hpl::cCollideData
Definition:
CollideData.h:46
hpl::iPhysicsMaterial
Definition:
PhysicsMaterial.h:77
hpl::iPhysicsJointBall
Definition:
PhysicsJointBall.h:48
hpl::cColor
Definition:
Color.h:37
hpl::iCharacterBody
Definition:
CharacterBody.h:153
hpl::iPhysicsController
Definition:
PhysicsController.h:122
hpl::cMatrix< float >
hpl::iPhysicsJointSlider
Definition:
PhysicsJointSlider.h:48
hpl::iLowLevelGraphics
Definition:
LowLevelGraphics.h:200
engines
hpl1
engine
impl
PhysicsWorldNewton.h
Generated on Tue Dec 24 2024 09:12:44 for ScummVM API documentation by
1.8.13