Rectangle specialization for Adobe Flash. More...
Public Member Functions | |
Rect () | |
Default constructor. | |
void | Read (Stream *pStream) |
Load a rectangle from the byte stream. | |
uint_t | IsIntersecting (const Vector4D_t *pRect) const |
Test for rectangle collision. | |
void | SetRect (const Matrix23 *pMatrix, const Vector4D_t *pRect) |
Set a rectangle bounds to a transformed rectangle. | |
void | TwipsToPixels (void) |
Convert the rectangle from Flash Twips to Pixels. | |
void | PixelsToTwips (void) |
Convert the rectangle from Pixels to Flash Twips. | |
void | Print (void) const |
Dump the rectangle to Debug::Message() | |
Public Member Functions inherited from Burger::Vector4D_t | |
void | Zero (void) |
Set all values to zero. | |
void | One (void) |
Set all values to 1.0f. | |
void | Identity (void) |
Initialize the vector elements to identity for a quaternion. | |
float | GetX (void) const |
Return the x component of the vector. | |
float | GetY (void) const |
Return the y component of the vector. | |
float | GetZ (void) const |
Return the z component of the vector. | |
float | GetW (void) const |
Return the w component of the vector. | |
void | SetX (float fX) |
Set the x component of the vector. | |
void | SetY (float fY) |
Set the y component of the vector. | |
void | SetZ (float fZ) |
Set the z component of the vector. | |
void | SetW (float fW) |
Set the w component of the vector. | |
void | Set (float fInput) |
Set all of the members to specific value. | |
void | Set (float fX, float fY) |
Set the values to specific values. | |
void | Set (float fX, float fY, float fZ) |
Set the values to specific values. | |
void | Set (float fX, float fY, float fZ, float fW) |
Set the values to specific values. | |
void | Set (const Vector4D_t *pInput) |
Copy a Vector4D_t. | |
void | Set (const FixedVector4D_t *pInput) |
Convert a fixed point vector into a floating point vector. | |
void | SetRect (float fX, float fY) |
Set the values to as if it's a rectangle. | |
void | SetRect (const Vector2D_t *pMinMax) |
Set the values to as if it's a rectangle. | |
void | SetRect (const Vector2D_t *pMin, const Vector2D_t *pMax) |
Set the values to as if it's a rectangle. | |
void | Negate (void) |
Negate a 4D vector. | |
void | Negate (float fX, float fY, float fZ, float fW) |
Negate the input and store it in this structure. | |
void | Negate (const Vector4D_t *pInput) |
Make a copy of the input after it's been negated. | |
void | Interpolate (const Vector4D_t *pFrom, const Vector4D_t *pTo, float fFactor) |
Interpolate between two vectors. | |
float | Dot (float fX, float fY, float fZ, float fW) const |
Return a dot product of two 4D vectors. | |
float | Dot (const Vector4D_t *pInput) const |
Return a dot product of two 4D vectors. | |
void | Add (const Vector4D_t *pInput) |
Add another vector to this one. | |
void | Add (float fInput) |
Add the same scalar value to each of member values. | |
void | Add (const Vector4D_t *pInput1, const Vector4D_t *pInput2) |
Add two vectors and store the result in this vector. | |
void | Add (const Vector4D_t *pInput, float fInput) |
Add a vector and a scalar to every member of the vector and store the result in this vector. | |
void | Sub (const Vector4D_t *pInput) |
Subtract another vector from this one. | |
void | Sub (float fInput) |
Subtract the same scalar value from each of member values. | |
void | Sub (const Vector4D_t *pInput1, const Vector4D_t *pInput2) |
Subtract two vectors and store the result in this vector. | |
void | Sub (const Vector4D_t *pInput, float fInput) |
Subtract a vector and a scalar to every member of the vector and store the result in this vector. | |
void | Mul (const Vector4D_t *pInput) |
Multiply another vector to this one. | |
void | Mul (float fInput) |
Multiply the same scalar value to each of member values. | |
void | Mul (const Vector4D_t *pInput1, const Vector4D_t *pInput2) |
Multiply two vectors and store the result in this vector. | |
void | Mul (const Vector4D_t *pInput, float fInput) |
Multiply a vector and a scalar to every member of the vector and store the result in this vector. | |
float | GetLengthSquared (void) const |
Returns the square of the length of a 4D vector. | |
float | GetLength (void) const |
Return the length of a vector (High precision) | |
float | GetLengthFast (void) const |
Return the length of a vector (Good precision) | |
void | SetLength (float fInput) |
Normalize a 4D vector to a specific length (High precision) | |
void | SetLengthFast (float fInput) |
Normalize a 3D vector to a specific length (Good precision) | |
float | GetDistanceSquared (float fX, float fY, float fZ, float fW) const |
Returns the square of the distance between two 4D points. | |
float | GetDistanceSquared (const Vector4D_t *pInput) const |
Returns the square of the distance between two 4D points. | |
float | GetDistance (float fX, float fY, float fZ, float fW) const |
Returns the square of the distance between two 4D points. | |
float | GetDistance (const Vector4D_t *pInput) const |
Returns the square of the distance between two 4D points. | |
float | GetDistanceFast (float fX, float fY, float fZ, float fW) const |
Returns the square of the distance between two 4D points (Good precision) | |
float | GetDistanceFast (const Vector4D_t *pInput) const |
Returns the square of the distance between two 4D points (Good precision) | |
void | Normalize (void) |
Normalize a 4D vector. | |
void | Normalize (float fX, float fY, float fZ, float fW) |
Copy a normalized 4D vector. | |
void | Normalize (const Vector4D_t *pInput) |
Copy a normalized 4D vector. | |
void | NormalizeFast (void) |
Normalize a 4D vector (Good precision) | |
void | NormalizeFast (float fX, float fY, float fZ, float fW) |
Copy a normalized 4D vector. | |
void | NormalizeFast (const Vector4D_t *pInput) |
Copy a normalized 4D vector. | |
float | Dot3 (float fX, float fY, float fZ) const |
Return a dot product of two 3D vectors. | |
float | Dot3 (const Vector4D_t *pInput) const |
Return a dot product of two 4D vectors using only x,y and z. | |
void | QuaternionNegate (void) |
Negate a quaternion. | |
void | QuaternionNegate (float fX, float fY, float fZ, float fW) |
Negate the input quaternion and store it in this structure. | |
void | QuaternionNegate (const Vector4D_t *pInput) |
Make a copy of the input quaternion after it's been negated. | |
void | QuaternionMul (const Vector4D_t *pInput) |
Multiply a quaternion by another quaternion. | |
void | QuaternionMul (const Vector4D_t *pInput1, const Vector4D_t *pInput2) |
Multiply a quaternion by another quaternion and store it here. | |
void | QuaternionMulNormalize (const Vector4D_t *pInput) |
Multiply a quaternion by another quaternion. | |
void | QuaternionMulNormalize (const Vector4D_t *pInput1, const Vector4D_t *pInput2) |
Multiply a quaternion by another quaternion and store it here. | |
uint_t | BitwiseEqual (const Vector4D_t *pInput) const |
Compare two Vector4D_t's for bitwise equality. | |
float & | operator[] (uint_t uInput) |
Access the members as an array. | |
const float & | operator[] (uint_t uInput) const |
Access the members as an array. | |
uint_t | operator== (const Vector4D_t &rInput) const |
Compare two Vector4D_t's for equality. | |
uint_t | operator!= (const Vector4D_t &rInput) const |
Compare two Vector4D_t's for inequality. | |
operator const float * () const | |
Convert to a const float pointer. | |
const Vector2D_t * | GetTopLeft (void) const |
Get the top left corner of the rectangle. | |
const Vector2D_t * | GetBottomRight (void) const |
Get the top left corner of the rectangle. | |
Vector2D_t * | GetTopLeft (void) |
Get the top left corner of the rectangle. | |
Vector2D_t * | GetBottomRight (void) |
Get the top left corner of the rectangle. | |
float | GetWidth (void) const |
Get the width of the rectangle. | |
float | GetHeight (void) const |
Get the height of the rectangle. | |
float | GetLeft (void) const |
Get the leftmost X coordinate of the rectangle. | |
float | GetTop (void) const |
Get the topmost Y coordinate of the rectangle. | |
float | GetRight (void) const |
Get the rightmost X coordinate of the rectangle. | |
float | GetBottom (void) const |
Get the bottommost Y coordinate of the rectangle. | |
void | SetWidth (float fWidth) |
Set the width of a rectangle. | |
void | SetHeight (float fHeight) |
Set the height of a rectangle. | |
void | SetSize (float fWidth, float fHeight) |
Set the size of a rectangle. | |
void | SetLeft (float fLeft) |
Set the left most X coordinate of a rectangle. | |
void | SetTop (float fTop) |
Set the top most Y coordinate of a rectangle. | |
void | SetRight (float fRight) |
Set the right most X coordinate of a rectangle. | |
void | SetBottom (float fBottom) |
Set the bottom most Y coordinate of a rectangle. | |
uint_t | IsInsideRect (float fX, float fY) const |
Test if a point is inside a rectangle. | |
uint_t | IsInsideRect (const Vector2D_t *pInput) const |
Test if a point is inside a rectangle. | |
void | ExpandRect (float fX, float fY) |
Enlarge a rectangle to encompass a point. | |
void | ExpandRect (const Vector2D_t *pInput) |
Enlarge a rectangle to encompass a point. | |
void | ExpandRect (const Vector4D_t *pInput) |
Enlarge a rectangle to encompass a rectangle. | |
Additional Inherited Members | |
Public Attributes inherited from Burger::Vector4D_t | |
float | x |
32 bit floating point X value for the 4D Vector (LeftX) | |
float | y |
32 bit floating point Y value for the 4D Vector (TopY) | |
float | z |
32 bit floating point Z value for the 4D Vector (RightX) | |
float | w |
32 bit floating point W value for the 4D Vector (BottomY) | |
Rectangle specialization for Adobe Flash.
This class extends a Vector4D_t to give the specializations for Adobe Flash
|
inline |
uint_t BURGER_API Burger::Flash::Rect::IsIntersecting | ( | const Vector4D_t * | pRect | ) | const |
Test for rectangle collision.
If the passed rectangle intersects with this rectangle, return TRUE. This differs from BurgerLib because the test does not return TRUE if the rectangle is touching on the bottom or right.
pRect | Pointer to a rectangle to test against |
void BURGER_API Burger::Flash::Rect::PixelsToTwips | ( | void | ) |
Convert the rectangle from Pixels to Flash Twips.
Flash uses a coordinate system of 20 twips per pixel. This function converts from pixels to twips by a multiplication of 20.0f
void BURGER_API Burger::Flash::Rect::Print | ( | void | ) | const |
Dump the rectangle to Debug::Message()
Output the rectangle values to the console for debugging.
void BURGER_API Burger::Flash::Rect::Read | ( | Stream * | pStream | ) |
void BURGER_API Burger::Flash::Rect::SetRect | ( | const Matrix23 * | pMatrix, |
const Vector4D_t * | pRect ) |
Set a rectangle bounds to a transformed rectangle.
Apply a transformation to the input rectangle and store the result in this rectangle.
pMatrix | Pointer to a matrix to transform the input rectangle |
pRect | Pointer to a rectangle to transform |
void BURGER_API Burger::Flash::Rect::TwipsToPixels | ( | void | ) |
Convert the rectangle from Flash Twips to Pixels.
Flash uses a coordinate system of 20 twips per pixel. This function converts from twips to pixels by a multiplication of 1.0f/20.0f