Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Classes

NameDescription
Geo::ConvexHull

A convex hull of a set of points.

Geo::ConvexHullBuilder

Builds ConvexHull objects.

Geo::CovarianceMatrix

A covariance matrix.

Geo::CovarianceMatrixBuilder

Used for building CovarianceMatrix.

Geo::DebugLine

A line between two points.

Geo::Geo2DTransform

A class representing a 2d linear transform between UVs.

Geo::GeoBlueNoise

class GeoBlueNoise Adapted from: Bridson, Robert, "Fast Poisson Sampling in Arbitrary Dimensions", ACM SIGGRAPH 2007 sketches

Geo::GeoBlueNoiseDiskPalette

Builds a pallet of blue noise samples, each in a disk of radius 1.

Geo::GeoBlueNoiseRayPalette

class GeoBlueNoiseRayPalette

Geo::GeoBoundingBox

This class represents an axis aligned bounding box.

Geo::GeoBoundingSphere

This class represents a bounding sphere.

Geo::GeoIntRange

Represents a range of integers, e.g. between 10 and 20.

Geo::GeoPoint2

Single precision 2 dimensional point class.

Geo::GeoPoint2D

Integer 2 dimensional point class.

Geo::GeoPoint3

Single precision 3 dimensional point class.

Geo::GeoPoint3D

Integer 3 dimensional point class.

Geo::GeoVector3

Single precision 3 dimensional vector class.

Geo::GeoVector4

Single precision 4 dimensional vector class.

Geo::GoodRNG

A Mersenne Twister RNG.

Geo::Matrix4x4

Single-precision 4x4 matrix class.

Geo::SimpleRNG

The 'super-duper' random number generator with shuffle (an LCG).

Geo::Statistics

Result structure used for comparing input lighting buffers.

Geo::VectorD

Double precision vector class.

Functions

NameDescription
BloatTriangle(ConvexHull *, Geo::v128, Geo::v128, Geo::v128, float, Geo::s32)

Bloat a triangle by a specified amount.

CalcCubeMapCoordinatesForDirection(Geo::v128, Geo::s32, Geo::s32 &, float &, float &)

Compute the cube map texel coordinate for a given direction and cubemap resolution.

CalcDirectionForCubeMapCoordinate(Geo::s32, Geo::s32, Geo::s32, Geo::s32)

Generate a direction vector for a cubemap texel coordinate.

CalcDirectionForCubeMapTexel(Geo::s32, float, float)

Generate a direction vector for a cubemap texel UV coordinate.

ClosestPointInBox(const Geo::v128 &)

Compute the closest point in the box to p.

CombineStatistics(const Statistics &, const Statistics &)

Combine the values in statsA and statsB so that the properties of each member are retained over the whole set.

ComputeStatistics(Statistics &, const Geo::v128 *, const Geo::v128 *, const Geo::s32, const Geo::v128 &)

Computes the difference between two vector arrays.

ContainsBox(const Geo::GeoBoundingBox &)

Is a box contained by the box?

ContainsPoint(const Geo::v128 &)

Is a point in the box?

ContainsPoint2D(const Geo::v128 &)

Is a point in the box? Only tests xy.

Cross(VectorD, VectorD)

Double precision vector operators.

Dot(VectorD, VectorD)

Double precision vector operators.

EnclosePoint(const v128 &)

Enlarge this bounding box to include the given point.

ExpandBy(const v128 &)

Expands this bounding box by the given amount in each of the three axes (in both directions).

GenerateGuidFromString(const GeoString< char > &)

Convert a string to a GUID by hashing.

GenerateGuidFromString(GeoGuid &, const GeoString< char > &)

Convert a string to a GUID by hashing.

GenerateUnitSquareFastPoissonDistribution(const s32 &, GeoArray< GeoPoint2 > &, const u32 &)

Helper function to generate fast poisson samples in the 2D unit square.

GenerateUnitSquareSobolDistribution(const s32 &, GeoArray< GeoPoint2 > &, const u32 &)

Helper function to generate sobol samples in the 2D unit square.

GeoBoundingBox(const GeoBoundingBox &)

Copy Constructor.

GeoBoundingBox(float, float, float, float, float, float)

Create a bounding box defined by two extreme points.

GeoBoundingBox()

Constructor - makes an empty bounding box.

GeoRectFromCoords(float, float, float, float)

Function to construct a GeoRect from the minimum and maximum X and Y co-ordinates.

GeoRectFromCoordsUnsafe(float, float, float, float)

Function to construct a GeoRect from the minimum and maximum X and Y co-ordinates.

GeoRectFromSize(float, float, float, float)

Function to construct a GeoRect from a minimum X and Y co-ordinate, a width and a height.

GeoRectHeight(GeoRect)

Functions to get various co-ordinates from a rect.

GeoRectMaxX(GeoRect)

Functions to get various co-ordinates from a rect.

GeoRectMaxY(GeoRect)

Functions to get various co-ordinates from a rect.

GeoRectMinX(GeoRect)

Functions to get various co-ordinates from a rect.

GeoRectMinY(GeoRect)

Functions to get various co-ordinates from a rect.

GeoRectWidth(GeoRect)

Functions to get various co-ordinates from a rect.

GetCenter()

