Class SBDTypeRay#
This class implements a ray. More...
#include <SBDTypeRay.hpp>
Public Functions#
| Type | Name |
|---|---|
| SBDTypeRay () Constructs a ray with default values. |
|
| SBDTypeRay (const SBPosition3 & origin, const SBVector3 & direction) Constructs a ray with the specified origin and direction. |
|
| const SBVector3 & | getDirection () const Returns the direction vector of the ray. |
| const SBPosition3 & | getOrigin () const Returns the origin point of the ray. |
| bool | intersectionAABB (const SBIAPosition3 & aabb) const Determines whether the ray intersects the specified axis-aligned bounding box (AABB). |
| bool | intersectionAABB (const SBIAPosition3 & aabb, SBQuantity::length & distance) const Determines whether the ray intersects the specified axis-aligned bounding box (AABB) and provides the distance to the intersection. |
| bool | intersectionSphere (const SBPosition3 & center, const SBQuantity::length & radius) const Determines whether the ray intersects a sphere defined by the given center and radius. |
| bool | intersectionSphere (const SBPosition3 & center, const SBQuantity::length & radius, SBPosition3 & intersection) const Determines whether the ray intersects a sphere and provides the intersection point. |
| bool | isSerializable () const Returns true __ |
| void | serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const Serializes the ray. |
| void | setDirection (const SBVector3 & direction) Sets the direction vector of the ray. |
| void | setOrigin (const SBPosition3 & origin) Sets the origin point of the ray. |
| void | unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) Unserializes the ray. |
| virtual | ~SBDTypeRay () Destroys the ray and releases allocated resources. |
Protected Attributes#
| Type | Name |
|---|---|
| SBDTypeRayData * | dataPointer A pointer to the private data. |
Detailed Description#
Short name: SBRay
Public Functions Documentation#
function SBDTypeRay [1/2]#
Constructs a ray with default values.
The ray's origin and direction are initialized to zero.
function SBDTypeRay [2/2]#
Constructs a ray with the specified origin and direction.
Parameters:
originThe origin point of the ray.directionThe direction vector of the ray.
function getDirection#
Returns the direction vector of the ray.
Returns:
A reference to the ray's direction vector.
function getOrigin#
Returns the origin point of the ray.
Returns:
A reference to the ray's origin.
function intersectionAABB [1/2]#
Determines whether the ray intersects the specified axis-aligned bounding box (AABB).
Parameters:
aabbThe AABB to test for intersection.
Returns:
true if the ray intersects the AABB; otherwise false.
function intersectionAABB [2/2]#
Determines whether the ray intersects the specified axis-aligned bounding box (AABB) and provides the distance to the intersection.
bool SBDTypeRay::intersectionAABB (
const SBIAPosition3 & aabb,
SBQuantity::length & distance
) const
Parameters:
aabbThe AABB to test for intersection.distanceOutput parameter that receives the distance from the ray origin to the intersection point if an intersection occurs.
Returns:
true if the ray intersects the AABB; otherwise false.
function intersectionSphere [1/2]#
Determines whether the ray intersects a sphere defined by the given center and radius.
bool SBDTypeRay::intersectionSphere (
const SBPosition3 & center,
const SBQuantity::length & radius
) const
Parameters:
centerThe center point of the sphere.radiusThe radius of the sphere.
Returns:
true if the ray intersects the sphere; otherwise false.
function intersectionSphere [2/2]#
Determines whether the ray intersects a sphere and provides the intersection point.
bool SBDTypeRay::intersectionSphere (
const SBPosition3 & center,
const SBQuantity::length & radius,
SBPosition3 & intersection
) const
Parameters:
centerThe center point of the sphere.radiusThe radius of the sphere.intersectionOutput parameter that receives the intersection point if an intersection occurs.
Returns:
true if the ray intersects the sphere; otherwise false.
function isSerializable#
Returns true __
Returns true indicating the ray type supports serialization.
Returns:
true.
function serialize#
Serializes the ray.
void SBDTypeRay::serialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const
Serializes the ray to the given serializer using the specified SDK version number.
Parameters:
serializerThe serializer to write the ray data to.sdkVersionNumberThe SDK version number to use for serialization. Defaults to SB_SDK_VERSION_NUMBER.
function setDirection#
Sets the direction vector of the ray.
Parameters:
directionThe new direction vector for the ray.
function setOrigin#
Sets the origin point of the ray.
Parameters:
originThe new origin point for the ray.
function unserialize#
Unserializes the ray.
void SBDTypeRay::unserialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
)
Deserializes the ray from the given serializer using the specified SDK version number.
Parameters:
serializerThe serializer to read the ray data from.sdkVersionNumberThe SDK version number to use for deserialization. Defaults to SB_SDK_VERSION_NUMBER.
function ~SBDTypeRay#
Destroys the ray and releases allocated resources.
Protected Attributes Documentation#
variable dataPointer#
A pointer to the private data.