This provides a number of optional tools for working with a Mezzanine::World. More...
#include <rayquerytool.h>
Public Member Functions | |
RayQueryTool () | |
Create a RayQueryTool ready for querying. | |
Boolean | ClearReturns () |
Clears an previously stored return values. More... | |
Boolean | GetFirstObjectOnRayByAABB (Ray ObjectRay, Whole ObjectFlags) |
Partially implemented. This should find the first Object that is on or almost on the a given Ray. More... | |
Boolean | 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... | |
Boolean | 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... | |
Boolean | RayPlaneIntersection (const Ray &QueryRay, const Plane &QueryPlane) |
Where does this Ray Meet this Plane? More... | |
Static Public Member Functions | |
static Ray | GetMouseRay (Real Length=1000) |
Get a Ray from the current viewport, following the mouse. More... | |
static String | SerializableName () |
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.
Boolean Mezzanine::RayQueryTool::ClearReturns | ( | ) |
Clears an previously stored return values.
returns false.
Definition at line 151 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 267 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 176 of file rayquerytool.cpp.
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
Length | how long of a ray do you want? Thsi defaults to 1000 |
Definition at line 353 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 165 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 162 of file rayquerytool.cpp.
Boolean Mezzanine::RayQueryTool::LastQueryResultsValid | ( | ) | const |
Check to see if the last query found anything.
Definition at line 159 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 406 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 368 of file rayquerytool.cpp.
Boolean 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 291 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 440 of file rayquerytool.cpp.