Return the center of this bounding box.

GetDistanceFrom(const GeoBoundingBox &)

Distance between two bounding boxes (0 if they intersect)

GetDistanceFrom(const Geo::v128 &)

Compute the closest distance from p.

GetLargestFace()

Return the largest face of this bounding box.

GetLongestSide()

Return the longest side of this bounding box.

GetMax()

Return the maxumum in each axis of this bounding box.

GetMin()

Return the minimum in each axis of this bounding box.

GetShortestSide()

Return the shortest side of this bounding box.

GetSize()

Return the size of this bounding box in each axis.

GetSurfaceArea()

Return the surface area of this bounding box.

GetVolume()

Return the volume of this bounding box.

HashBig(const void *, size_t, u32)

This is the same as HashWord() on big-endian machines.

HashLittle(const GeoString< char > &)

This will create a simple u32 hash from the (case-sensitive) string supplied.

HashLittle(const void *, size_t, u32)

Hash a variable-length key of bytes into a 32-bit value.

HashSHA1(GeoFileStringView)

Hashes the given string using SHA1 and returns a GUID representing the hash.

HashSHA1(const Geo::u8 *, Geo::s32, Geo::u8 *)

Hashes the given array of bytes using SHA1. The outputBytes parameter must have at least HASH_SIZE_SHA1 bytes allocated.

HashSHA1(const Geo::u8 *, Geo::s32)

Hashes the given array of bytes using SHA1 and returns a string representing the hash.

HashWord(const u32 *, size_t, u32)

Produce a hash from a string of Geo::u32 This works on all machines.

IntersectsBoundingBox(const GeoBoundingBox &)

Returns true if the bounding boxes mutually olaps.

IsEmpty()

Returns true if the bbox is empty (ie uninitialised)

Length(VectorD)

Double precision vector operators.

Max(const GeoPoint2D &, const GeoPoint2D &)

Gets the component-wise maximum of two points.

Max(const GeoPoint3D &, const GeoPoint3D &)

Gets the component-wise maximum of two points.

MConstructCubeMapInvViewMatrix(Geo::s32)

Construct the inverse of the view matrix for a specific cubemap face.

MConstructCubeMapViewMatrix(Geo::s32)

Construct a view matrix for a specific cubemap face.

Min(const GeoPoint3D &, const GeoPoint3D &)

Gets the component-wise minimum of two points.

operator-(VectorD, VectorD)

Double precision vector operators.

operator*(double, VectorD)

Double precision vector operators.

operator/(VectorD, VectorD)

Double precision vector operators.

operator[](Geo::u32)

Indexed access to the two extreme points that define this bounding box (index must be 0 or 1).

operator+(const GeoBoundingBox &)

Compute and return the union of this bounding with another.

operator+=(const v128 &)

Enlarge this bounding box to include the given point.

operator+=(const GeoBoundingBox &)

Compute the inplace union of this bounding box and another.

operator<(const GeoPoint3D &, const GeoPoint3D &)

Allow GeoPoint3D to be used as a key for GeoMap.

operator<(const GeoPoint3 &, const GeoPoint3 &)

Allow GeoPoint3 to be used as a key for GeoMap.

operator==(const GeoPoint3 &, const GeoPoint3 &)

Equality operator.

ScaleRect(GeoRect, float)

Function to scale a bounding box.

SetEmpty()

Resets the box to it's default empty state.

TestSamplingDistributions(const char *, const s32 &)

Write out raysets representing the ray distributions for debugging and visualisation.

UniformInteger(RNG &)

Random unsigned 32 bit integer, [0, 0xffffffff] (inclusive)

UniformSignedUnitDouble(RNG &)

Random double, [-1, 1] (inclusive)

UniformSignedUnitFloat(RNG &)

Random float, [-1, 1] (inclusive)

UniformUnitClopenDouble(RNG &)

Random double, [0, 1)

UniformUnitClopenFloat(RNG &)

Random float, [0, 1)

UniformUnitDouble(RNG &)

Random double, [0, 1] (inclusive)

UniformUnitFloat(RNG &)

Random float, [0, 1] (inclusive)

UniformUnitOpenDouble(RNG &)

Random double, (0, 1)

UniformUnitOpenFloat(RNG &)

Random float, (0, 1)

UnionOfRects(GeoRect, GeoRect)

Union of two bounding boxes.

VLeftOf2(const Geo::v128 &, const Geo::v128 &, const Geo::v128 &)

Determines if the point 'c' is to the left of the line formed by joining 'a' and 'b'.

VLength(VectorD)

Double precision vector operators.

VRightOf2(const Geo::v128 &, const Geo::v128 &, const Geo::v128 &)

Determines if the point 'c' is to the right of the line formed by joining 'a' and 'b'.

VScaleAndAdd(const Geo::v128 &, float, const Geo::v128 &, float)

Calculates a * s + b * t.

VSignedArea2(const Geo::v128 &, const Geo::v128 &, const Geo::v128 &)

Calculates the signed area of the given triangle in 2D space (z-coordinates ignored)

VSlerp2(const Geo::v128 &, const Geo::v128 &, float)

Spherical linear interpolation between 'a' and 'b', with weight 't'.

Enums

NameDescription
Dimension3

