Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
PhysicsAPIWrapper.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_PHYSICS_API_WRAPPER_H_
34#define DVD_PHYSICS_API_WRAPPER_H_
35
38
39namespace Divide
40{
41
42struct SGNRayResult;
43struct Ray;
44
45enum class RigidBodyShape : U8 {
46 SHAPE_SPHERE = 0,
54};
55
56class Scene;
57class PhysicsAsset;
58
59FWD_DECLARE_MANAGED_CLASS(SceneGraphNode);
60
61enum class ErrorCode : I8;
62enum class PhysicsGroup : U8;
63class RigidBodyComponent;
64
66{
67 public:
68 explicit PhysicsAPIWrapper( PlatformContext& context );
69
70 virtual bool convertActor(PhysicsAsset* actor, PhysicsGroup newGroup) = 0;
71
72 protected:
73 friend class PXDevice;
74 virtual ErrorCode initPhysicsAPI(U8 targetFrameRate, F32 simSpeed) = 0;
75 virtual bool closePhysicsAPI() = 0;
76 virtual void updateTimeStep(U8 timeStepFactor, F32 simSpeed) = 0;
77 virtual void idle() = 0;
78 virtual bool initPhysicsScene(Scene& scene) = 0;
79 virtual bool destroyPhysicsScene(const Scene& scene) = 0;
80
81 virtual void frameStarted( const U64 deltaTimeGameUS ) = 0;
82 virtual void frameEnded( const U64 deltaTimeGameUS ) = 0;
83
85
86 virtual bool intersect(const Ray& intersectionRay, vec2<F32> range, vector<SGNRayResult>& intersectionsOut) const = 0;
87};
88
90
91}; // namespace Divide
92
93#endif //DVD_PHYSICS_API_WRAPPER_H_
#define FWD_DECLARE_MANAGED_CLASS(T)
#define NOINITVTABLE
virtual void frameEnded(const U64 deltaTimeGameUS)=0
virtual bool intersect(const Ray &intersectionRay, vec2< F32 > range, vector< SGNRayResult > &intersectionsOut) const =0
virtual bool convertActor(PhysicsAsset *actor, PhysicsGroup newGroup)=0
virtual bool closePhysicsAPI()=0
virtual bool initPhysicsScene(Scene &scene)=0
virtual void updateTimeStep(U8 timeStepFactor, F32 simSpeed)=0
virtual bool destroyPhysicsScene(const Scene &scene)=0
virtual void frameStarted(const U64 deltaTimeGameUS)=0
virtual ErrorCode initPhysicsAPI(U8 targetFrameRate, F32 simSpeed)=0
virtual PhysicsAsset * createRigidActor(SceneGraphNode *node, RigidBodyComponent &parentComp)=0
virtual void idle()=0
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
uint8_t U8
eastl::vector< Type > vector
Definition: Vector.h:42
uint64_t U64