载入中...
搜索中...
未找到
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
24 virtual ~IPhysicsQuery() = default;
25
27 virtual int newWorld(float gravityX, float gravityY) = 0;
29 virtual int worldCount() = 0;
31 virtual bool worldGravity(int id, float* gravityX, float* gravityY) = 0;
33 virtual bool rayCast(int id, float x1, float y1, float x2, float y2, RayHitInfo* out) = 0;
35 virtual bool removeWorld(int id) = 0;
36};
37
38} // namespace eve
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
bool hit
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
I physics query.
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.
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
Ray-cast result (value type).