An enumeration of the dimensions of 3D space.

Sign

A sign bit.

Typedefs

NameDescription
v128 GeoRect

A GeoRect is actually just a 4-vector (Geo::v128).

Variables

NameDescription
const Geo::s32 HASH_SIZE_SHA1 = 20

The size of an SHA-1 hash.


Anchor
a2d499d6faf85b858866fa283a48abe91
a2d499d6faf85b858866fa283a48abe91

Geo::s32 Geo::BloatTriangle

...

public: Geo::s32 BloatTriangle
(
    ConvexHull * out,
    Geo::v128 a,
    Geo::v128 b,
    Geo::v128 c,
    float bloat,
    Geo::s32 cornerSmoothness
)

...

Bloat a triangle by a specified amount.

You can specify how refined you want the rounded corners to be, or 0 if you just want a single join point in the centre. The number correlates to how many segments the widest corner will have (and will scale from there). As this is a reasonably quick function, you should pass in a convex hull with the appropriate number of points allocated to it.

Returns

The number of points used, or -1 if there wasn't enough space.

Note
titleNote

Passing NULL for outIS VALID


: this will return the number of points the final result will use.

Winding order is irrelevant: it is corrected internally.


Anchor
a242c827eb84037fcafc532f7b943f350
a242c827eb84037fcafc532f7b943f350

void GEO_CALL Geo::CalcCubeMapCoordinatesForDirection

...

public: void GEO_CALL CalcCubeMapCoordinatesForDirection
(
    Geo::v128 direction,
    Geo::s32 faceWidth,
    Geo::s32 & faceIdx,
    float & x,
    float & y
)

...

Compute the cube map texel coordinate for a given direction and cubemap resolution.

Note
titleNote

x and y are returned as floats but in texel coordinates rather than normalised UVs.


Anchor
acd931d32519a63fb2c401a8b3ddcdbb8
acd931d32519a63fb2c401a8b3ddcdbb8

Geo::v128 GEO_CALL Geo::CalcDirectionForCubeMapCoordinate

...

public: Geo::v128GEO_CALL CalcDirectionForCubeMapCoordinate
(
    Geo::s32 faceIdx,
    Geo::s32 x,
    Geo::s32 y,
    Geo::s32 faceWidth
)

...

Generate a direction vector for a cubemap texel coordinate.


Anchor
a52f1e763a65a552f78951fd05e8a4f5b
a52f1e763a65a552f78951fd05e8a4f5b

Geo::v128 GEO_CALL Geo::CalcDirectionForCubeMapTexel

...

public: Geo::v128GEO_CALL CalcDirectionForCubeMapTexel
(
    Geo::s32 faceIdx,
    float u,
    float v
)

...

Generate a direction vector for a cubemap texel UV coordinate.


Anchor
a11fdec1915eaabb372b0ee9434fd6602
a11fdec1915eaabb372b0ee9434fd6602

Geo::v128 Geo::GeoBoundingBox::ClosestPointInBox

...

public: Geo::v128 ClosestPointInBox
(
    const Geo::v128 & p
) const

...

Compute the closest point in the box to p.


Anchor
ab1959994dd5a4a598179ed10b5dffbcd
ab1959994dd5a4a598179ed10b5dffbcd

Statistics GEO_CALL Geo::CombineStatistics

...

public: Statistics GEO_CALL CombineStatistics
(
    const Statistics & statsA,
    const Statistics & statsB
)

...

Combine the values in statsA and statsB so that the properties of each member are retained over the whole set.


Anchor
a13e242ab364f3d58ee21644d183b1820
a13e242ab364f3d58ee21644d183b1820

bool GEO_CALL Geo::ComputeStatistics

...

public: bool GEO_CALL ComputeStatistics
(
    Statistics & stats,
    const Geo::v128 * vA,
    const Geo::v128 * vB,
    const Geo::s32 numValues,
    const Geo::v128 & mask
)

...

Computes the difference between two vector arrays.

Returns TRUE on success. Vector array parameters must be valid non-null objects.

Parameters
[inout]stats

Statistics on the difference.

[in]vA

The first vector to compare.

[in]vB

The second vector to compare.

[in]numValues

Number of elements in the two vectors.

[in]mask

Vector for masking out certain elements of the input vectors.


Anchor
a3009cb330f14ded9934a3ed2b44d3f5c
a3009cb330f14ded9934a3ed2b44d3f5c

bool Geo::GeoBoundingBox::ContainsBox

...

public: bool ContainsBox
(
    const Geo::GeoBoundingBox & rhs
) const

...

Is a box contained by the box?


Anchor
a5e348357d94e18794ea2df7a548e7e7e
a5e348357d94e18794ea2df7a548e7e7e

bool Geo::GeoBoundingBox::ContainsPoint

...

public: bool ContainsPoint
(
    const Geo::v128 & p
) const

...

Is a point in the box?


Anchor
aa3ea0a9b765ac1e1b3ecf97e2514712f
aa3ea0a9b765ac1e1b3ecf97e2514712f

bool Geo::GeoBoundingBox::ContainsPoint2D

...

public: bool ContainsPoint2D
(
    const Geo::v128 & p
) const

...

Is a point in the box? Only tests xy.


