载入中...
搜索中...
未找到
PhysicsQuery.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4
5#include <string>
6
7namespace eve {
8
11 bool hit = false;
12 int bodyId = 0;
13 float x = 0.f, y = 0.f;
14 float normalX = 0.f, normalY = 0.f;
15 float fraction = 0.f;
16};
17
20public:
21 static constexpr const char* capabilityName = "IPhysicsQuery";
22
23 virtual ~IPhysicsQuery() = default;
24
26 virtual int newWorld(float gravityX, float gravityY) = 0;
28 virtual int worldCount() = 0;
30 virtual bool worldGravity(int id, float* gravityX, float* gravityY) = 0;
32 virtual bool rayCast(int id, float x1, float y1, float x2, float y2, RayHitInfo* out) = 0;
34 virtual bool removeWorld(int id) = 0;
35};
36
37} // namespace eve
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Definition Export.h:16
int y
Definition Grass.cpp:135
int x
Definition Grass.cpp:135
2D physics world query surface (provided by the physics module).
virtual int worldCount()=0
Number of worlds still alive.
virtual int newWorld(float gravityX, float gravityY)=0
Create a world with the given gravity; returns a non-negative id.
virtual bool removeWorld(int id)=0
Destroy a world.
virtual ~IPhysicsQuery()=default
virtual bool worldGravity(int id, float *gravityX, float *gravityY)=0
Gravity of a world; false when the id is unknown.
virtual bool rayCast(int id, float x1, float y1, float x2, float y2, RayHitInfo *out)=0
Segment ray-cast; fills the hit info.
Definition Build.cpp:11
Ray-cast result (value type).