This provides a number of optional tools for working with a Mezzanine::World. More...
#include <rayquerytool.h>
Public Member Functions | |
RayQueryTool () | |
Blank constructor. More... | |
RayQueryTool (World *QueryWorld) | |
Create a RayQueryTool ready for querying. More... | |
Boole | ClearReturns () |
Clears an previously stored return values. More... | |
Boole | GetFirstObjectOnRayByAABB (Ray ObjectRay, Whole ObjectFlags) |
Partially implemented. This should find the first Object that is on or almost on the a given Ray. More... | |
Boole | GetFirstObjectOnRayByPolygon (Ray ObjectRay, Whole ObjectFlags) |
This will find the first Object to intesect the Given ray. More... | |
WorldObject * | LastQueryResultsObjectPtr () const |
It is common to ray query for WorldObjects, if so the results can be retrieved with this. More... | |
Vector3 | LastQueryResultsOffset () const |
Get an offset from the last query. Depending on the last query, this could be an Offset from a variety of things. More... | |
Boole | LastQueryResultsValid () const |
Check to see if the last query found anything. More... | |
void | ProtoDeSerialize (const XML::Node &OneNode) |
Take the data stored in an XML and overwrite this instance of this object with it. More... | |
void | ProtoSerialize (XML::Node &CurrentRoot) const |
Convert this class to an XML::Node ready for serialization. More... | |
Boole | RayPlaneIntersection (const Ray &QueryRay, const Plane &QueryPlane) |
Where does this Ray Meet this Plane? More... | |
void | SetWorld (World *QueryWorld) |
Sets the World in which the ray query is to be performed. More... | |
Static Public Member Functions | |
static Ray | GetMouseRay () |
Get a Ray from the current viewport, following the mouse. More... | |
static String | GetSerializableName () |
Get the name of the the XML tag this class will leave behind as its instances are serialized. More... | |
This provides a number of optional tools for working with a Mezzanine::World.
Currently this allows for more seamless mouse use, including 'picking' of objects with the mouse, and associated functionality.
Definition at line 67 of file rayquerytool.h.
Mezzanine::RayQueryTool::RayQueryTool | ( | ) |
Blank constructor.
Definition at line 158 of file rayquerytool.cpp.
Mezzanine::RayQueryTool::RayQueryTool | ( | World * | QueryWorld | ) |
Create a RayQueryTool ready for querying.
QueryWorld | The world in which to perform the ray queries. |
Definition at line 164 of file rayquerytool.cpp.
Boole Mezzanine::RayQueryTool::ClearReturns | ( | ) |
Clears an previously stored return values.
returns false.
Definition at line 179 of file rayquerytool.cpp.
Partially implemented. This should find the first Object that is on or almost on the a given Ray.
This casts a ray through the gameworld. The first actor with an Axis Aligned Bounding Box that intersects that ray is returned. Presently this is untested and does not return the Offset of the intersection. This should perform faster than WorldQueryTool::GetFirstActorOnRayByPolygon but not by a known amount.
ActorRay | The Ray to search along. |
ObjectFlags | A whole comprising all the valid objects to be checked in the scene. See WorldAndSceneObjectType in enumerations.h for a listing of objects to use as flags. |
Definition at line 278 of file rayquerytool.cpp.
This will find the first Object to intesect the Given ray.
This use the graphics subsystem to cast a ray in the world. If the ray passes through any the triangles in an actor This will return that actor. This function runs in linear time relative to the amount of triangles in 3d meshes near the the ray being cast. This will start at ray.from and go to ray.to .
ActorRay | The Ray to search along. |
ObjectFlags | A whole comprising all the valid objects to be checked in the scene. See WorldAndSceneObjectType in enumerations.h for a listing of objects to use as flags. |
Definition at line 199 of file rayquerytool.cpp.
|
static |
Get a Ray from the current viewport, following the mouse.
This calls on the graphics subsystem to get a ray from the location of the current camera
Definition at line 369 of file rayquerytool.cpp.
|
static |
Get the name of the the XML tag this class will leave behind as its instances are serialized.
Definition at line 454 of file rayquerytool.cpp.
WorldObject * Mezzanine::RayQueryTool::LastQueryResultsObjectPtr | ( | ) | const |
It is common to ray query for WorldObjects, if so the results can be retrieved with this.
Definition at line 193 of file rayquerytool.cpp.
Vector3 Mezzanine::RayQueryTool::LastQueryResultsOffset | ( | ) | const |
Get an offset from the last query. Depending on the last query, this could be an Offset from a variety of things.
Definition at line 190 of file rayquerytool.cpp.
Boole Mezzanine::RayQueryTool::LastQueryResultsValid | ( | ) | const |
Check to see if the last query found anything.
Definition at line 187 of file rayquerytool.cpp.
void Mezzanine::RayQueryTool::ProtoDeSerialize | ( | const XML::Node & | OneNode | ) |
Take the data stored in an XML and overwrite this instance of this object with it.
OneNode | and XML::Node containing the data. |
Definition at line 420 of file rayquerytool.cpp.
void Mezzanine::RayQueryTool::ProtoSerialize | ( | XML::Node & | CurrentRoot | ) | const |
Convert this class to an XML::Node ready for serialization.
CurrentRoot | The point in the XML hierarchy that all this vector3 should be appended to. |
Definition at line 382 of file rayquerytool.cpp.
Boole Mezzanine::RayQueryTool::RayPlaneIntersection | ( | const Ray & | QueryRay, |
const Plane & | QueryPlane | ||
) |
Where does this Ray Meet this Plane?
This does some fancy math to return the point where the ray and the plane intersent.
QueryRay | This is the Ray that could intersent the plane |
QueryPlane | This is the plane to be interesected. |
Definition at line 303 of file rayquerytool.cpp.
void Mezzanine::RayQueryTool::SetWorld | ( | World * | QueryWorld | ) |
Sets the World in which the ray query is to be performed.
QueryWorld | The world in which to perform the ray queries. |
Definition at line 173 of file rayquerytool.cpp.