Anchor
aab738e573680e9411565da638b038371
aab738e573680e9411565da638b038371

VectorD Geo::Cross

...

public: VectorD Cross
(
    VectorD u,
    VectorD v
)

...

Double precision vector operators.


Anchor
a1f4cba3506c0d12d962ff1ef9d5c003d
a1f4cba3506c0d12d962ff1ef9d5c003d

double Geo::Dot

...

public: double Dot
(
    VectorD lhs,
    VectorD rhs
)

...

Double precision vector operators.


Anchor
ad027ce9b7bc9ca796abde377b887e4d5
ad027ce9b7bc9ca796abde377b887e4d5

void Geo::GeoBoundingBox::EnclosePoint

...

public: void EnclosePoint
(
    const v128 & point
)

...

Enlarge this bounding box to include the given point.


Anchor
af10700edd9fbc07a8f7f421155750c45
af10700edd9fbc07a8f7f421155750c45

void Geo::GeoBoundingBox::ExpandBy

...

public: void ExpandBy
(
    const v128 & expansion
)

...

Expands this bounding box by the given amount in each of the three axes (in both directions).


Anchor
a3efb73c17cef764fbec9e05b226b195a
a3efb73c17cef764fbec9e05b226b195a

GeoGuid Geo::GenerateGuidFromString

...

public: GeoGuid GenerateGuidFromString
(
    const GeoString< char > & string
)

...

Convert a string to a GUID by hashing.


Anchor
af1f577a019c21b11c640fc96952b457f
af1f577a019c21b11c640fc96952b457f

bool Geo::GenerateGuidFromString

...

public: bool GenerateGuidFromString
(
    GeoGuid & guidFromString,
    const GeoString< char > & string
)

...

Convert a string to a GUID by hashing.


Anchor
a93298694142cc1ddc7494b8b02f1a208
a93298694142cc1ddc7494b8b02f1a208

bool GEO_CALL Geo::GenerateUnitSquareFastPoissonDistribution

...

public: bool GEO_CALL GenerateUnitSquareFastPoissonDistribution
(
    const s32 & numSamples,
    GeoArray< GeoPoint2 > & samples,
    const u32 & seed
)

...

Helper function to generate fast poisson samples in the 2D unit square.


Anchor
aaff750bfd0cfacb4047d840b92541ae3
aaff750bfd0cfacb4047d840b92541ae3

bool GEO_CALL Geo::GenerateUnitSquareSobolDistribution

...

public: bool GEO_CALL GenerateUnitSquareSobolDistribution
(
    const s32 & numSamples,
    GeoArray< GeoPoint2 > & samples,
    const u32 & seed
)

...

Helper function to generate sobol samples in the 2D unit square.


Anchor
ae5731e78adc897644ea7c74df30e6a97
ae5731e78adc897644ea7c74df30e6a97

Geo::GeoBoundingBox::GeoBoundingBox

...

public: GeoBoundingBox
(
    const GeoBoundingBox & from
)

...

Copy Constructor.


Anchor
a315bcebf179293c57ef7e9c6ef1709df
a315bcebf179293c57ef7e9c6ef1709df

Geo::GeoBoundingBox::GeoBoundingBox

...

public: GeoBoundingBox
(
    float x1,
    float y1,
    float z1,
    float x2,
    float y2,
    float z2
)

...

Create a bounding box defined by two extreme points.


Anchor
ab42bb1e1b509ef18ca5930231853ecef
ab42bb1e1b509ef18ca5930231853ecef

Geo::GeoBoundingBox::GeoBoundingBox

...

public: GeoBoundingBox()

...

Constructor - makes an empty bounding box.


Anchor
ae6b4e24a1fa406f3525afe179d663d05
ae6b4e24a1fa406f3525afe179d663d05

GeoRect Geo::GeoRectFromCoords

...

public: GeoRect GeoRectFromCoords
(
    float minX,
    float minY,
    float maxX,
    float maxY
)

...

Function to construct a GeoRect from the minimum and maximum X and Y co-ordinates.


Anchor
a535c503b66ac59783b1cf71f2dbf52cc
a535c503b66ac59783b1cf71f2dbf52cc

GeoRect Geo::GeoRectFromCoordsUnsafe

...

public: GeoRect GeoRectFromCoordsUnsafe
(
    float minX,
    float minY,
    float maxX,
    float maxY
)

...

Function to construct a GeoRect from the minimum and maximum X and Y co-ordinates.


Anchor
a947e3cc1e85b95327579c56a66076dca
a947e3cc1e85b95327579c56a66076dca

GeoRect Geo::GeoRectFromSize

...

public: GeoRect GeoRectFromSize
(
    float minX,
    float minY,
    float width,
    float height
)

...

Function to construct a GeoRect from a minimum X and Y co-ordinate, a width and a height.


Anchor
aa2fe500e5c83174c9f41d724a1a6268b
aa2fe500e5c83174c9f41d724a1a6268b

float Geo::GeoRectHeight

...

public: float GeoRectHeight
(
    GeoRect rect
)

...

Functions to get various co-ordinates from a rect.


Anchor
a316ae986e9863fb8d6b0a8c637ba4bfa
a316ae986e9863fb8d6b0a8c637ba4bfa

float Geo::GeoRectMaxX

...

public: float GeoRectMaxX
(
    GeoRect rect
)

...

Functions to get various co-ordinates from a rect.


Anchor
a187a859141fce45ac6fb16823eef151c
a187a859141fce45ac6fb16823eef151c

float Geo::GeoRectMaxY

...

public: float GeoRectMaxY
(
    GeoRect rect
)

...

Functions to get various co-ordinates from a rect.


Anchor
a0be03bb4530d51a44e06724cbd8d5882
a0be03bb4530d51a44e06724cbd8d5882

float Geo::GeoRectMinX

...

public: float GeoRectMinX
(
    GeoRect rect
)

...

Functions to get various co-ordinates from a rect.


Anchor
a6caed550a6699f2bc1ee5cc326b87f39
a6caed550a6699f2bc1ee5cc326b87f39

float Geo::GeoRectMinY

...

public: float GeoRectMinY
(
    GeoRect rect
)

...

Functions to get various co-ordinates from a rect.


Anchor
a58a97191a91b0c7974242573a6e0e40d
a58a97191a91b0c7974242573a6e0e40d

float Geo::GeoRectWidth

...

public: float GeoRectWidth
(
    GeoRect rect
)

...

Functions to get various co-ordinates from a rect.


Anchor
af064e35df8a25cdc3481ccdd619c2eb4
af064e35df8a25cdc3481ccdd619c2eb4

v128 Geo::GeoBoundingBox::GetCenter

...

public: v128 GetCenter() const

...

Return the center of this bounding box.


Anchor
ac9e2400a99a352ac77452dc1799f2f6a
ac9e2400a99a352ac77452dc1799f2f6a

float Geo::GeoBoundingBox::GetDistanceFrom

...

public: float GetDistanceFrom
(
    const GeoBoundingBox & rhs
) const

...

Distance between two bounding boxes (0 if they intersect)


Anchor
a8141dc24fea70567903cf28cbcdae02c
a8141dc24fea70567903cf28cbcdae02c

float Geo::GeoBoundingBox::GetDistanceFrom

...

public: float GetDistanceFrom
(
    const Geo::v128 & p
) const

...

Compute the closest distance from p.


Anchor
a4d76b598908786d7491adec7d4bf3c9e
a4d76b598908786d7491adec7d4bf3c9e

float Geo::GeoBoundingBox::GetLargestFace

...

public: float GetLargestFace() const

...

Return the largest face of this bounding box.


Anchor
a4335a395d4cb00b3696e9739963a0ae0
a4335a395d4cb00b3696e9739963a0ae0

float Geo::GeoBoundingBox::GetLongestSide

...

public: float GetLongestSide() const

...

Return the longest side of this bounding box.


Anchor
a9b7e2d693cfee7b61dfabd38fceb3f85
a9b7e2d693cfee7b61dfabd38fceb3f85

v128 Geo::GeoBoundingBox::GetMax

...

public: v128 GetMax() const

...

Return the maxumum in each axis of this bounding box.


Anchor
a007d099fb32e48e4fb60ba15caf6306c
a007d099fb32e48e4fb60ba15caf6306c

v128 Geo::GeoBoundingBox::GetMin

...

public: v128 GetMin() const

...

Return the minimum in each axis of this bounding box.


Anchor
a865792c932104ddea48c6c80858059f5
a865792c932104ddea48c6c80858059f5

float Geo::GeoBoundingBox::GetShortestSide

...

public: float GetShortestSide() const

...

Return the shortest side of this bounding box.


Anchor
a7c655eefa51b785272f0c9c8524a328d
a7c655eefa51b785272f0c9c8524a328d

v128 Geo::GeoBoundingBox::GetSize

...

public: v128 GetSize() const

...

Return the size of this bounding box in each axis.


Anchor
a9d708fa3943212e066f2393969241010
a9d708fa3943212e066f2393969241010

float Geo::GeoBoundingBox::GetSurfaceArea

...

public: float GetSurfaceArea() const

...

Return the surface area of this bounding box.


Anchor
a94c7c660e272740fbeaf5b33f1fa48c9
a94c7c660e272740fbeaf5b33f1fa48c9

float Geo::GeoBoundingBox::GetVolume

...

public: float GetVolume() const

...

Return the volume of this bounding box.


Anchor
ab4df439c028029f9a656dbaa20de02cf
ab4df439c028029f9a656dbaa20de02cf

u32 Geo::HashBig

...

public: u32 HashBig
(
    const void * key,
    size_t length,
    u32 initval
)

...

This is the same as HashWord() on big-endian machines.

It is different from HashLittle() on all machines. HashBig() takes advantage of big-endian byte ordering.


Anchor
a7149be131f8761a6428cb5a3a3a27a7e
a7149be131f8761a6428cb5a3a3a27a7e

u32 Geo::HashLittle

...

public: u32 HashLittle
(
    const GeoString< char > & string
)

...

This will create a simple u32 hash from the (case-sensitive) string supplied.


Anchor
afa877df9c0e3cf9c64225acbb240ac38
afa877df9c0e3cf9c64225acbb240ac38

u32 Geo::HashLittle

...

public: u32 HashLittle
(
    const void * key,
    size_t length,
    u32 initval
)

...

Hash a variable-length key of bytes into a 32-bit value.

Every bit of the key affects every bit of the return value. Two keys differing by one or two bits will have totally different hash values.

The best hash table sizes are powers of 2. There is no need to do mod a prime (mod is sooo slow!). If you need less than 32 bits, use a bitmask. For example, if you need only 10 bits, do h = (h & hashmask(10)); In which case, the hash table should have hashsize(10) elements.

If you are hashing n strings (u8 **)k, do it like this: for (i=0, h=0; i<n; ++i) h = HashLittle( k[i], len[i], h);

By Bob Jenkins, 2006. bob_jenkins@burtleburtle.net. You may use this code any way you wish, private, educational, or commercial. It's free.

Use for hash table lookup, or anything where one collision in 2^^32 is acceptable. Do NOT use for cryptographic purposes.

Parameters
key

The key (the unaligned variable-length array of bytes)

length

The length of the key, counting by bytes

initval

Can be any 4-byte value

Returns

Returns a 32-bit value.


Anchor
a01a9188ea7e1f46ddbd699fd70d842e5
a01a9188ea7e1f46ddbd699fd70d842e5

GeoGuid Geo::HashSHA1

...

public: GeoGuid HashSHA1
(
    GeoFileStringView string
)

...

Hashes the given string using SHA1 and returns a GUID representing the hash.


Anchor
a871bfb20ef84f44c7437629aa0e386f5
a871bfb20ef84f44c7437629aa0e386f5

bool Geo::HashSHA1

...

public: bool HashSHA1
(
    const Geo::u8 * inputBytes,
    Geo::s32 inputNumBytes,
    Geo::u8 * outputBytes
)

...

Hashes the given array of bytes using SHA1. The outputBytes parameter must have at least HASH_SIZE_SHA1 bytes allocated.


Anchor
a4f22ff430d7660d5e47b1b7646338398
a4f22ff430d7660d5e47b1b7646338398

Geo::GeoString<char> Geo::HashSHA1

...

public: Geo::GeoString< char > HashSHA1
(
    const Geo::u8 * inputBytes,
    Geo::s32 inputNumBytes
)

...

Hashes the given array of bytes using SHA1 and returns a string representing the hash.


Anchor
af1f6437fdbc6e6958a0e6a5a0556637f
af1f6437fdbc6e6958a0e6a5a0556637f

u32 Geo::HashWord

...

public: u32 HashWord
(
    const u32 * k,
    size_t length,
    u32 initval
)

...

Produce a hash from a string of Geo::u32 This works on all machines.

To be useful, it requires

  • That the key be an array of u32's, and

  • That all your machines have the same endianness, and

  • That the length be the number of u32's in the key The function HashWord() is identical to HashLittle() on little-endian machines, and identical to HashBig() on big-endian machines, except that the length has to be measured in u32s rather than in bytes. HashLittle() is more complicated than HashWord() only because HashLittle() has to dance around fitting the key bytes into registers.


Anchor
a0b817437e3b48b14e202e26ffe5e3434
a0b817437e3b48b14e202e26ffe5e3434

bool Geo::GeoBoundingBox::IntersectsBoundingBox

...

public: bool IntersectsBoundingBox
(
    const GeoBoundingBox & rhs
) const

...

Returns true if the bounding boxes mutually olaps.


Anchor
a054da0d287f4b879eeb69d7928d1f109
a054da0d287f4b879eeb69d7928d1f109

bool Geo::GeoBoundingBox::IsEmpty

...

public: bool IsEmpty() const

...

Returns true if the bbox is empty (ie uninitialised)


Anchor
a58a7485029992718bfafb97fffa5c56e
a58a7485029992718bfafb97fffa5c56e

double Geo::Length

...

public: double Length
(
    VectorD v
)

...

Double precision vector operators.


Anchor
ad3a23c6fe860ea1f8903e9d61c985d14
ad3a23c6fe860ea1f8903e9d61c985d14

GeoPoint2D Geo::Max

...

public: GeoPoint2D Max
(
    const GeoPoint2D & a,
    const GeoPoint2D & b
)

...

Gets the component-wise maximum of two points.


Anchor
a60bf1c8aa3dff4a92be2fb0ae0bb92b2
a60bf1c8aa3dff4a92be2fb0ae0bb92b2

GeoPoint3D Geo::Max

...

public: GeoPoint3D Max
(
    const GeoPoint3D & a,
    const GeoPoint3D & b
)

...

Gets the component-wise maximum of two points.


Anchor
a762b6fd433e953dffb08b22cf9838408
a762b6fd433e953dffb08b22cf9838408

Matrix GEO_CALL Geo::MConstructCubeMapInvViewMatrix

...

public: Matrix GEO_CALL MConstructCubeMapInvViewMatrix
(
    Geo::s32 faceIdx
)

...

Construct the inverse of the view matrix for a specific cubemap face.


Anchor
a6ce34796f7a8a6606651a96c0da265e3
a6ce34796f7a8a6606651a96c0da265e3

Matrix GEO_CALL Geo::MConstructCubeMapViewMatrix

...

public: Matrix GEO_CALL MConstructCubeMapViewMatrix
(
    Geo::s32 faceIdx
)

...

Construct a view matrix for a specific cubemap face.


Anchor
a0690dcefa7bb364a51660e8cbf6de29e
a0690dcefa7bb364a51660e8cbf6de29e

GeoPoint3D Geo::Min

...

public: GeoPoint3D Min
(
    const GeoPoint3D & a,
    const GeoPoint3D & b
)

...

Gets the component-wise minimum of two points.


Anchor
ada863dc85fe3c236ac4f4bcf202b1a0d
ada863dc85fe3c236ac4f4bcf202b1a0d

VectorD Geo::operator-

...

public: VectorD operator-
(
    VectorD lhs,
    VectorD rhs
)

...

Double precision vector operators.


Anchor
a9b5be313e68b1a2cedb57546720e55d6
a9b5be313e68b1a2cedb57546720e55d6

VectorD Geo::operator*

...

public: VectorD operator*
(
    double lhs,
    VectorD rhs
)

...

Double precision vector operators.


Anchor
a0f7923f29f6d1376d43e221be210bd8b
a0f7923f29f6d1376d43e221be210bd8b

VectorD Geo::operator/

...

public: VectorD operator/
(
    VectorD lhs,
    VectorD rhs
)

...

Double precision vector operators.


Anchor
a4a9006c68abe8b1d0b98eb9655d54ba4
a4a9006c68abe8b1d0b98eb9655d54ba4

const v128 & Geo::GeoBoundingBox::operator[]

...

public: const v128 & operator[]
(
    Geo::u32 index
) const

...

Indexed access to the two extreme points that define this bounding box (index must be 0 or 1).


Anchor
af21e0cbc070e3819b2df451ed48e55ea
af21e0cbc070e3819b2df451ed48e55ea

GeoBoundingBox Geo::GeoBoundingBox::operator+

...

public: GeoBoundingBox operator+
(
    const GeoBoundingBox & rhs
) const

...

Compute and return the union of this bounding with another.


Anchor
abdc510e873ae949eb4cd66f699024c5e
abdc510e873ae949eb4cd66f699024c5e

GeoBoundingBox & Geo::GeoBoundingBox::operator+=

...

public: GeoBoundingBox & operator+=
(
    const v128 & rhs
)

...

Enlarge this bounding box to include the given point.


Anchor
ac14c070d2f3fabbbbaec2a09768c2887
ac14c070d2f3fabbbbaec2a09768c2887

GeoBoundingBox & Geo::GeoBoundingBox::operator+=

...

public: GeoBoundingBox & operator+=
(
    const GeoBoundingBox & rhs
)

...

Compute the inplace union of this bounding box and another.


Anchor
ae1e5b137c2e4b3a16ac23ac2ec27b1e4
ae1e5b137c2e4b3a16ac23ac2ec27b1e4

bool Geo::operator<

...

public: bool operator<
(
    const GeoPoint3D & lhs,
    const GeoPoint3D & rhs
)

...

Allow GeoPoint3D to be used as a key for GeoMap.

Although this will not give any kind of sensible spatial organisation, it is at least a stable, usable ordering.


Anchor
a80a668c7886ccf5b0f9f03bfe221d550
a80a668c7886ccf5b0f9f03bfe221d550

bool Geo::operator<

...

public: bool operator<
(
    const GeoPoint3 & lhs,
    const GeoPoint3 & rhs
)

...

Allow GeoPoint3 to be used as a key for GeoMap.

Although this will not give any kind of sensible spatial organisation, it is at least a stable, usable ordering.


Anchor
add783b50156203833820e5b1d5506b3c
add783b50156203833820e5b1d5506b3c

bool Geo::operator==

...

public: bool operator==
(
    const GeoPoint3 & lhs,
    const GeoPoint3 & rhs
)

...

Equality operator.


Anchor
a2af245371d9c39f241755a6ece971cc3
a2af245371d9c39f241755a6ece971cc3

GeoRect Geo::ScaleRect

...

public: GeoRect ScaleRect
(
    GeoRect rect,
    float scale
)

...

Function to scale a bounding box.


Anchor
ad92238e9584de24b74c195865991ef05
ad92238e9584de24b74c195865991ef05

void Geo::GeoBoundingBox::SetEmpty

...

public: void SetEmpty()

...

Resets the box to it's default empty state.


Anchor
a6e5f7b1fa0ecfe6abca01ddeacf8de7e
a6e5f7b1fa0ecfe6abca01ddeacf8de7e

bool GEO_CALL Geo::TestSamplingDistributions

...

public: bool GEO_CALL TestSamplingDistributions
(
    const char * filename,
    const s32 & numSamples
)

...

Write out raysets representing the ray distributions for debugging and visualisation.


Anchor
a418a9763415e96fca20e176569ec2724
a418a9763415e96fca20e176569ec2724

u32 Geo::UniformInteger

...

public: u32 UniformInteger
(
    RNG & rng
)

...

Random unsigned 32 bit integer, [0, 0xffffffff] (inclusive)


Anchor
a47dece2be8de93e22636ec6dc97f0d69
a47dece2be8de93e22636ec6dc97f0d69

double Geo::UniformSignedUnitDouble

...

public: double UniformSignedUnitDouble
(
    RNG & rng
)

...

Random double, [-1, 1] (inclusive)


Anchor
a49a3d287d432a37d611cd9f0a495211d
a49a3d287d432a37d611cd9f0a495211d

float Geo::UniformSignedUnitFloat

...

public: float UniformSignedUnitFloat
(
    RNG & rng
)

...

Random float, [-1, 1] (inclusive)


Anchor
ab8cf0277e948b3cccb856c7780aea93f
ab8cf0277e948b3cccb856c7780aea93f

double Geo::UniformUnitClopenDouble

...

public: double UniformUnitClopenDouble
(
    RNG & rng
)

...

Random double, [0, 1)


Anchor
ae3302cf27f0641dba1b47d31ea0b0e74
ae3302cf27f0641dba1b47d31ea0b0e74

float Geo::UniformUnitClopenFloat

...

public: float UniformUnitClopenFloat
(
    RNG & rng
)

...

Random float, [0, 1)


Anchor
a46998ffc27658e02ee5d0189f034808d
a46998ffc27658e02ee5d0189f034808d

double Geo::UniformUnitDouble

...

public: double UniformUnitDouble
(
    RNG & rng
)

...

Random double, [0, 1] (inclusive)


Anchor
a28e7490b7807d76120454ade1727f196
a28e7490b7807d76120454ade1727f196

float Geo::UniformUnitFloat

...

public: float UniformUnitFloat
(
    RNG & rng
)

...

Random float, [0, 1] (inclusive)


Anchor
aa00c44059485661315bba5d5f9406f2c
aa00c44059485661315bba5d5f9406f2c

double Geo::UniformUnitOpenDouble

...

public: double UniformUnitOpenDouble
(
    RNG & rng
)

...

Random double, (0, 1)


Anchor
aff529edb732935beaf23793bb31cd195
aff529edb732935beaf23793bb31cd195

float Geo::UniformUnitOpenFloat

...

public: float UniformUnitOpenFloat
(
    RNG & rng
)

...

Random float, (0, 1)


Anchor
ae40ab5e706b35fe8f88f5eb388881008
ae40ab5e706b35fe8f88f5eb388881008

GeoRect Geo::UnionOfRects

...

public: GeoRect UnionOfRects
(
    GeoRect r1,
    GeoRect r2
)

...

Union of two bounding boxes.


Anchor
aab3f066dcb37d0d498d25cb6efbb374c
aab3f066dcb37d0d498d25cb6efbb374c

bool Geo::VLeftOf2

...

public: bool VLeftOf2
(
    const Geo::v128 & a,
    const Geo::v128 & b,
    const Geo::v128 & c
)

...

Determines if the point 'c' is to the left of the line formed by joining 'a' and 'b'.


Anchor
aea061c246b990500febd873a6eda82c6
aea061c246b990500febd873a6eda82c6

VectorD Geo::VLength

...

public: VectorD VLength
(
    VectorD v
)

...

Double precision vector operators.


Anchor
a2bd76e40f86fe927973d6949d2143b7d
a2bd76e40f86fe927973d6949d2143b7d

bool Geo::VRightOf2

...

public: bool VRightOf2
(
    const Geo::v128 & a,
    const Geo::v128 & b,
    const Geo::v128 & c
)

...

Determines if the point 'c' is to the right of the line formed by joining 'a' and 'b'.


Anchor
a2582a22d4852db5bfd14d687b39a2b4a
a2582a22d4852db5bfd14d687b39a2b4a

Geo::v128 Geo::VScaleAndAdd

...

public: Geo::v128 VScaleAndAdd
(
    const Geo::v128 & a,
    float s,
    const Geo::v128 & b,
    float t
)

...

Calculates a * s + b * t.


Anchor
abff5b13b6e9147b64a23a6267f5fff7e
abff5b13b6e9147b64a23a6267f5fff7e

float Geo::VSignedArea2

...

public: float VSignedArea2
(
    const Geo::v128 & a,
    const Geo::v128 & b,
    const Geo::v128 & c
)

...

Calculates the signed area of the given triangle in 2D space (z-coordinates ignored)


Anchor
a757e22185dca61cc8a002143d836af0c
a757e22185dca61cc8a002143d836af0c

Geo::v128 Geo::VSlerp2

...

public: Geo::v128 VSlerp2
(
    const Geo::v128 & a,
    const Geo::v128 & b,
    float t
)

...

Spherical linear interpolation between 'a' and 'b', with weight 't'.


Anchor
a5c723f8b5e5763ab573ba6b9b2ff8f8c
a5c723f8b5e5763ab573ba6b9b2ff8f8c

Dimension3

...

public: enum Dimension3
{
    DIMENSION3_X = 0,
    DIMENSION3_Y = 1,
    DIMENSION3_Z = 2
}

...

An enumeration of the dimensions of 3D space.

enumerators
DIMENSION3_X
DIMENSION3_Y
DIMENSION3_Z


Anchor
a46eb6d8acfca7e33660eb22b3fe8e314
a46eb6d8acfca7e33660eb22b3fe8e314

Sign

...

public: enum Sign
{
    SIGN_POSITIVE = 0,
    SIGN_NEGATIVE = 1
}

...

A sign bit.

enumerators
SIGN_POSITIVE
SIGN_NEGATIVE