Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
G3D Namespace Reference

Namespaces

namespace  _BSPMAP
 
namespace  _internal
 
namespace  Discovery
 
namespace  GUI
 GUI helpers that have not yet been integrated into a high-level control or window.
 
namespace  SpeedLoad
 ArticulatedModel and UniversalMaterial support "SpeedLoad" file formats.
 
namespace  units
 Use using namespace G3D::units; to include all units into your program.
 

Classes

struct  _DIDATAFORMAT
 
struct  _DIOBJECTDATAFORMAT
 
class  _GuiSliderBase
 
class  _internalGThreadWorker
 For use by runConcurrently2D. More...
 
class  AABox
 An axis-aligned box. More...
 
class  ActiveEvent
 Application visibility event structure. More...
 
class  AlignedMemoryManager
 Allocates memory on 16-byte boundaries. More...
 
class  AmbientOcclusion
 Screen-space ambient obscurance. More...
 
class  AmbientOcclusionSettings
 For use with AmbientOcclusion. More...
 
class  Any
 Easy loading and saving of human-readable configuration files. More...
 
class  AnyTableReader
 Convenient iteration over the keys of a Any::TABLE, usually for implementing construction of an object from an Any. More...
 
class  AreaMemoryManager
 Allocates memory in large blocks and then frees it as an area. More...
 
class  Args
 All arguments. More...
 
class  Array
 Dynamic 1D array tuned for performance. More...
 
class  ArrowShape
 
class  ArticulatedModel
 A 3D object composed of multiple rigid triangle meshes connected by joints. More...
 
class  AtomicInt32
 An integer that may safely be used on different threads without external locking. More...
 
class  AttributeArray
 A block of GPU memory storing a stream of vector data (e.g., vertices, normals, texture coordinates) More...
 
class  AxesShape
 
class  BinaryInput
 Sequential or random access byte-order independent binary file access. More...
 
class  BinaryOutput
 Sequential or random access byte-order independent binary file access. More...
 
class  BlockPoolMemoryManager
 A MemoryManager that allocates fixed-size objects and maintains a freelist that never shrinks. More...
 
class  Box
 An arbitrary (oriented) 3D box, useful as a bounding box. More...
 
class  Box2D
 2D oriented box More...
 
class  BoxShape
 
class  BumpMap
 Normal + bump map for use with G3D::UniversalMaterial. More...
 
class  BumpMapPreprocess
 Not in the BumpMap class to avoid a circular dependency between Texture and BumpMap. More...
 
class  Camera
 Abstraction of a lens or pinhole camera. More...
 
class  CameraControlWindow
 Gui used by DeveloperWindow default for recording camera position and making splines. More...
 
class  Capsule
 A shape formed by extruding a sphere along a line segment. More...
 
class  CapsuleShape
 
class  CharInputEvent
 An event triggered by character input (as from the keyboard) More...
 
class  CollisionDetection
 Collision detection primitives and tools for building higher order collision detection schemes. More...
 
class  Color1
 Monochrome color. More...
 
class  Color3
 Do not subclass– this implementation makes assumptions about the memory layout. More...
 
class  Color4
 Do not subclass– this implementation makes assumptions about the memory layout. More...
 
class  CompassDelta
 Oriented angle measure on a compass; the difference of two CompassDirections. More...
 
class  CompassDirection
 Azimuth measured in degrees from 0 = North = -z, increasing clockwise in the ZX plane. More...
 
class  Component
 Common code for G3D::Component1, G3D::Component3, and G3D::Component4. More...
 
class  Conduit
 
class  Cone
 An infinite cone. More...
 
class  ConvexPolygon
 
class  ConvexPolygon2D
 
class  ConvexPolyhedron
 
class  CoordinateFrame
 A rigid body RT (rotation-translation) transformation. More...
 
class  CPUPixelTransferBuffer
 A PixelTransferBuffer in main memory. More...
 
class  CPUVertexArray
 Array of vertices with interlaced position, normal, texCoord, and tangent attributes. More...
 
class  CRTMemoryManager
 A MemoryManager implemented using the C runtime. More...
 
class  Crypto
 Cryptography and hashing helper functions. More...
 
class  CubeFace
 
class  CubeMapConvention
 Image alignment conventions specified by different APIs. More...
 
class  CullFace
 
class  Cylinder
 Right cylinder. More...
 
class  CylinderShape
 
class  DepthEncoding
 Encoding of the depth buffer (not the GBuffer::Field::CS_Z buffer) More...
 
class  DepthOfField
 Simple defocus post-process shader. More...
 
class  DepthOfFieldModel
 The depth of field model. More...
 
class  DepthOfFieldSettings
 
class  DeveloperWindow
 Developer HUD controls instantiated by GApp::createDeveloperHUD for debugging. More...
 
struct  DIDEVCAPS
 
struct  DIDEVICEINSTANCEA
 
struct  DIDEVICEOBJECTDATA
 
struct  DIDEVICEOBJECTINSTANCEA
 
struct  DIPROPDWORD
 
struct  DIPROPHEADER
 
class  DirectedEdge
 
class  DirectionHistogram
 A histogram on the surface of a sphere. More...
 
class  Draw
 Useful routines for rendering primitives when debugging. More...
 
class  DXCaps
 Provides very basic DirectX detection and information support. More...
 
class  Entity
 Base class for objects in a G3D::Scene. More...
 
class  ExposeEvent
 The "screen redraw" event. More...
 
class  FastPODTable
 A sparse grid optimized for the performance of read and write operations. More...
 
class  FastPointHashGrid
 A multiset of values (i.e., with duplicates allowed) indexed efficiently by spatial location. More...
 
class  FileDialog
 
class  FileDropEvent
 Triggered when one or more files are dropped onto a window. More...
 
class  FileNotFound
 Thrown by various file opening routines if the file is not found. More...
 
class  FilePath
 Parsing of file system paths. More...
 
class  FileSystem
 OS-independent file system layer that optimizes the performance of queries by caching and prefetching. More...
 
class  Film
 Post processing: gamma correction, exposure, bloom, and screen-space antialiasing. More...
 
class  FilmSettings
 
class  FirstPersonManipulator
 Uses a First Person (Quake- or World of Warcraft style) mapping to translate keyboard and mouse input into a flying camera position. More...
 
class  FocusEvent
 
class  FOVDirection
 Stores the direction of the field of view for a G3D::Projection. More...
 
class  Framebuffer
 Holds a set of G3D::Textures or G3D::Renderbuffers for use as draw targets. More...
 
class  Frustum
 
struct  G3DJOYDATA
 
struct  G3DKEYDATA
 
class  GApp
 Optional base class for quickly creating 3D applications. More...
 
class  GaussianBlur
 1D Gaussian blur. More...
 
class  GBuffer
 Saito and Takahashi's Geometry Buffers, typically used today for deferred shading. More...
 
class  GButtonState
 General keyboard/mouse state definitions used by GEvent. More...
 
class  GConsole
 Command-line console. More...
 
union  GEvent
 General low-level event structure. More...
 
class  GEventType
 Event code enumerations. More...
 
class  GFont
 Font class for use with RenderDevice. More...
 
class  GKey
 A mapping of every physical key on the keyboard and other input devices in a (mostly) platform independent manner. More...
 
class  GKeyMod
 Enumeration of valid key modifier codes (often used ORed together) More...
 
class  GKeySym
 Symbolic key structure. More...
 
class  GLCaps
 Low-level wrapper for OpenGL extension management. More...
 
class  GLFWWindow
 
class  GLPixelTransferBuffer
 Abstraction of OpenGL Pixel Buffer Object, an efficient way of transferring data to or from a GPU. More...
 
class  GMutex
 Mutual exclusion lock used for synchronization. More...
 
class  GMutexLock
 Automatically locks while in scope. More...
 
class  GThread
 Platform independent thread implementation. More...
 
class  GuiButton
 Push button that can be temporarily pressed. More...
 
class  GuiCheckBox
 Check box or toggle button. More...
 
class  GuiCloseEvent
 Triggered by pressing the close button on a G3D::GuiWindow. More...
 
class  GuiContainer
 Base class for controls that contain other controls. More...
 
class  GuiControl
 Base class for all controls. More...
 
class  GuiDrawer
 
class  GuiDropDownList
 List box for viewing strings or GuiText. More...
 
class  GuiEvent
 Events triggered by the G3D GUI system (see G3D::GuiWindow for discussion) More...
 
class  GuiFunctionBox
 Displays a Spline<float> with editable control points. More...
 
class  GuiLabel
 A text label. More...
 
class  GuiMenu
 A special "popup" window that hides itself when it loses focus. More...
 
class  GuiNumberBox
 Number editing textbox with associated slider. More...
 
class  GuiPane
 Sub-rectangle of a window. More...
 
class  GuiRadioButton
 Radio button or exclusive set of toggle butons. More...
 
class  GuiSlider
 Slider. More...
 
class  GuiTabPane
 A gui control that allows the user to switch between a variety of differnt panes. More...
 
class  GuiText
 Text or Icon on a G3D::GuiControl. More...
 
class  GuiTextBox
 Text box for entering strings. More...
 
class  GuiTextureBox
 
class  GuiTheme
 Renders UI elements. More...
 
class  GuiWindow
 Retained-mode graphical user interface window. More...
 
class  GUniqueID
 Globally unique identifiers. More...
 
class  HeightfieldModel
 A tiled regular heightfield with a single detail level, suitable for very large terrains observed mostly from above. More...
 
class  Icon
 
class  IconSet
 A set of small image files packed into a single G3D::Texture for efficiency. More...
 
class  Image
 Provides general image loading, saving, conversion and pixel access. More...
 
class  Image1
 Luminance image with 32-bit floating point storage. More...
 
class  Image1unorm8
 Compact storage for luminance/alpha-only/red-only normalized 8-bit images. More...
 
class  Image3
 RGB image with 32-bit floating point storage for each channel. More...
 
class  Image3unorm8
 Compact storage for RGB 8-bit per channel images. More...
 
class  Image4
 RGBA image with 32-bit floating point storage for each channel. More...
 
class  Image4unorm8
 Compact storage for RGBA 8-bit per channel images. More...
 
class  ImageConvert
 Image conversion utility methods. More...
 
class  ImageFormat
 Information about common image formats. More...
 
class  ImageUtils
 
class  IndexStream
 A stream of indices referencing into an AttributeBuffer. More...
 
class  Intersect
 
class  JoyAxisEvent
 Joystick axis motion event structure. More...
 
class  JoyBallEvent
 Joystick trackball motion event structure. More...
 
class  JoyButtonEvent
 
class  JoyHatEvent
 Joystick hat position change event structure. More...
 
class  KDTree
 A set that supports spatial queries using a KD tree (axis-aligned BSP tree) for speed. More...
 
class  KeyboardEvent
 Keyboard event structure. More...
 
class  Light
 An (invisible) emitting surface (AREA) or point (DIRECTIONAL, SPOT, OMNI) light. More...
 
class  Lighting
 A rich environment-lighting model that contains both global and local sources. More...
 
class  LightweightConduit
 Provides fast but unreliable transfer of messages. More...
 
class  Line
 An infinite 3D line. More...
 
class  Line2D
 An infinite 2D line. More...
 
class  LineSegment
 An finite segment of an infinite 3D line. More...
 
class  LineSegment2D
 
class  Log
 System log for debugging purposes. More...
 
class  LogScaleAdapter
 Used by GuiSlider. More...
 
class  Manipulator
 Exports a coordinate frame, typically in response to user input. More...
 
class  Map2D
 Map of values across a discrete 2D plane. More...
 
class  MapComponent
 Manages CPU and GPU versions of image data and performs conversions as needed. More...
 
class  Material
 Base class for materials in G3D, mostly useful as an interface for ray tracing since hardware rasterization rendering needs to be specialized for each Surface and Material subclass. More...
 
class  Matrix
 N x M matrix. More...
 
class  Matrix2
 
class  Matrix3
 A 3x3 matrix. More...
 
class  Matrix4
 A 4x4 matrix. More...
 
class  Matrix4float64
 Double-precision 4x4 matrix. More...
 
class  MD2Model
 Quake II model class primarily used for low-polygon keyframe animated characters. More...
 
class  MD3Model
 Quake III MD3 model loader. More...
 
class  MD5Hash
 See G3D::Crypto::md5. More...
 
class  MemoryManager
 Abstraction of memory management. More...
 
class  MeshAlg
 Indexed mesh algorithms. More...
 
class  MeshBuilder
 Allows creation of optimized watertight meshes from unoptimized polygon soups. More...
 
class  MeshShape
 Mesh shape is intended for debugging and for collision detection. More...
 
class  Milestone
 Used to set a marker in the GPU instruction stream that the CPU can later query or block on. More...
 
class  MirrorQuality
 Values for UniversalSurface::GPUGeom::mirrorHint. More...
 
class  Model
 Common base class for models. More...
 
class  MotionBlur
 Makes multiple gather passes. More...
 
class  MotionBlurSettings
 
class  MouseButtonEvent
 
class  MouseMotionEvent
 Mouse motion event structure. More...
 
class  MouseScroll2DEvent
 2D scroll event structure More...
 
class  NetAddress
 
class  NetListener
 Runs on the server listening for clients trying to make reliable connections. More...
 
class  NetworkDevice
 Abstraction of network (socket) functionality. More...
 
class  Noise
 3D fixed point Perlin noise generator. More...
 
class  OSWindow
 Interface to window APIs for window management, event processing, and OpenGL context management. More...
 
class  Parse3DS
 Parses 3DS model files. More...
 
class  ParseError
 Thrown by TextInput, Any, and other parsers on unexpected input. More...
 
class  ParseMTL
 Parses Wavefront material (.mtl) files. More...
 
class  ParseOBJ
 Parses OBJ files with polygonal data and their associated MTL files. More...
 
class  ParsePLY
 Parses PLY geometry files to extract face and vertex information. More...
 
class  PathDirection
 Direction of light transport along a ray or path. More...
 
class  PhysicsFrame
 An RT transformation using a quaternion; suitable for physics integration. More...
 
class  PhysicsFrameSpline
 A subclass of Spline that keeps the rotation field of a PhysicsFrame normalized and rotating the short direction. More...
 
class  PhysicsFrameSplineEditor
 
class  PixelTransferBuffer
 Base class for transfering arrays of pixels between major classes, generalized over CPU arrays, memory-mapped files, and OpenGL Pixel Buffer Objects. More...
 
class  Plane
 An infinite 2D plane in 3D space. More...
 
class  PlaneShape
 
class  Pointer
 Acts like a pointer to a value of type ValueType (i.e., ValueType*), but can operate through accessor methods as well as on a value in memory. More...
 
class  PointHashGrid
 A sparse 3D grid of point-based data. More...
 
class  PointKDTree
 A set data structure that supports spatial queries using an axis-aligned BSP tree for speed. More...
 
class  PointShape
 
class  PrecomputedRandom
 Fast random numbers using a precomputed data table. More...
 
class  PrimitiveType
 These are defined to have the same value as the equivalent OpenGL constant. More...
 
class  Profiler
 Measures execution time on the CPU and GPU of parts of a program. More...
 
class  Projection
 A 3D perspective projection with bounding planes in camera space. More...
 
class  Proxy
 Provides a level of indirection for accessing objects to allow computing them on demand or extending them with metadata without subclassing the object itself. More...
 
class  Quat
 Arbitrary quaternion (not necessarily unit). More...
 
class  Queue
 Dynamic queue that uses a circular buffer for performance. More...
 
class  QuitEvent
 The "quit requested" event. More...
 
class  Random
 Random number generator. More...
 
class  Ray
 A 3D Ray. More...
 
class  RayGridIterator
 Computes conservative line raster/voxelization across a grid for use in walking a grid spatial data structure or or voxel scene searching for intersections. More...
 
class  RayShape
 
class  Rect2D
 If you are using this class for pixel rectangles, keep in mind that the last pixel you can draw to is at x0() + width() - 1. More...
 
class  ReferenceCountedObject
 
class  RefractionQuality
 Values for UniversalSurface::GPUGeom::refractionHint. More...
 
class  RegistryUtil
 Provides generalized Windows registry querying. More...
 
class  ReliableConduit
 A conduit that guarantees messages will arrive, intact and in order. More...
 
class  Renderbuffer
 Abstraction of the OpenGL renderbuffer object. More...
 
class  RenderDevice
 Abstraction of a graphics rendering context (GPU). More...
 
class  ResizeEvent
 The "window resized" event When you get this event, you are responsible for setting a new video mode with the new width and height. More...
 
class  Scene
 Sample scene graph. More...
 
class  SceneEditorWindow
 
class  SDLWindow
 An implementation of G3D::OSWindow that uses the Open Source SDL library. More...
 
class  Set
 An unordered data structure that has at most one of each element. More...
 
class  Shader
 Abstraction of the programmable hardware pipeline. More...
 
class  ShadowMap
 
class  Shape
 Base class for debugging shapes that can render themselves. More...
 
class  SkyboxSurface
 An infinite cube that simulates the appearance of distant objects in the scene. More...
 
class  SmallArray
 Embeds N elements to reduce allocation time and increase memory coherence when working with arrays of arrays. More...
 
class  SpeedLoadIdentifier
 
class  Sphere
 Sphere. More...
 
class  SphereShape
 
class  Spinlock
 A mutual exclusion lock that busy-waits when locking. More...
 
class  Spline
 Smooth parameteric curve implemented using a piecewise 3rd-order Catmull-Rom spline curve. More...
 
class  SplineBase
 Common implementation code for all G3D::Spline template parameters. More...
 
class  Stopwatch
 Accurately measure durations and framerates. More...
 
class  Surface
 The surface of a model, posed and ready for rendering. More...
 
class  Surface2D
 Primarily for use in GUI rendering. More...
 
class  Surfel
 Local surface geometry + BSDF + emission function. More...
 
class  System
 OS and processor abstraction. More...
 
class  Table
 An unordered data structure mapping keys to values. More...
 
class  TextInput
 A simple tokenizer for parsing text files. More...
 
class  TextOutput
 Convenient formatting of ASCII text written to a file. More...
 
class  Texture
 A 1D, 2D, or 3D array (e.g., an image) stored on the GPU, commonly used for mapping reflectance values (colors) over meshes. More...
 
class  ThirdPersonManipulator
 By default, the ThirdPersonManipulator moves an object relative to its own axes. More...
 
class  ThreadSet
 Manages a set of threads. More...
 
class  Token
 For use with TextInput. More...
 
class  Tri
 Triangle implementation optimized for ray-triangle intersection. More...
 
class  Triangle
 A generic triangle representation. More...
 
class  TriangleShape
 A single triangle. More...
 
class  TriTree
 Static bounding interval hierarchy for Ray-Tri intersections. More...
 
class  uint128
 Limited functionality 128-bit unsigned integer. More...
 
class  UniversalBSDF
 G3D's default description of how a surface reflects light (photons). More...
 
class  UniversalMaterial
 Description of a surface for rendering purposes. More...
 
class  UniversalSurface
 An optimized implementation G3D::Surface for G3D::Shader / G3D::UniversalMaterial classes. More...
 
class  UniversalSurfel
 A Surfel for a surface patch described by a UniversalMaterial. More...
 
class  UprightFrame
 Coordinate frame expressed in Euler angles. More...
 
class  UprightSpline
 Shortest-path linear velocity spline for camera positions. More...
 
class  UprightSplineManipulator
 Allows recording and playback of a G3D::UprightSpline based on a G3D::Camera. More...
 
class  UserEvent
 A user-defined event type. More...
 
class  UserInput
 User input class that consolidates joystick, keyboard, and mouse state. More...
 
class  Vector2
 Do not subclass– this implementation makes assumptions about the memory layout. More...
 
class  Vector3
 Swizzles Vector classes have swizzle operators, e.g. More...
 
class  Vector4
 Do not subclass– this implementation makes assumptions about the memory layout. More...
 
class  Vector4int8
 Homogeneous vector stored efficiently in four signed int8s. More...
 
class  VertexBuffer
 A block of GPU memory within which G3D::AttributeArrays for vertex, texcoord, normal, etc. More...
 
class  VideoInput
 Read video files from MPG, MP4, AVI, MOV, OGG, ASF, and WMV files. More...
 
class  VideoOutput
 Saves video to disk in a variety of popular formats, including AVI and MPEG. More...
 
class  VideoRecordDialog
 A dialog that allows the user to launch recording of the on-screen image to a movie. More...
 
class  VisibleEntity
 Base class for Entitys that use a built-in G3D model class. More...
 
class  VisualizeCameraSurface
 Displays a 3D representation of a Camera. More...
 
class  VisualizeLightSurface
 Displays a 3D representation of a Light. More...
 
class  WeakCache
 A cache that does not prevent its members from being garbage collected. More...
 
class  Welder
 
class  Widget
 Interface for 2D or 3D objects that experience standard virtual world events and are rendered. More...
 
class  WidgetManager
 Manages a group of G3D::Widget. More...
 
class  Win32Window
 
class  WrapMode
 Describes the behavior of G3D::Texture, G3D::Map2D, G3D::Image3, etc. More...
 
class  XML
 Easy loading and saving of XML and HTML files. More...
 

Typedefs

typedef class Rect2D AABox2D
 
typedef bool(* AssertionHook )(const char *_expression, const std::string &message, const char *filename, int lineNumber, bool useGuiPrompt)
 
typedef Color3 Biradiance3
 Radiance * measure(Solid Angle) between two points, measured at the receiver orthogonal to the axis between them; W/m^2.
 
typedef _BSPMAP::Map BSPMap
 
typedef _BSPMAP::MapRef BSPMapRef
 
typedef class CoordinateFrame CFrame
 
typedef AreaMemoryManager CoherentAllocator
 
typedef CompassDelta CompassBearing
 
typedef Component< Color1, Image1Component1
 
typedef Component< Color3, Image3Component3
 
typedef Component< Color4, Image4Component4
 
typedef void(* ConsolePrintHook )(const std::string &)
 
typedef int DebugID
 Used with debugDraw.
 
typedef struct G3D::_DIDATAFORMAT DIDATAFORMAT
 
typedef struct G3D::DIDEVCAPS DIDEVCAPS
 
typedef struct
G3D::DIDEVICEINSTANCEA 
DIDEVICEINSTANCEA
 
typedef struct
G3D::DIDEVICEOBJECTDATA 
DIDEVICEOBJECTDATA
 
typedef DIDEVICEOBJECTINSTANCEA DIDEVICEOBJECTINSTANCE
 
typedef struct
G3D::DIDEVICEOBJECTINSTANCEA 
DIDEVICEOBJECTINSTANCEA
 
typedef struct
G3D::_DIOBJECTDATAFORMAT 
DIOBJECTDATAFORMAT
 
typedef struct G3D::DIPROPDWORD DIPROPDWORD
 
typedef struct G3D::DIPROPHEADER DIPROPHEADER
 
typedef Color3 Energy3
 Force * distance; J.
 
typedef shared_ptr< class
FileDialog
FileDialogRef
 
typedef shared_ptr< class
FirstPersonManipulator
FirstPersonManipulatorRef
 
typedef float float32
 
typedef double float64
 
typedef double GameTime
 Time, in seconds.
 
typedef shared_ptr< class
GConsole
GConsoleRef
 
typedef HGLRC GLContext
 OpenGL context (argument to glMakeCurrent, return value of glGetCurrentContext).
 
typedef voidGLFWwindow
 
typedef shared_ptr< class GThreadGThreadRef
 
typedef shared_ptr< class
GuiTheme
GuiThemeRef
 
typedef shared_ptr< class
GuiWindow
GuiWindowRef
 
typedef shared_ptr< class Image1Image1Ref
 
typedef shared_ptr< class
Image1unorm8
Image1unorm8Ref
 
typedef shared_ptr< class Image3Image3Ref
 
typedef shared_ptr< class
Image3unorm8
Image3unorm8Ref
 
typedef shared_ptr< class Image4Image4Ref
 
typedef shared_ptr< class
Image4unorm8
Image4unorm8Ref
 
typedef int16_t int16
 
typedef int32_t int32
 
typedef int64_t int64
 
typedef int8_t int8
 
typedef Color3 Irradiance3
 Incident power per area; W/m^2.
 
typedef shared_ptr< class
LightweightConduit
LightweightConduitRef
 
typedef const DIDATAFORMATLPCDIDATAFORMAT
 
typedef const DIDEVICEINSTANCEALPCDIDEVICEINSTANCEA
 
typedef const DIDEVICEOBJECTDATALPCDIDEVICEOBJECTDATA
 
typedef const
DIDEVICEOBJECTINSTANCEA
LPCDIDEVICEOBJECTINSTANCEA
 
typedef const DIOBJECTDATAFORMATLPCDIOBJECTDATAFORMAT
 
typedef const DIPROPDWORDLPCDIPROPDWORD
 
typedef const DIPROPHEADERLPCDIPROPHEADER
 
typedef struct G3D::_DIDATAFORMATLPDIDATAFORMAT
 
typedef struct G3D::DIDEVCAPSLPDIDEVCAPS
 
typedef struct
G3D::DIDEVICEINSTANCEA
LPDIDEVICEINSTANCEA
 
typedef struct
G3D::DIDEVICEOBJECTDATA
LPDIDEVICEOBJECTDATA
 
typedef LPDIDEVICEOBJECTINSTANCEA LPDIDEVICEOBJECTINSTANCE
 
typedef struct
G3D::DIDEVICEOBJECTINSTANCEA
LPDIDEVICEOBJECTINSTANCEA
 
typedef struct
G3D::_DIOBJECTDATAFORMAT
LPDIOBJECTDATAFORMAT
 
typedef struct G3D::DIPROPDWORDLPDIPROPDWORD
 
typedef struct G3D::DIPROPHEADERLPDIPROPHEADER
 
typedef struct
IDirectInputDevice8A * 
LPDIRECTINPUTDEVICE8A
 
typedef shared_ptr< class
NetListener
NetListenerRef
 
typedef PhysicsFrame PFrame
 
typedef Vector2 Point2
 
typedef Vector3 Point3
 Points are technically distinct mathematical entities from vectors.
 
typedef Color3 Power3
 Energy per time; W.
 
typedef Color3 Radiance3
 Power per (measure(SolidAngle) * measure(Area)); W / (m^2 sr)
 
typedef Color3 Radiosity3
 Power per area; J / m^2.
 
typedef double RealTime
 Actual wall clock time in seconds.
 
typedef shared_ptr< class
ReliableConduit
ReliableConduitRef
 
typedef Renderbuffer RenderBuffer
 
typedef shared_ptr< RenderbufferRenderbufferRef
 
typedef RenderbufferRef RenderBufferRef
 
typedef shared_ptr< class ShapeShapeRef
 
typedef double SimTime
 
typedef Stopwatch StopWatch
 Because it is hard to remember the proper capitalization.
 
typedef shared_ptr< class
Surface2D
Surface2DRef
 
typedef ImageFormat TextureFormat
 
typedef shared_ptr< class
ThirdPersonManipulator
ThirdPersonManipulatorRef
 
typedef uint16_t uint16
 
typedef uint32_t uint32
 
typedef uint64_t uint64
 
typedef uint8_t uint8
 
typedef shared_ptr< class
UprightSplineManipulator
UprightSplineManipulatorRef
 
typedef AttributeArray VAR
 
typedef AttributeArray VertexRange
 

Enumerations

enum  {
  SDL_PRESSED = 0x01,
  SDL_RELEASED = 0x00
}
 General keyboard/mouse state definitions. More...
 
enum  {
  GKEYMOD_NONE = 0x0000,
  GKEYMOD_LSHIFT = 0x0001,
  GKEYMOD_RSHIFT = 0x0002,
  GKEYMOD_LCTRL = 0x0040,
  GKEYMOD_RCTRL = 0x0080,
  GKEYMOD_LALT = 0x0100,
  GKEYMOD_RALT = 0x0200,
  GKEYMOD_LMETA = 0x0400,
  GKEYMOD_RMETA = 0x0800,
  GKEYMOD_NUM = 0x1000,
  GKEYMOD_CAPS = 0x2000,
  GKEYMOD_MODE = 0x4000,
  GKEYMOD_RESERVED = 0x8000
}
 
enum  {
  SECOND =1,
  MINUTE =60,
  HOUR = 60*60,
  DAY =24*60*60,
  SUNRISE =24*60*60/4,
  SUNSET =24*60*60*3/4,
  MIDNIGHT =0,
  METER =1,
  KILOMETER =1000
}
 
enum  AMPM {
  AM,
  PM
}
 
enum  BinaryFormat {
  FIRST_BINFMT = 1000,
  BOOL8_BINFMT,
  UINT8_BINFMT,
  INT8_BINFMT,
  UINT16_BINFMT,
  INT16_BINFMT,
  UINT32_BINFMT,
  INT32_BINFMT,
  UINT64_BINFMT,
  INT64_BINFMT,
  UINT128_BINFMT,
  INT128_BINFMT,
  FLOAT16_BINFMT,
  FLOAT32_BINFMT,
  FLOAT64_BINFMT,
  VECTOR2_BINFMT,
  VECTOR2INT16_BINFMT,
  VECTOR3_BINFMT,
  VECTOR3INT16_BINFMT,
  VECTOR4_BINFMT,
  VECTOR4INT16_BINFMT,
  COLOR3_BINFMT,
  COLOR3UINT8_BINFMT,
  COLOR3INT16_BINFMT,
  COLOR4_BINFMT,
  COLOR4UINT8_BINFMT,
  COLOR4INT16_BINFMT,
  STRING_BINFMT,
  STRINGEVEN_BINFMT,
  STRING8_BINFMT,
  STRING16_BINFMT,
  STRING32_BINFMT,
  CHUNK_BINFMT,
  CUSTOM_BINFMT,
  LAST_BINFMT
}
 Some values like float16 and int128 have no current CPU data structure that implements them but are useful for file formats and for GPUs. More...
 
enum  G3DEndian {
  G3D_BIG_ENDIAN,
  G3D_LITTLE_ENDIAN
}
 The order in which the bytes of an integer are stored on a machine. More...
 
enum  ImageStorage {
  MOVE_TO_CPU,
  MOVE_TO_GPU,
  COPY_TO_CPU,
  COPY_TO_GPU,
  IMAGE_STORAGE_CURRENT
}
 Used by Component. More...
 
enum  SpawnBehavior {
  USE_NEW_THREAD,
  USE_CURRENT_THREAD
}
 

Functions

template<class Class >
void _internal_runConcurrently2DHelper (const Vector2int32 &start, const Vector2int32 &upTo, Class *object, void(Class::*method1)(int x, int y), void(Class::*method2)(int x, int y, int threadID), int maxThreads)
 
Vector2 abs (const Vector2 &v)
 
Vector3 abs (const Vector3 &v)
 
Vector4 abs (const Vector4 &v)
 
double abs (double fValue)
 
double aCos (double fValue)
 
float acos (float fValue)
 
bool all (const Vector2 &v)
 
bool all (const Vector3 &v)
 
bool all (const Vector4 &v)
 
bool all (float x)
 Returns true if x is not exactly equal to 0.0f.
 
bool any (const Vector2 &v)
 
bool any (const Vector3 &v)
 
bool any (const Vector4 &v)
 
bool any (float x)
 Returns true if x is not exactly equal to 0.0f.
 
double aSin (double fValue)
 
AssertionHook assertionHook ()
 
double aTan (double fValue)
 
double aTan2 (double fY, double fX)
 
bool beginsWith (const std::string &test, const std::string &pattern)
 Returns true if the test string begins with the pattern string.
 
typedef BOOL (FAR PASCAL *LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA
 
int32 byteSize (BinaryFormat f)
 Returns -1 if the format is custom, otherwise the byte size of a single element in this format.
 
template<class PointerType >
void categorizeByDerivedType (const Array< PointerType > &all, Array< Array< PointerType > > &derivedArray)
 Separates a large array into subarrays by their typeid().
 
int ceilPow2 (unsigned int in)
 Return the next power of 2 higher than the input If the input is already a power of 2, the output will be the same as the input.
 
Vector2 clamp (const Vector2 &v, const Vector2 &a, const Vector2 &b)
 
Vector3 clamp (const Vector3 &v, const Vector3 &a, const Vector3 &b)
 
Vector4 clamp (const Vector4 &v, const Vector4 &a, const Vector4 &b)
 
double clamp (double val, double low, double hi)
 
float clamp (float val, float low, float hi)
 
std::string consolePrint (const std::string &)
 
std::string __cdecl consolePrintf (const char *fmt...) G3D_CHECK_PRINTF_ARGS
 Sends output to the log and to the last GConsole instantiated.
 
ConsolePrintHook consolePrintHook ()
 
template<class T >
bool contains (const T *array, int len, const T &e)
 Array::contains for C-arrays.
 
FILE * createTempFile ()
 Returns a temporary file that is open for read/write access.
 
Vector3 cross (const Vector3 &v1, const Vector3 &v2)
 
template<class YType >
YType cyclicCatmullRomSpline (double t, const YType *controlY, int numPoints)
 See also G3D::Spline.
 
template<class YType >
YType cyclicCatmullRomSpline (double t, const Array< YType > &controlY)
 A cubic spline with regularly spaced control points.
 
DebugID debugDraw (const Shape::Ref &shape, float displayTime=0.0f, const Color4 &solidColor=Color3::white(), const Color4 &wireColor=Color3::black(), const CoordinateFrame &cframe=CoordinateFrame())
 Schedule a G3D::Shape for later rendering.
 
std::string debugPrint (const std::string &)
 
std::string __cdecl debugPrintf (const char *fmt...) G3D_CHECK_PRINTF_ARGS
 Under visual studio, appears in the VS debug pane.
 
 DECLARE_INTERFACE_ (IDirectInputDevice8A, IUnknown)
 
 DECLARE_INTERFACE_ (IDirectInput8A, IUnknown)
 
 DEFINE_GUID (IID_IDirectInput8A, 0xBF798030, 0x483A, 0x4DA2, 0xAA, 0x99, 0x5D, 0x64, 0xED, 0x36, 0x97, 0x00)
 
 DEFINE_GUID (IID_IDirectInputDevice8A, 0x54D41080, 0xDC15, 0x4833, 0xA4, 0x1B, 0x74, 0x8F, 0x73, 0xA3, 0x81, 0x79)
 
 DEFINE_GUID (GUID_Joystick, 0x6F1D2B70, 0xD5A0, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_SysKeyboard, 0x6F1D2B61, 0xD5A0, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_XAxis, 0xA36D02E0, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_YAxis, 0xA36D02E1, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_ZAxis, 0xA36D02E2, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_RxAxis, 0xA36D02F4, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_RyAxis, 0xA36D02F5, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_RzAxis, 0xA36D02E3, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_Slider, 0xA36D02E4, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_Button, 0xA36D02F0, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_Key, 0x55728220, 0xD33C, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DEFINE_GUID (GUID_POV, 0xA36D02F2, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
std::string demoFindData (bool errorIfNotFound=true)
 Routine used by the demos to find the data.
 
void describeSystem (class RenderDevice *rd, class NetworkDevice *nd, class TextOutput &t)
 Prints a human-readable description of this machine to the text output stream.
 
void describeSystem (class RenderDevice *rd, class NetworkDevice *nd, std::string &s)
 
void deserialize (std::string &s, BinaryInput &b)
 
void deserialize (int32 &i, BinaryInput &b)
 
void deserialize (uint32 &i, BinaryInput &b)
 
void deserialize (bool &i, BinaryInput &b)
 
void deserialize (float32 &f, BinaryInput &b)
 
void deserialize (float64 &f, BinaryInput &b)
 
template<typename T >
void deserialize (Array< T > &array, BinaryInput &b)
 
void deserialize (Vector2 &v, class BinaryInput &b)
 
void deserialize (Vector3::Axis &a, class BinaryInput &bo)
 
void deserialize (Vector4 &v, class BinaryInput &b)
 
void deserialize (Vector3 &v, class BinaryInput &b)
 
void deserialize (bool &b, TextInput &ti)
 
void deserialize (int &b, TextInput &ti)
 
void deserialize (uint8 &b, TextInput &ti)
 
void deserialize (double &b, TextInput &ti)
 
void deserialize (float &b, TextInput &ti)
 
void deserialize (std::string &b, TextInput &ti)
 
double determinant (const Matrix3 &m)
 
double determinant (const Matrix4 &m)
 
double distance (double x, double y)
 
double distance (double x, double y, double z)
 
float distance (float x, float y)
 
float distance (float x, float y, float z)
 
float dot (const Vector2 &a, const Vector2 &b)
 
float dot (const Vector3 &a, const Vector3 &b)
 
float dot (const Vector4 &a, const Vector4 &b)
 
float dot (float a, float b)
 a * b (for DirectX/Cg support)
 
double __fastcall drand48 ()
 
bool endsWith (const std::string &test, const std::string &pattern)
 Returns true if the test string ends with the pattern string.
 
double eps (double a, double b)
 Computes an appropriate epsilon for comparing a and b.
 
float eps (float a, float b)
 
Quat exp (const Quat &q)
 
double exp2 (double x)
 2^x
 
float exp2 (float x)
 
AssertionHook failureHook ()
 
std::string filenameBase (const std::string &filename)
 Returns the portion of a filename to the left of the last period and to the right of the last slash or colon.
 
std::string filenameBaseExt (const std::string &filename)
 Returns the part of the filename that includes the base and ext from parseFilename (i.e.
 
bool filenameContainsWildcards (const std::string &filename)
 Returns true if '*' or '?' appears in the string.
 
std::string filenameExt (const std::string &filename)
 Returns the extension on a filename.
 
std::string filenamePath (const std::string &filename)
 Returns the drive (if Win32) and path from a filename, including a slash if there was one.
 
size_t findLastSlash (const std::string &f, size_t start=std::string::npos)
 Finds the index of the first '\' or '/' character, starting at index start (if start is -1, starts at the end of the string).
 
size_t findSlash (const std::string &f, size_t start=0)
 Finds the index of the first '\' or '/' character, starting at index start.
 
float finf ()
 
uint16 flipEndian16 (const uint16 x)
 Given a 16-bit integer, returns the integer with the bytes in the opposite order.
 
uint32 flipEndian32 (const uint32 x)
 Given a 32-bit integer, returns the integer with the bytes in the opposite order.
 
float fnan ()
 
std::string __cdecl format (const char *fmt...) G3D_CHECK_PRINTF_ARGS
 Produces a string from arguments of the style of printf.
 
bool fuzzyEq (double a, double b)
 Note that fuzzyEq(a, b) && fuzzyEq(b, c) does not imply fuzzyEq(a, c), although that will be the case on some occasions.
 
bool fuzzyEq (float a, float b)
 
bool fuzzyGe (double a, double b)
 Is a near or greater than b?
 
bool fuzzyGt (double a, double b)
 Is a strictly greater than b? (Guaranteed false if a <= b).
 
bool fuzzyLe (double a, double b)
 Is a near or less than b?
 
bool fuzzyLt (double a, double b)
 Is a strictly less than b? (Guaranteed false if a >= b)
 
bool fuzzyNe (double a, double b)
 True if a is definitely not equal to b.
 
 G3D_BEGIN_PACKED_CLASS (2) Color2unorm8
 Matches OpenGL GL_RG8 format.
 
 G3D_BEGIN_PACKED_CLASS (1) Color1unorm8
 Represents a single-channel color on [0, 1] with G3D::unorm8 precision.
 
 G3D_BEGIN_PACKED_CLASS (4) Vector3int32
 \ Vector3int32 A Vector3 that packs its fields into uint32s.
 
 G3D_END_PACKED_CLASS (2) typedef Vector2int16 Point2int16
 
 G3D_END_PACKED_CLASS (4) typedef Vector3int32 Point3int32
 
int g3dfnmatch (const char *pattern, const char *string, int flags)
 Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
 
void gaussian1D (Array< float > &coeff, int N=5, float std=0.5f)
 Generates a set of 1D gaussian filter coefficients of size N.
 
float gaussRandom (float mean=0.0f, float stdev=1.0f)
 Normally distributed random number.
 
uint32 gcchtonl (uint32)
 
std::string generateFilenameBase (const std::string &prefix="", const std::string &suffix="")
 Creates a unique filename base in the current directory using the specified prefix and suffix.
 
std::string getOpenGLState (bool showDisabled=true)
 Returns all OpenGL state as a formatted string of C++ code that will reproduce that state.
 
void glClipToBox (const class AABox &box)
 Configure (and enable) OpenGL clipping planes to clip to the inside of this box.
 
void glColor (const G3D::Color3 &c)
 
void glColor (const G3D::Color4 &c)
 
void glColor (float r, float g, float b, float a)
 
void glColor (float r, float g, float b)
 
void glDisableAllClipping ()
 Turn off all OpenGL clipping planes.
 
void glDisableAllTextures ()
 Calls glDisable() for all supported texture types: 1D, 2D, 3D, cube, rectangle.
 
const char * GLenumToString (GLenum i)
 Pretty printer for GLenums.
 
GLboolean glGetBoolean (GLenum which)
 A functional version of glGetDoublev.
 
GLContext glGetCurrentContext ()
 Returns the current OpenGL context if more than one is in use.
 
GLdouble glGetDouble (GLenum which)
 A functional version of glGetDoublev.
 
void glGetErrors ()
 Read all errors off the OpenGL stack and ignore them.
 
GLfloat glGetFloat (GLenum which)
 A functional version of glGetFloatv.
 
GLint glGetInteger (GLenum which)
 A functional version of glGetIntegerv.
 
void glGetMatrix (GLenum name, Matrix4 &m)
 
Matrix4 glGetMatrix (GLenum name)
 
voidglGetProcAddress (const char *name)
 Platform independent version of wglGetProcAddress/glXGetProcAddress/NSGLGetProcAddress.
 
Vector2 glGetVector2 (GLenum which)
 Safe to call even if the glGet would return more than 2 values.
 
Vector3 glGetVector3 (GLenum which)
 
Vector4 glGetVector4 (GLenum which)
 
void glLoadInvMatrix (const CoordinateFrame &cf)
 Loads the inverse of a coordinate frame into the current OpenGL matrix slot.
 
void glLoadMatrix (const CoordinateFrame &cf)
 Loads a coordinate frame into the current OpenGL matrix slot.
 
void glLoadMatrix (const Matrix4 &m)
 
void glMakeCurrent (const GLContext &c)
 This is a platform-independent version of the function to set the current OpenGL context for a thread.
 
void glMultInvMatrix (const CoordinateFrame &cf)
 Multiplies the current GL matrix slot by the inverse of a matrix.
 
void glMultiTexCoord (GLint unit, float v)
 
void glMultiTexCoord (GLint unit, const G3D::Vector2 &v)
 
void glMultiTexCoord (GLint unit, const G3D::Vector2int16 &v)
 
void glMultiTexCoord (GLint unit, const G3D::Vector3 &v)
 
void glMultiTexCoord (GLint unit, const G3D::Vector3int16 &v)
 
void glMultiTexCoord (GLint unit, const G3D::Vector4 &v)
 
void glMultMatrix (const CoordinateFrame &cf)
 Multiplies the current GL matrix slot by this matrix.
 
void glNormal (const G3D::Vector3 &n)
 
void glTexCoord (const G3D::Vector4 &t)
 
void glTexCoord (const G3D::Vector3 &t)
 
void glTexCoord (const G3D::Vector2 &t)
 
void glTexCoord (const float t)
 
Vector4 glToScreen (const Vector4 &v)
 Takes an object space point to screen space using the current MODELVIEW and PROJECTION matrices.
 
void glVertex (const G3D::Vector2 &v)
 
void glVertex (const G3D::Vector2int16 &v)
 
void glVertex (const G3D::Vector3 &v)
 
void glVertex (const G3D::Vector3int16 &v)
 
void glVertex (const G3D::Vector4 &v)
 
double halfPi ()
 
int highestBit (uint32 x)
 Returnes the 0-based index of the highest 1 bit from the left.
 
int iAbs (int iValue)
 
int iCeil (double fValue)
 
int iClamp (int val, int low, int hi)
 Clamps the value to the range [low, hi] (inclusive)
 
int16 iClamp (int16 val, int16 low, int16 hi)
 
Vector3int32 iFloor (const Vector3 &)
 
int iFloor (double fValue)
 
int iMax (int x, int y)
 
int iMin (int x, int y)
 
int iMod3 (int x)
 Computes x % 3.
 
double inf ()
 This value should not be tested against directly, instead G3D::isNan() and G3D::isFinite() will return reliable results.
 
void initG3D ()
 Call from main() to initialize the G3D library state and register shutdown memory managers.
 
void initGLG3D ()
 Call from main() to initialize the GLG3D library state and register shutdown memory managers.
 
int iRandom (int low, int hi)
 Returns a random number uniformly at random between low and hi (inclusive).
 
int iRound (double fValue)
 Fast round to integer using the lrint routine.
 
int iRound (float f)
 Fast round to integer using the lrint routine.
 
bool isDigit (const unsigned char c)
 These standard C functions are renamed for clarity/naming conventions and to return bool, not int.
 
bool isEven (int num)
 
bool isFinite (double x)
 Returns true if the argument is a finite real number.
 
bool isFinite (float x)
 
int iSign (int iValue)
 
int iSign (double fValue)
 
int iSign (float f)
 
bool isLetter (const unsigned char c)
 These standard C functions are renamed for clarity/naming conventions and to return bool, not int.
 
bool isNaN (double x)
 Returns true if the argument is NaN (not a number).
 
bool isNaN (float x)
 
bool isNaN (int x)
 
bool isNaN (uint64 x)
 
bool isNewline (const unsigned char c)
 These standard C functions are renamed for clarity/naming conventions and to return bool, not int.
 
template<class T >
bool isNull (const shared_ptr< T > &ptr)
 
template<class T >
bool isNull (const T *ptr)
 
template<class T >
bool isNull (const Pointer< T > &p)
 
bool isOdd (int num)
 
bool isPow2 (int num)
 True if num is a power of two.
 
bool isPow2 (uint64 num)
 
bool isPow2 (uint32 x)
 
bool isQuote (const unsigned char c)
 
bool isSlash (const unsigned char c)
 
bool isValidHeapPointer (const void *x)
 Useful for debugging purposes.
 
bool isValidPointer (const void *x)
 Returns true if the pointer is likely to be a valid pointer (instead of an arbitrary number).
 
bool isWhiteSpace (const unsigned char c)
 These standard C functions are renamed for clarity/naming conventions and to return bool, not int.
 
int iWrap (int val, int hi)
 Wraps the value to the range [0, hi) (exclusive on the high end).
 
float length (float v)
 
float length (const Vector2 &v)
 
float length (const Vector3 &v)
 
float length (const Vector4 &v)
 
Vector2 lerp (const Vector2 &v1, const Vector2 &v2, float f)
 
Vector3 lerp (const Vector3 &v1, const Vector3 &v2, float f)
 
Vector4 lerp (const Vector4 &v1, const Vector4 &v2, float f)
 
Color1 lerp (const Color1 &v1, const Color1 &v2, float f)
 
Color3 lerp (const Color3 &v1, const Color3 &v2, float f)
 
Color4 lerp (const Color4 &v1, const Color4 &v2, float f)
 
double lerp (double a, double b, double f)
 Returns a + (b - a) * f;.
 
float lerp (float a, float b, float f)
 
std::string license ()
 G3D, SDL, and IJG libraries require license documentation to be distributed with your program.
 
template<class XType , class YType >
YType linearSpline (double x, const XType *controlX, const YType *controlY, int numControl)
 Interpolates a property according to a piecewise linear spline.
 
Color3 log (const Color3 &c)
 Computes the log of each component.
 
Quat log (const Quat &q)
 
double log2 (double x)
 
float log2 (float x)
 
double log2 (int x)
 
void logLazyPrintf (const char *fmt,...)
 Does not flush the buffer; follow up with a logPrintf to force the flush.
 
void logPrintf (const char *fmt,...)
 Prints to the common system log, log.txt, which is usually in the working directory of the program.
 
__inline long int lrint (double flt)
 
__inline long int lrintf (float flt)
 
Vector2 max (const Vector2 &v1, const Vector2 &v2)
 
Vector3 max (const Vector3 &v1, const Vector3 &v2)
 
Vector4 max (const Vector4 &v1, const Vector4 &v2)
 
Color3 max (const Color3 &v1, const Color3 &v2)
 
Color4 max (const Color4 &v1, const Color4 &v2)
 
template<class T >
max (const T &x, const T &y)
 
template<class T >
max (const T &x, const T &y, const T &z)
 
template<class T >
max (const T &x, const T &y, const T &z, const T &w)
 
size_t maxNotNPOS (size_t i, size_t j)
 Returns the larger string index, ignoring std::string::npos.
 
Vector2 min (const Vector2 &v1, const Vector2 &v2)
 
Vector3 min (const Vector3 &v1, const Vector3 &v2)
 
Vector4 min (const Vector4 &v1, const Vector4 &v2)
 
Color3 min (const Color3 &v1, const Color3 &v2)
 
Color4 min (const Color4 &v1, const Color4 &v2)
 
template<class T >
min (const T &x, const T &y)
 
template<class T >
min (const T &x, const T &y, const T &z)
 
template<class T >
min (const T &x, const T &y, const T &z, const T &w)
 
void msgBox (const std::string &message, const std::string &title="Message")
 Displays a GUI prompt with "Ok" as the only choice.
 
Matrix4 mul (const Matrix4 &a, const Matrix4 &b)
 
Vector4 mul (const Matrix4 &m, const Vector4 &v)
 
Vector3 mul (const Matrix3 &m, const Vector3 &v)
 
Matrix3 mul (const Matrix3 &a, const Matrix3 &b)
 
float mul (float a, float b)
 a * b (for DirectX/Cg support)
 
double nan ()
 This value should not be tested against directly, instead G3D::isNan() and G3D::isFinite() will return reliable results.
 
Vector2 normalize (const Vector2 &v)
 
Vector3 normalize (const Vector3 &v)
 
Vector4 normalize (const Vector4 &v)
 
float normalize (float v)
 v / v (for DirectX/Cg support)
 
template<class T >
bool notNull (const shared_ptr< T > &ptr)
 
template<class T >
bool notNull (const T *ptr)
 
template<class T >
bool notNull (const Pointer< T > &p)
 
bool operator!= (const NetAddress &a, const NetAddress &b)
 
Color4 operator* (const Color3 &c3, const Color4 &c4)
 Extends the c3 with alpha = 1.0.
 
G3D::Color3 operator* (float s, const G3D::Color3 &c)
 
Vector2 operator* (double s, const Vector2 &v)
 
G3D::Color3 operator* (G3D::Color1 &s, const G3D::Color3 &c)
 
Vector2 operator* (float s, const Vector2 &v)
 
G3D::Color3 operator* (const G3D::Color3 &c, G3D::Color1 &s)
 
Vector2 operator* (int s, const Vector2 &v)
 
Color4 operator* (float fScalar, const Color4 &other)
 
Vector3 operator* (const Vector3 &rkPoint, const Matrix3 &rkMatrix)
 v * M == M.transpose() * v
 
G3D::Vector3 operator* (float s, const G3D::Vector3 &v)
 
G3D::Vector3 operator* (double s, const G3D::Vector3 &v)
 
G3D::Vector3 operator* (int s, const G3D::Vector3 &v)
 
G3D::Quat operator* (double s, const G3D::Quat &q)
 
G3D::Quat operator* (float s, const G3D::Quat &q)
 
std::ostream & operator<< (std::ostream &os, const NetAddress &)
 
std::ostream & operator<< (std::ostream &os, const Vector3 &)
 
bool operator== (const NetAddress &a, const NetAddress &b)
 Two addresses may point to the same computer but be != because they have different IP's.
 
void parseCommaSeparated (const std::string s, Array< std::string > &array, bool stripQuotes=true)
 Separates a comma-separated line, properly escaping commas within double quotes (") and super quotes (""").
 
void parseFilename (const std::string &filename, std::string &drive, Array< std::string > &path, std::string &base, std::string &ext)
 Parses a filename into four useful pieces.
 
std::string pathConcat (const std::string &dirname, const std::string &file)
 Appends file onto dirname, ensuring a / if needed.
 
double pi ()
 
float pif ()
 
int pow2 (unsigned int x)
 Returns 2^x.
 
template<class T >
pow5 (T x)
 Returns x5
 
int prompt (const char *windowTitle, const char *promptx, const char **choice, int numChoices, bool useGui)
 Prints a prompt to stdout and waits for user input.
 
int prompt (const char *windowTitle, const char *promptx, const char **choice, int numChoices)
 Prints a prompt and waits for user input.
 
std::string readWholeFile (const std::string &filename)
 Returns the contents of a text file as a single string.
 
std::string replace (const std::string &s, const std::string &pattern, const std::string &replacement)
 Returns a string which is s, with all instances of pattern replaced.
 
double round (double f)
 
float round (float f)
 
float rsq (float x)
 Computes 1 / sqrt(x).
 
double rsqrt (double x)
 
float rsqrt (float x)
 
void screenPrintf (const char *fmt...) G3D_CHECK_PRINTF_ARGS
 Displays output on the last G3D::GApp instantiated.
 
void serialize (const std::string &s, BinaryOutput &b)
 
void serialize (const int32 &i, BinaryOutput &b)
 
void serialize (const uint32 &i, BinaryOutput &b)
 
void serialize (const bool &i, BinaryOutput &b)
 
void serialize (const float32 &f, BinaryOutput &b)
 
void serialize (const float64 &f, BinaryOutput &b)
 
template<typename T >
void serialize (const Array< T > &array, BinaryOutput &b)
 serialize(const T&, BinaryOutput&) must have been overridden as well
 
void serialize (const bool &b, TextOutput &to)
 
void serialize (const int &b, TextOutput &to)
 
void serialize (const uint8 &b, TextOutput &to)
 
void serialize (const double &b, TextOutput &to)
 
void serialize (const float &b, TextOutput &to)
 
void serialize (const std::string &b, TextOutput &to)
 
void serialize (const char *b, TextOutput &to)
 
void serialize (const Vector2 &v, class BinaryOutput &b)
 
void serialize (const Vector3::Axis &a, class BinaryOutput &bo)
 
void serialize (const Vector4 &v, class BinaryOutput &b)
 
void serialize (const Vector3 &v, class BinaryOutput &b)
 
void setAssertionHook (AssertionHook hook)
 Allows customization of the global function invoked when a debugAssert fails.
 
void setConsolePrintHook (ConsolePrintHook h)
 Called by consolePrintf after the log and terminal have been written to.
 
void setFailureHook (AssertionHook hook)
 Called by alwaysAssertM in case of failure in release mode.
 
Vector2 sign (const Vector2 &v)
 
Vector3 sign (const Vector3 &v)
 
Vector4 sign (const Vector4 &v)
 
double sign (double fValue)
 
float sign (float fValue)
 
double sinc (double x)
 sin(x)/x
 
int sizeOfGLFormat (GLenum format)
 Returns the number of bytes occupied by a value in an OpenGL format (e.g.
 
float smootherstep (float edge0, float edge1, float x)
 Perlin's C2 continous variation on smoothstep()
 
float smoothstep (float edge0, float edge1, float x)
 The GLSL smoothstep function.
 
double square (double fValue)
 
float square (float x)
 
int square (int x)
 
int stringCompare (const std::string &s1, const std::string &s2)
 A comparison function for passing to Array::sort.
 
std::string stringJoin (const G3D::Array< std::string > &a, char joinChar)
 joinChar is not inserted at the beginning or end, just in between elements.
 
std::string stringJoin (const G3D::Array< std::string > &a, const std::string &joinStr)
 
int stringPtrCompare (const std::string *s1, const std::string *s2)
 
G3D::Array< std::stringstringSplit (const std::string &x, char splitChar)
 Splits x at each occurance of splitChar.
 
double sumSquares (double x, double y)
 
double sumSquares (double x, double y, double z)
 
float sumSquares (float x, float y)
 
float sumSquares (float x, float y, float z)
 
uint32_t superFastHash (const void *_data, size_t numBytes)
 A hash function that is faster than CRC32 for arbitrary long strings.
 
void tesselateComplexPolygon (const Array< Vector3 > &input, Array< Triangle > &output)
 Tesselates a complex polygon into a triangle set which is appended to the output.
 
double toDegrees (double rad)
 
float toDegrees (float rad)
 
float toDegrees (int rad)
 
std::string toLower (const std::string &x)
 
double toRadians (double deg)
 
float toRadians (float deg)
 
float toRadians (int deg)
 
SimTime toSeconds (int hour, int minute, double seconds, AMPM ap)
 Converts a 12 hour clock time into the number of seconds since midnight.
 
SimTime toSeconds (int hour, int minute, AMPM ap)
 
std::string toUpper (const std::string &x)
 Returns a new string that is an uppercase version of x.
 
std::string trimWhitespace (const std::string &s)
 Strips whitespace from both ends of the string.
 
double twoPi ()
 
float uniformRandom (float low=0.0f, float hi=1.0f)
 Uniform random number between low and hi, inclusive.
 
std::string vformat (const char *fmt, va_list argPtr) G3D_CHECK_VPRINTF_ARGS
 Like format, but can be called with the argument list from a ...
 
uint32_t wangHash6432Shift (int64 key)
 Thomas Wang's 64-to-32-bit mix hash based on Robert Jenkin's hash http://www.concentric.net/~ttwang/tech/inthash.htm.
 
std::string wordWrap (const std::string &input, int numCols)
 Produces a new string that is the input string wrapped at a certain number of columns (where the line is broken at the latest space before the column limit.) Platform specific NEWLINEs are inserted to wrap.
 
float wrap (float t, float lo, float hi)
 Computes a floating point modulo; the result is t wrapped to the range [lo, hi).
 
double wrap (double t, double lo, double hi)
 
double wrap (double t, double hi)
 
void writeWholeFile (const std::string &filename, const std::string &str, bool flush=true)
 
bool zipfileExists (const std::string &filename, std::string &outZipfile, std::string &outInternalFile)
 Returns true if the given file (or directory) exists within a zipfile.
 
bool zipfileExists (const std::string &filename)
 

Variables

const uint32 DI8DEVCLASS_GAMECTRL = 4
 
const uint32 DIDF_ABSAXIS = 0x00000001
 
const uint32 DIDF_RELAXIS = 0x00000002
 
const uint32 DIDFT_ABSAXIS = 0x00000002
 
const uint32 DIDFT_ANYINSTANCE = 0x00FFFF00
 
const uint32 DIDFT_AXIS = 0x00000003
 
const uint32 DIDFT_BUTTON = 0x0000000C
 
const uint32 DIDFT_OPTIONAL = 0x80000000
 
const uint32 DIDFT_POV = 0x00000010
 
const uint32 DIDFT_RELAXIS = 0x00000001
 
const uint32 DIEDFL_ATTACHEDONLY = 0x00000001
 
const uint32 DIK_0 = 0x0B
 
const uint32 DIK_1 = 0x02
 
const uint32 DIK_2 = 0x03
 
const uint32 DIK_3 = 0x04
 
const uint32 DIK_4 = 0x05
 
const uint32 DIK_5 = 0x06
 
const uint32 DIK_6 = 0x07
 
const uint32 DIK_7 = 0x08
 
const uint32 DIK_8 = 0x09
 
const uint32 DIK_9 = 0x0A
 
const uint32 DIK_A = 0x1E
 
const uint32 DIK_ABNT_C1 = 0x73
 
const uint32 DIK_ABNT_C2 = 0x7E
 
const uint32 DIK_ADD = 0x4E
 
const uint32 DIK_APOSTROPHE = 0x28
 
const uint32 DIK_APPS = 0xDD
 
const uint32 DIK_AT = 0x91
 
const uint32 DIK_AX = 0x96
 
const uint32 DIK_B = 0x30
 
const uint32 DIK_BACK = 0x0E
 
const uint32 DIK_BACKSLASH = 0x2B
 
const uint32 DIK_C = 0x2E
 
const uint32 DIK_CALCULATOR = 0xA1
 
const uint32 DIK_CAPITAL = 0x3A
 
const uint32 DIK_COLON = 0x92
 
const uint32 DIK_COMMA = 0x33
 
const uint32 DIK_CONVERT = 0x79
 
const uint32 DIK_D = 0x20
 
const uint32 DIK_DECIMAL = 0x53
 
const uint32 DIK_DELETE = 0xD3
 
const uint32 DIK_DIVIDE = 0xB5
 
const uint32 DIK_DOWN = 0xD0
 
const uint32 DIK_E = 0x12
 
const uint32 DIK_END = 0xCF
 
const uint32 DIK_EQUALS = 0x0D
 
const uint32 DIK_ESCAPE = 0x01
 
const uint32 DIK_F = 0x21
 
const uint32 DIK_F1 = 0x3B
 
const uint32 DIK_F10 = 0x44
 
const uint32 DIK_F11 = 0x57
 
const uint32 DIK_F12 = 0x58
 
const uint32 DIK_F13 = 0x64
 
const uint32 DIK_F14 = 0x65
 
const uint32 DIK_F15 = 0x66
 
const uint32 DIK_F2 = 0x3C
 
const uint32 DIK_F3 = 0x3D
 
const uint32 DIK_F4 = 0x3E
 
const uint32 DIK_F5 = 0x3F
 
const uint32 DIK_F6 = 0x40
 
const uint32 DIK_F7 = 0x41
 
const uint32 DIK_F8 = 0x42
 
const uint32 DIK_F9 = 0x43
 
const uint32 DIK_G = 0x22
 
const uint32 DIK_GRAVE = 0x29
 
const uint32 DIK_H = 0x23
 
const uint32 DIK_HOME = 0xC7
 
const uint32 DIK_I = 0x17
 
const uint32 DIK_INSERT = 0xD2
 
const uint32 DIK_J = 0x24
 
const uint32 DIK_K = 0x25
 
const uint32 DIK_KANA = 0x70
 
const uint32 DIK_KANJI = 0x94
 
const uint32 DIK_L = 0x26
 
const uint32 DIK_LBRACKET = 0x1A
 
const uint32 DIK_LCONTROL = 0x1D
 
const uint32 DIK_LEFT = 0xCB
 
const uint32 DIK_LMENU = 0x38
 
const uint32 DIK_LSHIFT = 0x2A
 
const uint32 DIK_LWIN = 0xDB
 
const uint32 DIK_M = 0x32
 
const uint32 DIK_MAIL = 0xEC
 
const uint32 DIK_MEDIASELECT = 0xED
 
const uint32 DIK_MEDIASTOP = 0xA4
 
const uint32 DIK_MINUS = 0x0C
 
const uint32 DIK_MULTIPLY = 0x37
 
const uint32 DIK_MUTE = 0xA0
 
const uint32 DIK_MYCOMPUTER = 0xEB
 
const uint32 DIK_N = 0x31
 
const uint32 DIK_NEXT = 0xD1
 
const uint32 DIK_NEXTTRACK = 0x99
 
const uint32 DIK_NOCONVERT = 0x7B
 
const uint32 DIK_NUMLOCK = 0x45
 
const uint32 DIK_NUMPAD0 = 0x52
 
const uint32 DIK_NUMPAD1 = 0x4F
 
const uint32 DIK_NUMPAD2 = 0x50
 
const uint32 DIK_NUMPAD3 = 0x51
 
const uint32 DIK_NUMPAD4 = 0x4B
 
const uint32 DIK_NUMPAD5 = 0x4C
 
const uint32 DIK_NUMPAD6 = 0x4D
 
const uint32 DIK_NUMPAD7 = 0x47
 
const uint32 DIK_NUMPAD8 = 0x48
 
const uint32 DIK_NUMPAD9 = 0x49
 
const uint32 DIK_NUMPADCOMMA = 0xB3
 
const uint32 DIK_NUMPADENTER = 0x9C
 
const uint32 DIK_NUMPADEQUALS = 0x8D
 
const uint32 DIK_O = 0x18
 
const uint32 DIK_OEM_102 = 0x56
 
const uint32 DIK_P = 0x19
 
const uint32 DIK_PAUSE = 0xC5
 
const uint32 DIK_PERIOD = 0x34
 
const uint32 DIK_PLAYPAUSE = 0xA2
 
const uint32 DIK_POWER = 0xDE
 
const uint32 DIK_PREVTRACK = 0x90
 
const uint32 DIK_PRIOR = 0xC9
 
const uint32 DIK_Q = 0x10
 
const uint32 DIK_R = 0x13
 
const uint32 DIK_RBRACKET = 0x1B
 
const uint32 DIK_RCONTROL = 0x9D
 
const uint32 DIK_RETURN = 0x1C
 
const uint32 DIK_RIGHT = 0xCD
 
const uint32 DIK_RMENU = 0xB8
 
const uint32 DIK_RSHIFT = 0x36
 
const uint32 DIK_RWIN = 0xDC
 
const uint32 DIK_S = 0x1F
 
const uint32 DIK_SCROLL = 0x46
 
const uint32 DIK_SEMICOLON = 0x27
 
const uint32 DIK_SLASH = 0x35
 
const uint32 DIK_SLEEP = 0xDF
 
const uint32 DIK_SPACE = 0x39
 
const uint32 DIK_STOP = 0x95
 
const uint32 DIK_SUBTRACT = 0x4A
 
const uint32 DIK_SYSRQ = 0xB7
 
const uint32 DIK_T = 0x14
 
const uint32 DIK_TAB = 0x0F
 
const uint32 DIK_U = 0x16
 
const uint32 DIK_UNDERLINE = 0x93
 
const uint32 DIK_UNLABELED = 0x97
 
const uint32 DIK_UP = 0xC8
 
const uint32 DIK_V = 0x2F
 
const uint32 DIK_VOLUMEDOWN = 0xAE
 
const uint32 DIK_VOLUMEUP = 0xB0
 
const uint32 DIK_W = 0x11
 
const uint32 DIK_WAKE = 0xE3
 
const uint32 DIK_WEBBACK = 0xEA
 
const uint32 DIK_WEBFAVORITES = 0xE6
 
const uint32 DIK_WEBFORWARD = 0xE9
 
const uint32 DIK_WEBHOME = 0xB2
 
const uint32 DIK_WEBREFRESH = 0xE7
 
const uint32 DIK_WEBSEARCH = 0xE5
 
const uint32 DIK_WEBSTOP = 0xE8
 
const uint32 DIK_X = 0x2D
 
const uint32 DIK_Y = 0x15
 
const uint32 DIK_YEN = 0x7D
 
const uint32 DIK_Z = 0x2C
 
const uint32 DIPH_BYID = 2
 
const uint32 DIPH_BYOFFSET = 1
 
const uint32 DIPH_BYUSAGE = 3
 
const uint32 DIPH_DEVICE = 0
 
const uint32 DIRECTINPUT_VERSION = 0x0800
 
const uint32 DISCL_BACKGROUND = 0x00000008
 
const uint32 DISCL_EXCLUSIVE = 0x00000001
 
const uint32 DISCL_FOREGROUND = 0x00000004
 
const uint32 DISCL_NONEXCLUSIVE = 0x00000002
 
const uint32 DISCL_NOWINKEY = 0x00000010
 
const bool DONT_SHRINK_UNDERLYING_ARRAY = false
 Constant for passing to Array::resize.
 
const DIDATAFORMAT G3DJOYDF
 
const DIDATAFORMAT G3DKEYDF
 
bool ignoreBool
 
DIOBJECTDATAFORMAT keyodf []
 
typedef LPVOID
 
const char * NEWLINE
 
const uint32 numJoyObjects = (sizeof(rgodf) / sizeof(rgodf[0]))
 
const uint32 numKeyObjects = (sizeof(keyodf) / sizeof(keyodf[0]))
 
HDC OpenGLWindowHDC
 The HDC that wglMakeCurrent will use on Windows.
 
DIOBJECTDATAFORMAT rgodf []
 
bool sdlAlreadyInitialized
 
const int SORT_DECREASING = -1
 Constant for Array::sort.
 
const int SORT_INCREASING = 1
 Constant for Array::sort.
 
const uint32 VK_APOSTROPHE = 0xDE
 
const uint32 VK_BACKSLASH = 0xDC
 
const uint32 VK_BACKTICK = 0xDF
 
const uint32 VK_COMMA = 0xBC
 
const uint32 VK_EQUALS = 0xBB
 
const uint32 VK_GRAVE = 0xC0
 
const uint32 VK_LBRACKET = 0xDB
 
const uint32 VK_MINUS = 0xBD
 
const uint32 VK_PERIOD = 0xBE
 
const uint32 VK_RBRACKET = 0xDD
 
const uint32 VK_SEMICOLON = 0xBA
 
const uint32 VK_SLASH = 0xBF
 

Typedef Documentation

typedef bool(* G3D::AssertionHook)(const char *_expression, const std::string &message, const char *filename, int lineNumber, bool useGuiPrompt)

Radiance * measure(Solid Angle) between two points, measured at the receiver orthogonal to the axis between them; W/m^2.

typedef void(* G3D::ConsolePrintHook)(const std::string &)
typedef int G3D::DebugID

Used with debugDraw.

Force * distance; J.

typedef shared_ptr<class FileDialog> G3D::FileDialogRef
typedef float G3D::float32
typedef double G3D::float64
typedef double G3D::GameTime

Time, in seconds.

typedef shared_ptr<class GConsole> G3D::GConsoleRef

OpenGL context (argument to glMakeCurrent, return value of glGetCurrentContext).

typedef shared_ptr<class GThread> G3D::GThreadRef
typedef shared_ptr<class GuiTheme> G3D::GuiThemeRef
typedef shared_ptr<class GuiWindow> G3D::GuiWindowRef
typedef shared_ptr<class Image1> G3D::Image1Ref
typedef shared_ptr<class Image1unorm8> G3D::Image1unorm8Ref
typedef shared_ptr<class Image3> G3D::Image3Ref
typedef shared_ptr<class Image3unorm8> G3D::Image3unorm8Ref
typedef shared_ptr<class Image4> G3D::Image4Ref
typedef shared_ptr<class Image4unorm8> G3D::Image4unorm8Ref
typedef int16_t G3D::int16
typedef int32_t G3D::int32
typedef int64_t G3D::int64
typedef int8_t G3D::int8

Incident power per area; W/m^2.

typedef struct G3D::DIDEVCAPS * G3D::LPDIDEVCAPS
typedef struct IDirectInputDevice8A* G3D::LPDIRECTINPUTDEVICE8A
typedef shared_ptr<class NetListener> G3D::NetListenerRef

Points are technically distinct mathematical entities from vectors.

Actually distinguishing them at the class level tends to add lots of boilerplate (e.g., (P - Point3::zero()).direction() vs. P.direction()), so many programmers prefer use a single class, as GLSL does.

G3D provides this typedef as a way of documenting arguments that are locations in space and not directions. Beware that points and vectors are interchangable from the compiler's point of view, and that the programmer must track which is really which.

Energy per time; W.

Power per (measure(SolidAngle) * measure(Area)); W / (m^2 sr)

Power per area; J / m^2.

typedef double G3D::RealTime

Actual wall clock time in seconds.

typedef shared_ptr<class ReliableConduit> G3D::ReliableConduitRef
typedef shared_ptr<Renderbuffer> G3D::RenderbufferRef
typedef shared_ptr<class Shape> G3D::ShapeRef
typedef double G3D::SimTime

Because it is hard to remember the proper capitalization.

typedef shared_ptr<class Surface2D> G3D::Surface2DRef
typedef uint16_t G3D::uint16
typedef uint32_t G3D::uint32
typedef uint64_t G3D::uint64
typedef uint8_t G3D::uint8

Enumeration Type Documentation

anonymous enum

General keyboard/mouse state definitions.

Deprecated:
Use GButtonState
Enumerator:
SDL_PRESSED 
SDL_RELEASED 
anonymous enum
Deprecated:
use GKeyMod
Enumerator:
GKEYMOD_NONE 
GKEYMOD_LSHIFT 
GKEYMOD_RSHIFT 
GKEYMOD_LCTRL 
GKEYMOD_RCTRL 
GKEYMOD_LALT 
GKEYMOD_RALT 
GKEYMOD_LMETA 
GKEYMOD_RMETA 
GKEYMOD_NUM 
GKEYMOD_CAPS 
GKEYMOD_MODE 
GKEYMOD_RESERVED 
anonymous enum
Deprecated:
Enumerator:
SECOND 
MINUTE 
HOUR 
DAY 
SUNRISE 
SUNSET 
MIDNIGHT 
METER 
KILOMETER 
enum G3D::AMPM
Enumerator:
AM 
PM 

Some values like float16 and int128 have no current CPU data structure that implements them but are useful for file formats and for GPUs.

CHUNK_BINFMT data follows the protocol.

Enumerator:
FIRST_BINFMT 
BOOL8_BINFMT 
UINT8_BINFMT 
INT8_BINFMT 
UINT16_BINFMT 
INT16_BINFMT 
UINT32_BINFMT 
INT32_BINFMT 
UINT64_BINFMT 
INT64_BINFMT 
UINT128_BINFMT 
INT128_BINFMT 
FLOAT16_BINFMT 
FLOAT32_BINFMT 
FLOAT64_BINFMT 
VECTOR2_BINFMT 
VECTOR2INT16_BINFMT 
VECTOR3_BINFMT 
VECTOR3INT16_BINFMT 
VECTOR4_BINFMT 
VECTOR4INT16_BINFMT 
COLOR3_BINFMT 
COLOR3UINT8_BINFMT 
COLOR3INT16_BINFMT 
COLOR4_BINFMT 
COLOR4UINT8_BINFMT 
COLOR4INT16_BINFMT 
STRING_BINFMT 
STRINGEVEN_BINFMT 
STRING8_BINFMT 
STRING16_BINFMT 
STRING32_BINFMT 
CHUNK_BINFMT 
CUSTOM_BINFMT 
LAST_BINFMT 

The order in which the bytes of an integer are stored on a machine.

Intel/AMD chips tend to be G3D_LITTLE_ENDIAN, Mac PPC's and Suns are G3D_BIG_ENDIAN. However, this is primarily used to specify the byte order of file formats, which are fixed.

Enumerator:
G3D_BIG_ENDIAN 
G3D_LITTLE_ENDIAN 

Used by Component.

Enumerator:
MOVE_TO_CPU 

Ensure that all image data is stored exclusively on the CPU.

MOVE_TO_GPU 

Ensure that all image data is stored exclusively on the GPU.

COPY_TO_CPU 

Ensure that all image data is stored at least on the CPU.

COPY_TO_GPU 

Ensure that all image data is stored at least on the GPU.

IMAGE_STORAGE_CURRENT 

Do not change image storage.

Enumerator:
USE_NEW_THREAD 
USE_CURRENT_THREAD 

Function Documentation

template<class Class >
void G3D::_internal_runConcurrently2DHelper ( const Vector2int32 start,
const Vector2int32 upTo,
Class *  object,
void(Class::*)(int x, int y method1,
void(Class::*)(int x, int y, int threadID)  method2,
int  maxThreads 
)
Vector2 G3D::abs ( const Vector2 &  v)
inline
Vector3 G3D::abs ( const Vector3 &  v)
inline
Vector4 G3D::abs ( const Vector4 &  v)
inline
double G3D::abs ( double  fValue)
inline
double G3D::aCos ( double  fValue)
inline
float G3D::acos ( float  fValue)
inline

Referenced by aCos().

bool G3D::all ( const Vector2 &  v)
inline
bool G3D::all ( const Vector3 &  v)
inline
bool G3D::all ( const Vector4 &  v)
inline
bool G3D::all ( float  x)
inline

Returns true if x is not exactly equal to 0.0f.

Referenced by G3D::ArticulatedModel::forEachMesh().

bool G3D::any ( const Vector2 &  v)
inline
bool G3D::any ( const Vector3 &  v)
inline
bool G3D::any ( const Vector4 &  v)
inline
bool G3D::any ( float  x)
inline

Returns true if x is not exactly equal to 0.0f.

Referenced by G3D_BEGIN_PACKED_CLASS().

double G3D::aSin ( double  fValue)
inline
AssertionHook G3D::assertionHook ( )
double G3D::aTan ( double  fValue)
inline
double G3D::aTan2 ( double  fY,
double  fX 
)
inline
bool G3D::beginsWith ( const std::string test,
const std::string pattern 
)

Returns true if the test string begins with the pattern string.

typedef G3D::BOOL ( FAR PASCAL *  LPDIENUMDEVICESCALLBACKA)
int32 G3D::byteSize ( BinaryFormat  f)

Returns -1 if the format is custom, otherwise the byte size of a single element in this format.

Referenced by G3D::_internal::_BinaryFormat< Color4uint8 >::x().

template<class PointerType >
void G3D::categorizeByDerivedType ( const Array< PointerType > &  all,
Array< Array< PointerType > > &  derivedArray 
)

Separates a large array into subarrays by their typeid().

Example:

Array<shared_ptr<Surface> > all = ...;
Array< Array<shared_ptr<Surface> > > derivedArray;
categorizeByDerivedType<shared_ptr<Surface> >(all, derivedArray);
int G3D::ceilPow2 ( unsigned int  in)
inline

Return the next power of 2 higher than the input If the input is already a power of 2, the output will be the same as the input.

Vector2 G3D::clamp ( const Vector2 &  v,
const Vector2 &  a,
const Vector2 &  b 
)
inline
Vector3 G3D::clamp ( const Vector3 &  v,
const Vector3 &  a,
const Vector3 &  b 
)
inline
Vector4 G3D::clamp ( const Vector4 &  v,
const Vector4 &  a,
const Vector4 &  b 
)
inline
double G3D::clamp ( double  val,
double  low,
double  hi 
)
inline
float G3D::clamp ( float  val,
float  low,
float  hi 
)
inline
std::string G3D::consolePrint ( const std::string )
std::string __cdecl G3D::consolePrintf ( const char *  fmt...)

Sends output to the log and to the last GConsole instantiated.

Guarantees that the output has been flushed by the time the routine returns.

See Also
G3D::logPrintf, G3D::screenPrintf
Returns
The string that was printed
ConsolePrintHook G3D::consolePrintHook ( )
template<class T >
bool G3D::contains ( const T *  array,
int  len,
const T &  e 
)
FILE* G3D::createTempFile ( )

Returns a temporary file that is open for read/write access.

This tries harder than the ANSI tmpfile, so it may succeed when that fails.

Vector3 G3D::cross ( const Vector3 &  v1,
const Vector3 &  v2 
)
inline
template<class YType >
YType G3D::cyclicCatmullRomSpline ( double  t,
const YType *  controlY,
int  numPoints 
)

See also G3D::Spline.

Referenced by cyclicCatmullRomSpline().

template<class YType >
YType G3D::cyclicCatmullRomSpline ( double  t,
const Array< YType > &  controlY 
)

A cubic spline with regularly spaced control points.

The spline interpolates the control points. The spline will wrap from the last point back to the first.

The t parameter is on the range [0, controlY.size()], where integers correspond to control points exactly.

See also G3D::Spline

Referenced Code:
http://www.mvps.org/directx/articles/catmull/
DebugID G3D::debugDraw ( const Shape::Ref &  shape,
float  displayTime = 0.0f,
const Color4 &  solidColor = Color3::white(),
const Color4 &  wireColor = Color3::black(),
const CoordinateFrame &  cframe = CoordinateFrame() 
)

Schedule a G3D::Shape for later rendering.

Adds this shape and the specified information to the current G3D::GApp::debugShapeArray, to be rendered at runtime for debugging purposes.

Sample usage is:

debugDraw(new SphereShape(Sphere(center, radius)));
BETA API Likely to receive incompatible changes in future releases.
Parameters
displayTimeReal-world time in seconds to display the shape for. A shape always displays for at least one frame. 0 = one frame. inf() = until explicitly removed by the GApp.
Returns
The ID of the shape, which can be used to clear it for shapes that are displayed "infinitely".
See Also
debugPrintf, logPrintf, screenPrintf, GApp::drawDebugShapes, GApp::removeDebugShape, GApp::removeAllDebugShapes
std::string G3D::debugPrint ( const std::string )
std::string __cdecl G3D::debugPrintf ( const char *  fmt...)

Under visual studio, appears in the VS debug pane.

On unix-based operating systems the output is sent to stderr.

Also sends output to the console (G3D::consolePrintf) if there is a consolePrintHook, and log (G3D::logPrintf), and flushes before returning.

Returns
The string that was printed

Referenced by G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::debugPrintStatistics(), G3D::FastPointHashGrid< Value, PosFunc >::debugPrintStatistics(), G3D::FastPODTable< Key, Value, HashFunc, EqualsFunc, valueIsSimplePOD >::debugPrintStatus(), G3D::Table< std::string, DependencyList >::debugPrintStatus(), and Load3DS::processTriMeshChunk().

G3D::DECLARE_INTERFACE_ ( IDirectInputDevice8A  ,
IUnknown   
)
G3D::DECLARE_INTERFACE_ ( IDirectInput8A  ,
IUnknown   
)
G3D::DEFINE_GUID ( IID_IDirectInput8A  ,
0xBF798030  ,
0x483A  ,
0x4DA2  ,
0xAA  ,
0x99  ,
0x5D  ,
0x64  ,
0xED  ,
0x36  ,
0x97  ,
0x00   
)
G3D::DEFINE_GUID ( IID_IDirectInputDevice8A  ,
0x54D41080  ,
0xDC15  ,
0x4833  ,
0xA4  ,
0x1B  ,
0x74  ,
0x8F  ,
0x73  ,
0xA3  ,
0x81  ,
0x79   
)
G3D::DEFINE_GUID ( GUID_Joystick  ,
0x6F1D2B70  ,
0xD5A0  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_SysKeyboard  ,
0x6F1D2B61  ,
0xD5A0  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_XAxis  ,
0xA36D02E0  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_YAxis  ,
0xA36D02E1  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_ZAxis  ,
0xA36D02E2  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_RxAxis  ,
0xA36D02F4  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_RyAxis  ,
0xA36D02F5  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_RzAxis  ,
0xA36D02E3  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_Slider  ,
0xA36D02E4  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_Button  ,
0xA36D02F0  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_Key  ,
0x55728220  ,
0xD33C  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
G3D::DEFINE_GUID ( GUID_POV  ,
0xA36D02F2  ,
0xC9F3  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
std::string G3D::demoFindData ( bool  errorIfNotFound = true)

Routine used by the demos to find the data.

Searches in ../data, ../../data, etc. up to 5 levels back. Checks common locations like

c:\libraries\g3d-<version>\data 

and some hard-coded paths on the Brown University file system.

Deprecated:
void G3D::describeSystem ( class RenderDevice *  rd,
class NetworkDevice *  nd,
class TextOutput &  t 
)

Prints a human-readable description of this machine to the text output stream.

Either argument may be NULL.

void G3D::describeSystem ( class RenderDevice *  rd,
class NetworkDevice *  nd,
std::string s 
)
void G3D::deserialize ( std::string s,
BinaryInput &  b 
)
inline
void G3D::deserialize ( int32 &  i,
BinaryInput &  b 
)
inline
void G3D::deserialize ( uint32 &  i,
BinaryInput &  b 
)
inline
void G3D::deserialize ( bool &  i,
BinaryInput &  b 
)
inline
void G3D::deserialize ( float32 &  f,
BinaryInput &  b 
)
inline
void G3D::deserialize ( float64 &  f,
BinaryInput &  b 
)
inline
template<typename T >
void G3D::deserialize ( Array< T > &  array,
BinaryInput &  b 
)
void G3D::deserialize ( Vector2 &  v,
class BinaryInput &  b 
)
void G3D::deserialize ( Vector3::Axis &  a,
class BinaryInput &  bo 
)
void G3D::deserialize ( Vector4 &  v,
class BinaryInput &  b 
)
void G3D::deserialize ( Vector3 &  v,
class BinaryInput &  b 
)
void G3D::deserialize ( bool &  b,
TextInput &  ti 
)
void G3D::deserialize ( int b,
TextInput &  ti 
)
void G3D::deserialize ( uint8 &  b,
TextInput &  ti 
)
void G3D::deserialize ( double &  b,
TextInput &  ti 
)
void G3D::deserialize ( float &  b,
TextInput &  ti 
)
void G3D::deserialize ( std::string b,
TextInput &  ti 
)
double G3D::determinant ( const Matrix3 &  m)
inline
double G3D::determinant ( const Matrix4 &  m)
inline
double G3D::distance ( double  x,
double  y 
)
inline
double G3D::distance ( double  x,
double  y,
double  z 
)
inline
float G3D::distance ( float  x,
float  y 
)
inline
float G3D::distance ( float  x,
float  y,
float  z 
)
inline
float G3D::dot ( const Vector2 &  a,
const Vector2 &  b 
)
inline
float G3D::dot ( const Vector3 &  a,
const Vector3 &  b 
)
inline
float G3D::dot ( const Vector4 &  a,
const Vector4 &  b 
)
inline
float G3D::dot ( float  a,
float  b 
)
inline

a * b (for DirectX/Cg support)

double __fastcall G3D::drand48 ( )
inline
bool G3D::endsWith ( const std::string test,
const std::string pattern 
)

Returns true if the test string ends with the pattern string.

double G3D::eps ( double  a,
double  b 
)
inline

Computes an appropriate epsilon for comparing a and b.

Referenced by fuzzyEq(), fuzzyGe(), fuzzyGt(), fuzzyLe(), and fuzzyLt().

float G3D::eps ( float  a,
float  b 
)
inline
Quat G3D::exp ( const Quat &  q)
inline
double G3D::exp2 ( double  x)
inline

2^x

float G3D::exp2 ( float  x)
inline
AssertionHook G3D::failureHook ( )
std::string G3D::filenameBase ( const std::string filename)

Returns the portion of a filename to the left of the last period and to the right of the last slash or colon.

std::string G3D::filenameBaseExt ( const std::string filename)

Returns the part of the filename that includes the base and ext from parseFilename (i.e.

everything to the right of the path).

bool G3D::filenameContainsWildcards ( const std::string filename)

Returns true if '*' or '?' appears in the string.

std::string G3D::filenameExt ( const std::string filename)

Returns the extension on a filename.

std::string G3D::filenamePath ( const std::string filename)

Returns the drive (if Win32) and path from a filename, including a slash if there was one.

filenamePath(f) + filenameBaseExt(f) == f

size_t G3D::findLastSlash ( const std::string f,
size_t  start = std::string::npos 
)
inline

Finds the index of the first '\' or '/' character, starting at index start (if start is -1, starts at the end of the string).

See Also
G3D::findSlash, G3D::isSlash
size_t G3D::findSlash ( const std::string f,
size_t  start = 0 
)
inline

Finds the index of the first '\' or '/' character, starting at index start.

See Also
G3D::findLastSlash, G3D::isSlash
float G3D::finf ( )
uint16 G3D::flipEndian16 ( const uint16  x)
inline

Given a 16-bit integer, returns the integer with the bytes in the opposite order.

uint32 G3D::flipEndian32 ( const uint32  x)
inline

Given a 32-bit integer, returns the integer with the bytes in the opposite order.

float G3D::fnan ( )
std::string __cdecl G3D::format ( const char *  fmt...)

Produces a string from arguments of the style of printf.

This avoids problems with buffer overflows when using sprintf and makes it easy to use the result functionally. This function is fast when the resulting string is under 160 characters (not including terminator) and slower when the string is longer.

Referenced by G3D::FastPODTable< Key, Value, HashFunc, EqualsFunc, valueIsSimplePOD >::debugCheckStatus(), G3D::Image::get(), G3D::Any::IndexOutOfBounds::IndexOutOfBounds(), G3D::Array< PreprocessedShaderSource >::operator[](), G3D::GuiNumberBox< int >::precision(), Load3DS::read3DSColor(), Load3DS::read3DSPct(), G3D::Image::set(), G3D::Map2D< Color1, Color1 >::slowGet(), G3D::GuiNumberBox< int >::updateText(), and G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::verifyNode().

bool G3D::fuzzyEq ( double  a,
double  b 
)
inline
bool G3D::fuzzyEq ( float  a,
float  b 
)
inline
bool G3D::fuzzyGe ( double  a,
double  b 
)
inline

Is a near or greater than b?

bool G3D::fuzzyGt ( double  a,
double  b 
)
inline

Is a strictly greater than b? (Guaranteed false if a <= b).

(Possibly false if a > b)

bool G3D::fuzzyLe ( double  a,
double  b 
)
inline

Is a near or less than b?

bool G3D::fuzzyLt ( double  a,
double  b 
)
inline

Is a strictly less than b? (Guaranteed false if a >= b)

bool G3D::fuzzyNe ( double  a,
double  b 
)
inline

True if a is definitely not equal to b.

Guaranteed false if a == b. Possibly false when a != b.

Referenced by G3D::Vector2::fuzzyNe(), G3D::Vector3::fuzzyNe(), G3D::Color4::fuzzyNe(), and G3D::Color3::fuzzyNe().

G3D::G3D_BEGIN_PACKED_CLASS ( )

Matches OpenGL GL_RG8 format.

Can be used to accessdata in GL_RA8 or GL_LA8 format as well.

G3D::G3D_BEGIN_PACKED_CLASS ( )

Represents a single-channel color on [0, 1] with G3D::unorm8 precision.

Represents numbers on [0, 1] in 8 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL.

Represents numbers on [0, 1] in 8 bits as a signed normalized 0.8 fixed-point value using the same encoding scheme as OpenGL.

Represents numbers on [0, 1] in 16 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL.

Represents a Color4 as a packed integer.

Represents a Color3 as a packed integer.

Equivalent to OpenGL GL_R8, GL_A8, and GL_L8 formats.

Convenient for creating unsigned int vertex arrays. Used by G3D::GImage as the underlying format.

WARNING: Integer color formats are different than integer vertex formats. The color channels are automatically scaled by 255 (because OpenGL automatically scales integer colors back by this factor). So Color3(1,1,1) == Color3unorm8(255,255,255) but Vector3(1,1,1) == Vector3int16(1,1,1).

Convenient for creating unsigned int vertex arrays. Used by G3D::GImage as the underlying format.

Note that arithmetic operations may over and under-flow, just like int16 arithmetic.

OpenGL specifications can be found here: <www.opengl.org/registry/specs/ARB/shading_language_packing.txt>

Note that arithmetic operations may over and under-flow, just like uint8 arithmetic.

OpenGL specifications can be found here: <www.opengl.org/registry/specs/ARB/shading_language_packing.txt>

Note that arithmetic operations may over and under-flow, just like uint16 arithmetic.

OpenGL specifications can be found here: http://www.opengl.org/registry/specs/ARB/shading_language_packing.txt

OpenGL specifications can be found here: <www.opengl.org/registry/specs/ARB/shading_language_packing.txt>

Note that arithmetic operations may over and under-flow, just like uint8 arithmetic.

G3D::G3D_BEGIN_PACKED_CLASS ( )

\ Vector3int32 A Vector3 that packs its fields into uint32s.

G3D::G3D_END_PACKED_CLASS ( )
G3D::G3D_END_PACKED_CLASS ( )
int G3D::g3dfnmatch ( const char *  pattern,
const char *  string,
int  flags 
)

Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.

Compares a filename or pathname to a pattern.

The fnmatch() function checks whether the string argument matches the pattern argument, which is a shell wildcard pattern. The flags argument modifies the behaviour; it is the bitwise OR of zero or more of the following flags:

  • FNM_NOESCAPE If this flag is set, treat backslash as an ordinary character, instead of an escape character.
  • FNM_PATHNAME If this flag is set, match a slash in string only with a slash in pattern and not by an asterisk (*) or a question mark (?) metacharacter, nor by a bracket expression ([]) containing a slash.
  • FNM_PERIOD If this flag is set, a leading period in string has to be matched exactly by a period in pattern. A period is considered to be leading if it is the first character in string, or if both FNM_PATHNAME is set and the period immediately follows a slash.
  • FNM_FILE_NAME This is a GNU synonym for FNM_PATHNAME.
  • FNM_LEADING_DIR If this flag (a GNU extension) is set, the pattern is considered to be matched if it matches an initial segment of string which is followed by a slash. This flag is mainly for the internal use of glibc and is only implemented in certain cases.
  • FNM_CASEFOLD If this flag (a GNU extension) is set, the pattern is matched case-insensitively.
Returns
Zero if string matches pattern, FNM_NOMATCH if there is no match or another non-zero value if there is an error
void G3D::gaussian1D ( Array< float > &  coeff,
int  N = 5,
float  std = 0.5f 
)

Generates a set of 1D gaussian filter coefficients of size N.

The coefficients are centered on element (N-1)/2 and have standard deviation given by std. The coefficients are normalized such that the sum across coeff is 1.0.

Matches the results returned by Matlab fspecial('gaussian', [1, N], std)

float G3D::gaussRandom ( float  mean = 0.0f,
float  stdev = 1.0f 
)

Normally distributed random number.

Deprecated:
See Also
Random::gaussian
uint32 G3D::gcchtonl ( uint32  x)
inline
std::string G3D::generateFilenameBase ( const std::string prefix = "",
const std::string suffix = "" 
)

Creates a unique filename base in the current directory using the specified prefix and suffix.

std::string G3D::getOpenGLState ( bool  showDisabled = true)

Returns all OpenGL state as a formatted string of C++ code that will reproduce that state.

Leaves all OpenGL state in exactly the same way it found it. Use this for debugging when OpenGL doesn't seem to be in the same state that you think it is in.

A common idiom is: {std::string s = getOpenGLState(false); debugPrintf("%s", s.c_str();}

Parameters
showDisabledif false, state that is not affecting rendering is not shown (e.g. if lighting is off, lighting information is not shown).
void G3D::glClipToBox ( const class AABox &  box)

Configure (and enable) OpenGL clipping planes to clip to the inside of this box.

Uses the current object-to-world and camera transformation to position the box. The box then stays fixed at that position in camera space.

void G3D::glColor ( const G3D::Color3 c)
inline
void G3D::glColor ( const G3D::Color4 c)
inline
void G3D::glColor ( float  r,
float  g,
float  b,
float  a 
)
inline
void G3D::glColor ( float  r,
float  g,
float  b 
)
inline
void G3D::glDisableAllClipping ( )

Turn off all OpenGL clipping planes.

void G3D::glDisableAllTextures ( )

Calls glDisable() for all supported texture types: 1D, 2D, 3D, cube, rectangle.

const char* G3D::GLenumToString ( GLenum  i)

Pretty printer for GLenums.

Useful for debugging OpenGL code.

GLboolean G3D::glGetBoolean ( GLenum  which)

A functional version of glGetDoublev.

GLContext G3D::glGetCurrentContext ( )
inline

Returns the current OpenGL context if more than one is in use.

BETA API– subject to change

GLdouble G3D::glGetDouble ( GLenum  which)

A functional version of glGetDoublev.

void G3D::glGetErrors ( )
inline

Read all errors off the OpenGL stack and ignore them.

GLfloat G3D::glGetFloat ( GLenum  which)

A functional version of glGetFloatv.

GLint G3D::glGetInteger ( GLenum  which)

A functional version of glGetIntegerv.

void G3D::glGetMatrix ( GLenum  name,
Matrix4 &  m 
)
Matrix4 G3D::glGetMatrix ( GLenum  name)
void* G3D::glGetProcAddress ( const char *  name)

Platform independent version of wglGetProcAddress/glXGetProcAddress/NSGLGetProcAddress.

Vector2 G3D::glGetVector2 ( GLenum  which)

Safe to call even if the glGet would return more than 2 values.

Vector3 G3D::glGetVector3 ( GLenum  which)
Vector4 G3D::glGetVector4 ( GLenum  which)
void G3D::glLoadInvMatrix ( const CoordinateFrame &  cf)

Loads the inverse of a coordinate frame into the current OpenGL matrix slot.

void G3D::glLoadMatrix ( const CoordinateFrame &  cf)

Loads a coordinate frame into the current OpenGL matrix slot.

void G3D::glLoadMatrix ( const Matrix4 &  m)
void G3D::glMakeCurrent ( const GLContext &  c)
inline

This is a platform-independent version of the function to set the current OpenGL context for a thread.

void G3D::glMultInvMatrix ( const CoordinateFrame &  cf)

Multiplies the current GL matrix slot by the inverse of a matrix.

void G3D::glMultiTexCoord ( GLint  unit,
float  v 
)
inline

Referenced by glMultiTexCoord().

void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector2 v 
)
inline
void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector2int16 &  v 
)
inline
void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector3 v 
)
inline
void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector3int16 &  v 
)
inline
void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector4 v 
)
inline
void G3D::glMultMatrix ( const CoordinateFrame &  cf)

Multiplies the current GL matrix slot by this matrix.

void G3D::glNormal ( const G3D::Vector3 n)
inline
void G3D::glTexCoord ( const G3D::Vector4 t)
inline
void G3D::glTexCoord ( const G3D::Vector3 t)
inline
void G3D::glTexCoord ( const G3D::Vector2 t)
inline
void G3D::glTexCoord ( const float  t)
inline
Vector4 G3D::glToScreen ( const Vector4 &  v)

Takes an object space point to screen space using the current MODELVIEW and PROJECTION matrices.

The resulting xy values are in pixels, the z value is on the glDepthRange scale, and the w value contains rhw (-1/z for camera space z), which is useful for scaling line and point size.

void G3D::glVertex ( const G3D::Vector2 v)
inline
void G3D::glVertex ( const G3D::Vector2int16 &  v)
inline
void G3D::glVertex ( const G3D::Vector3 v)
inline
void G3D::glVertex ( const G3D::Vector3int16 &  v)
inline
void G3D::glVertex ( const G3D::Vector4 v)
inline
double G3D::halfPi ( )
inline

Referenced by aSin().

int G3D::highestBit ( uint32  x)

Returnes the 0-based index of the highest 1 bit from the left.

-1 means the number was 0.

Referenced Code:
Based on code by jukka.nosp@m.@lii.nosp@m.matta.nosp@m..org
int G3D::iAbs ( int  iValue)
inline
int G3D::iCeil ( double  fValue)
inline
int G3D::iClamp ( int  val,
int  low,
int  hi 
)
inline

Clamps the value to the range [low, hi] (inclusive)

Referenced by G3D::GuiDropDownList::selectedIndex(), and G3D::Map2D< Color1, Color1 >::slowGet().

int16 G3D::iClamp ( int16  val,
int16  low,
int16  hi 
)
inline
Vector3int32 G3D::iFloor ( const Vector3 &  )
int G3D::iFloor ( double  fValue)
inline
int G3D::iMax ( int  x,
int  y 
)
inline
int G3D::iMin ( int  x,
int  y 
)
inline
int G3D::iMod3 ( int  x)
inline

Computes x % 3.

double G3D::inf ( )
void G3D::initG3D ( )

Call from main() to initialize the G3D library state and register shutdown memory managers.

This does not initialize OpenGL.

If you invoke initGLG3D, then it will automatically call initG3D. It is safe to call this function more than once–it simply ignores multiple calls.

See Also
System, GLCaps, OSWindow, RenderDevice, initGLG3D.
void G3D::initGLG3D ( )

Call from main() to initialize the GLG3D library state and register shutdown memory managers.

This does not initialize OpenGL.

This automatically calls initG3D. It is safe to call this function more than once–it simply ignores multiple calls.

See Also
GLCaps, OSWindow, RenderDevice, initG3D
int G3D::iRandom ( int  low,
int  hi 
)

Returns a random number uniformly at random between low and hi (inclusive).

Deprecated:
Use Random::integer

Referenced by G3D::Array< PreprocessedShaderSource >::randomElement(), and G3D::Array< PreprocessedShaderSource >::randomize().

int G3D::iRound ( double  fValue)
inline

Fast round to integer using the lrint routine.

Typically 6x faster than casting to integer.

Referenced by G3D::Map2D< Color1, Color1 >::crop(), G3D::Icon::height(), G3D::Map2D< Color1, Color1 >::nearest(), G3D::XML::operator int(), and G3D::Icon::width().

int G3D::iRound ( float  f)
inline

Fast round to integer using the lrint routine.

Typically 6x faster than casting to integer.

bool G3D::isDigit ( const unsigned char  c)
inline

These standard C functions are renamed for clarity/naming conventions and to return bool, not int.

bool G3D::isEven ( int  num)
inline
bool G3D::isFinite ( double  x)
inline
bool G3D::isFinite ( float  x)
inline
int G3D::iSign ( int  iValue)
inline

Referenced by iSign().

int G3D::iSign ( double  fValue)
inline
int G3D::iSign ( float  f)
inline
bool G3D::isLetter ( const unsigned char  c)
inline

These standard C functions are renamed for clarity/naming conventions and to return bool, not int.

bool G3D::isNaN ( double  x)

Returns true if the argument is NaN (not a number).

You can't use x == nan to test this because all comparisons against nan return false.

Referenced by isFinite(), G3D::Vector2::isNaN(), G3D::ShadowMap::setPolygonOffset(), sinc(), and G3D::GuiNumberBox< int >::updateText().

bool G3D::isNaN ( float  x)
bool G3D::isNaN ( int  x)
inline
bool G3D::isNaN ( uint64  x)
inline
bool G3D::isNewline ( const unsigned char  c)
inline

These standard C functions are renamed for clarity/naming conventions and to return bool, not int.

template<class T >
bool G3D::isNull ( const shared_ptr< T > &  ptr)
template<class T >
bool G3D::isNull ( const T *  ptr)
template<class T >
bool G3D::isNull ( const Pointer< T > &  p)
bool G3D::isOdd ( int  num)
inline
bool G3D::isPow2 ( int  num)
inline
bool G3D::isPow2 ( uint64  num)
inline
bool G3D::isPow2 ( uint32  x)
inline
bool G3D::isQuote ( const unsigned char  c)
inline
bool G3D::isSlash ( const unsigned char  c)
inline
bool G3D::isValidHeapPointer ( const void x)
inline
bool G3D::isValidPointer ( const void x)
inline

Returns true if the pointer is likely to be a valid pointer (instead of an arbitrary number).

Useful for debugging purposes.

bool G3D::isWhiteSpace ( const unsigned char  c)
inline

These standard C functions are renamed for clarity/naming conventions and to return bool, not int.

int G3D::iWrap ( int  val,
int  hi 
)
inline

Wraps the value to the range [0, hi) (exclusive on the high end).

This is like the clock arithmetic produced by % (modulo) except the result is guaranteed to be positive.

Referenced by G3D::Image::get(), G3D::Spline< UprightFrame >::getControl(), G3D::Image::set(), and G3D::Map2D< Color1, Color1 >::slowGet().

float G3D::length ( float  v)
inline

Referenced by G3D::Box::extent().

float G3D::length ( const Vector2 &  v)
inline
float G3D::length ( const Vector3 &  v)
inline
float G3D::length ( const Vector4 &  v)
inline
Vector2 G3D::lerp ( const Vector2 &  v1,
const Vector2 &  v2,
float  f 
)
inline
Vector3 G3D::lerp ( const Vector3 &  v1,
const Vector3 &  v2,
float  f 
)
inline
Vector4 G3D::lerp ( const Vector4 &  v1,
const Vector4 &  v2,
float  f 
)
inline
Color1 G3D::lerp ( const Color1 &  v1,
const Color1 &  v2,
float  f 
)
inline
Color3 G3D::lerp ( const Color3 &  v1,
const Color3 &  v2,
float  f 
)
inline
Color4 G3D::lerp ( const Color4 &  v1,
const Color4 &  v2,
float  f 
)
inline
double G3D::lerp ( double  a,
double  b,
double  f 
)
inline

Returns a + (b - a) * f;.

Referenced by G3D::Map2D< Color1, Color1 >::bilinear(), and G3D::UniversalBSDF::computeF().

float G3D::lerp ( float  a,
float  b,
float  f 
)
inline
std::string G3D::license ( )

G3D, SDL, and IJG libraries require license documentation to be distributed with your program.

This generates the string that must appear in your documentation. Your program can be commercial, closed-source under any license you want.

Deprecated:
Use System::license
template<class XType , class YType >
YType G3D::linearSpline ( double  x,
const XType *  controlX,
const YType *  controlY,
int  numControl 
)

Interpolates a property according to a piecewise linear spline.

This provides C0 continuity but the derivatives are not smooth.

Example: const double times[] = {MIDNIGHT, SUNRISE - HOUR, SUNRISE, SUNRISE + sunRiseAndSetTime / 4, SUNRISE + sunRiseAndSetTime, SUNSET - sunRiseAndSetTime, SUNSET - sunRiseAndSetTime / 2, SUNSET, SUNSET + HOUR/2, DAY}; const Color3 color[] = {Color3(0, .0, .1), Color3(0, .0, .1), Color3::black(), Color3::black(), Color3::white() * .25, Color3::white() * .25, Color3(.5, .2, .2), Color3(.05, .05, .1), Color3(0, .0, .1), Color3(0, .0, .1)}; ambient = linearSpline(time, times, color, 10);

See also G3D::Spline

Parameters
xThe spline is a function of x; this is the sample to choose.
controlXcontrolX[i], controlY[i] is a control points. It is assumed that controlX are strictly increasing. XType must support the "<" operator and a subtraction operator that returns a number.
controlYYType must support multiplication and addition.
numControlThe number of control points.
Color3 G3D::log ( const Color3 &  c)
inline

Computes the log of each component.

Useful for inverting the monitor gamma function or simulating perceptual response.

Quat G3D::log ( const Quat &  q)
inline

Referenced by log2().

double G3D::log2 ( double  x)
inline

Referenced by log2().

float G3D::log2 ( float  x)
inline
double G3D::log2 ( int  x)
inline
void G3D::logLazyPrintf ( const char *  fmt,
  ... 
)

Does not flush the buffer; follow up with a logPrintf to force the flush.

void G3D::logPrintf ( const char *  fmt,
  ... 
)

Prints to the common system log, log.txt, which is usually in the working directory of the program.

If your disk is not writable or is slow, it will attempt to write to "c:/tmp/log.txt" or "c:/temp/log.txt" on Windows systems instead.

Unlike printf or debugPrintf, this function guarantees that all output is committed before it returns. This is very useful for debugging a crash, which might hide the last few buffered print statements otherwise.

Many G3D routines write useful warnings and debugging information to the system log, which makes it a good first place to go when tracking down a problem.

Referenced by Load3DS::processChunk(), and Load3DS::processTriMeshChunk().

__inline long int G3D::lrint ( double  flt)

Referenced by iRound().

__inline long int G3D::lrintf ( float  flt)

Referenced by iRound().

Vector2 G3D::max ( const Vector2 &  v1,
const Vector2 &  v2 
)
inline
Vector3 G3D::max ( const Vector3 &  v1,
const Vector3 &  v2 
)
inline
Vector4 G3D::max ( const Vector4 &  v1,
const Vector4 &  v2 
)
inline
Color3 G3D::max ( const Color3 &  v1,
const Color3 &  v2 
)
inline
Color4 G3D::max ( const Color4 &  v1,
const Color4 &  v2 
)
inline
template<class T >
T G3D::max ( const T &  x,
const T &  y 
)
inline
template<class T >
T G3D::max ( const T &  x,
const T &  y,
const T &  z 
)
inline
template<class T >
T G3D::max ( const T &  x,
const T &  y,
const T &  z,
const T &  w 
)
inline
size_t G3D::maxNotNPOS ( size_t  i,
size_t  j 
)
inline

Returns the larger string index, ignoring std::string::npos.

Referenced by findLastSlash().

Vector2 G3D::min ( const Vector2 &  v1,
const Vector2 &  v2 
)
inline
Vector3 G3D::min ( const Vector3 &  v1,
const Vector3 &  v2 
)
inline
Vector4 G3D::min ( const Vector4 &  v1,
const Vector4 &  v2 
)
inline
Color3 G3D::min ( const Color3 &  v1,
const Color3 &  v2 
)
inline
Color4 G3D::min ( const Color4 &  v1,
const Color4 &  v2 
)
inline
template<class T >
T G3D::min ( const T &  x,
const T &  y 
)
inline
template<class T >
T G3D::min ( const T &  x,
const T &  y,
const T &  z 
)
inline
template<class T >
T G3D::min ( const T &  x,
const T &  y,
const T &  z,
const T &  w 
)
inline
void G3D::msgBox ( const std::string message,
const std::string title = "Message" 
)

Displays a GUI prompt with "Ok" as the only choice.

Matrix4 G3D::mul ( const Matrix4 &  a,
const Matrix4 &  b 
)
inline
Vector4 G3D::mul ( const Matrix4 &  m,
const Vector4 &  v 
)
inline
Vector3 G3D::mul ( const Matrix3 &  m,
const Vector3 &  v 
)
inline
Matrix3 G3D::mul ( const Matrix3 &  a,
const Matrix3 &  b 
)
inline
float G3D::mul ( float  a,
float  b 
)
inline

a * b (for DirectX/Cg support)

double G3D::nan ( )

This value should not be tested against directly, instead G3D::isNan() and G3D::isFinite() will return reliable results.

Referenced by G3D::GuiNumberBox< int >::commit(), and G3D::Quat::log().

Vector2 G3D::normalize ( const Vector2 &  v)
inline
Vector3 G3D::normalize ( const Vector3 &  v)
inline
Vector4 G3D::normalize ( const Vector4 &  v)
inline
float G3D::normalize ( float  v)
inline

v / v (for DirectX/Cg support)

template<class T >
bool G3D::notNull ( const shared_ptr< T > &  ptr)
template<class T >
bool G3D::notNull ( const T *  ptr)
template<class T >
bool G3D::notNull ( const Pointer< T > &  p)
bool G3D::operator!= ( const NetAddress &  a,
const NetAddress &  b 
)
inline

Referenced by G3D_BEGIN_PACKED_CLASS().

Color4 G3D::operator* ( const Color3 &  c3,
const Color4 &  c4 
)
inline

Extends the c3 with alpha = 1.0.

G3D::Color3 G3D::operator* ( float  s,
const G3D::Color3 c 
)
inline

Referenced by G3D_BEGIN_PACKED_CLASS().

Vector2 G3D::operator* ( double  s,
const Vector2 &  v 
)
inline
G3D::Color3 G3D::operator* ( G3D::Color1 s,
const G3D::Color3 c 
)
inline
Vector2 G3D::operator* ( float  s,
const Vector2 &  v 
)
inline
G3D::Color3 G3D::operator* ( const G3D::Color3 c,
G3D::Color1 s 
)
inline
Vector2 G3D::operator* ( int  s,
const Vector2 &  v 
)
inline
Color4 G3D::operator* ( float  fScalar,
const Color4 &  other 
)
inline
Vector3 G3D::operator* ( const Vector3 &  rkPoint,
const Matrix3 &  rkMatrix 
)
inline

v * M == M.transpose() * v

vector * matrix [1x3 * 3x3 = 1x3]

G3D::Vector3 G3D::operator* ( float  s,
const G3D::Vector3 v 
)
inline
G3D::Vector3 G3D::operator* ( double  s,
const G3D::Vector3 v 
)
inline
G3D::Vector3 G3D::operator* ( int  s,
const G3D::Vector3 v 
)
inline
G3D::Quat G3D::operator* ( double  s,
const G3D::Quat q 
)
inline
G3D::Quat G3D::operator* ( float  s,
const G3D::Quat q 
)
inline
Referenced Code:
Based on Watt & Watt, page 360
std::ostream& G3D::operator<< ( std::ostream &  os,
const NetAddress &   
)

Referenced by G3D_BEGIN_PACKED_CLASS().

std::ostream& G3D::operator<< ( std::ostream &  os,
const Vector3 &   
)
bool G3D::operator== ( const NetAddress &  a,
const NetAddress &  b 
)
inline

Two addresses may point to the same computer but be != because they have different IP's.

Referenced by G3D_BEGIN_PACKED_CLASS().

void G3D::parseCommaSeparated ( const std::string  s,
Array< std::string > &  array,
bool  stripQuotes = true 
)

Separates a comma-separated line, properly escaping commas within double quotes (") and super quotes (""").

This matches Microsoft Excel's CSV output.

Parameters
stripQuotesIf true, strips leading and trailing " and """
See Also
G3D::stringSplit, G3D::TextInput, G3D::readWholeFile
void G3D::parseFilename ( const std::string filename,
std::string drive,
Array< std::string > &  path,
std::string base,
std::string ext 
)

Parses a filename into four useful pieces.

Examples:

c:\a\b\d.e root = "c:\\" path = "a" "b" base = "d" ext = "e"

/a/b/d.e root = "/" path = "a" "b" base = "d" ext = "e"

/a/b root = "/" path = "a" base = "b" ext = "e"

std::string G3D::pathConcat ( const std::string dirname,
const std::string file 
)

Appends file onto dirname, ensuring a / if needed.

Deprecated:
Use FilePath::concat
double G3D::pi ( )
inline
float G3D::pif ( )
inline

Referenced by acos().

int G3D::pow2 ( unsigned int  x)
inline

Returns 2^x.

template<class T >
T G3D::pow5 ( x)
inline

Returns x5

Referenced by G3D::UniversalBSDF::computeF().

int G3D::prompt ( const char *  windowTitle,
const char *  promptx,
const char **  choice,
int  numChoices,
bool  useGui 
)

Prints a prompt to stdout and waits for user input.

The return value is the number of the user's choice (the first is 0, if there are no choices, returns 0).

Parameters
useGuiUnder Win32, use a GUI, not stdout prompt.
windowTitleThe title for the prompt window
promptxThe text string to prompt the user with
choiceAn array of strings that are the choices the user may make
numChoicesThe length of choice.
Referenced Code:
Windows dialog interface by Max McGuire, mmcgu.nosp@m.ire@.nosp@m.ironl.nosp@m.ore..nosp@m.com
Referenced Code:
Font setting code by Kurt Miller, kurt@.nosp@m.flip.nosp@m.code..nosp@m.com

Referenced by prompt().

int G3D::prompt ( const char *  windowTitle,
const char *  promptx,
const char **  choice,
int  numChoices 
)
inline

Prints a prompt and waits for user input.

The return value is the number of the user's choice (the first is 0, if there are no choices, returns 0).

Uses GUI under Win32, stdout prompt otherwise.

std::string G3D::readWholeFile ( const std::string filename)

Returns the contents of a text file as a single string.

std::string G3D::replace ( const std::string s,
const std::string pattern,
const std::string replacement 
)

Returns a string which is s, with all instances of pattern replaced.

double G3D::round ( double  f)
inline

Referenced by G3D::Vector3::round().

float G3D::round ( float  f)
inline
float G3D::rsq ( float  x)
inline

Computes 1 / sqrt(x).

Referenced by G3D::Vector3::fastDirection(), and G3D::Quat::unitize().

double G3D::rsqrt ( double  x)
inline
Deprecated:
Use rsq
float G3D::rsqrt ( float  x)
inline
Deprecated:
Use rsq
void G3D::screenPrintf ( const char *  fmt...)

Displays output on the last G3D::GApp instantiated.

If there was no GApp instantiated, does nothing. Threadsafe.

This is primarily useful for code that prints (almost) the same values every frame (e.g., "current position = ...") because those values will then appear in the same position on screen.

For one-off print statements (e.g., "network message received") see G3D::consolePrintf.

void G3D::serialize ( const std::string s,
BinaryOutput &  b 
)
inline
void G3D::serialize ( const int32 &  i,
BinaryOutput &  b 
)
inline
void G3D::serialize ( const uint32 &  i,
BinaryOutput &  b 
)
inline
void G3D::serialize ( const bool &  i,
BinaryOutput &  b 
)
inline
void G3D::serialize ( const float32 &  f,
BinaryOutput &  b 
)
inline
void G3D::serialize ( const float64 &  f,
BinaryOutput &  b 
)
inline
template<typename T >
void G3D::serialize ( const Array< T > &  array,
BinaryOutput &  b 
)

serialize(const T&, BinaryOutput&) must have been overridden as well

void G3D::serialize ( const bool &  b,
TextOutput &  to 
)
void G3D::serialize ( const int b,
TextOutput &  to 
)
void G3D::serialize ( const uint8 &  b,
TextOutput &  to 
)
void G3D::serialize ( const double &  b,
TextOutput &  to 
)
void G3D::serialize ( const float &  b,
TextOutput &  to 
)
void G3D::serialize ( const std::string b,
TextOutput &  to 
)
void G3D::serialize ( const char *  b,
TextOutput &  to 
)
void G3D::serialize ( const Vector2 &  v,
class BinaryOutput &  b 
)
void G3D::serialize ( const Vector3::Axis &  a,
class BinaryOutput &  bo 
)
void G3D::serialize ( const Vector4 &  v,
class BinaryOutput &  b 
)
void G3D::serialize ( const Vector3 &  v,
class BinaryOutput &  b 
)
void G3D::setAssertionHook ( AssertionHook  hook)

Allows customization of the global function invoked when a debugAssert fails.

The initial value is G3D::internal::_handleDebugAssert. G3D will invoke rawBreak if the hook returns true. If NULL, assertions are not handled.

void G3D::setConsolePrintHook ( ConsolePrintHook  h)

Called by consolePrintf after the log and terminal have been written to.

Used by GConsole to intercept printing routines.

void G3D::setFailureHook ( AssertionHook  hook)

Called by alwaysAssertM in case of failure in release mode.

If returns true then the program exits with -1 (you can replace this with your own version that throws an exception or has other failure modes).

Vector2 G3D::sign ( const Vector2 &  v)
inline
Vector3 G3D::sign ( const Vector3 &  v)
inline
Vector4 G3D::sign ( const Vector4 &  v)
inline
double G3D::sign ( double  fValue)
inline

Referenced by sign().

float G3D::sign ( float  fValue)
inline
double G3D::sinc ( double  x)
inline

sin(x)/x

int G3D::sizeOfGLFormat ( GLenum  format)

Returns the number of bytes occupied by a value in an OpenGL format (e.g.

GL_FLOAT). Returns 0 for unknown formats.

float G3D::smootherstep ( float  edge0,
float  edge1,
float  x 
)
inline

Perlin's C2 continous variation on smoothstep()

float G3D::smoothstep ( float  edge0,
float  edge1,
float  x 
)
inline

The GLSL smoothstep function.

double G3D::square ( double  fValue)
inline
float G3D::square ( float  x)
inline
int G3D::square ( int  x)
inline
int G3D::stringCompare ( const std::string s1,
const std::string s2 
)

A comparison function for passing to Array::sort.

std::string G3D::stringJoin ( const G3D::Array< std::string > &  a,
char  joinChar 
)

joinChar is not inserted at the beginning or end, just in between elements.

std::string G3D::stringJoin ( const G3D::Array< std::string > &  a,
const std::string joinStr 
)
int G3D::stringPtrCompare ( const std::string s1,
const std::string s2 
)
G3D::Array<std::string> G3D::stringSplit ( const std::string x,
char  splitChar 
)

Splits x at each occurance of splitChar.

double G3D::sumSquares ( double  x,
double  y 
)
inline

Referenced by distance().

double G3D::sumSquares ( double  x,
double  y,
double  z 
)
inline
float G3D::sumSquares ( float  x,
float  y 
)
inline
float G3D::sumSquares ( float  x,
float  y,
float  z 
)
inline
uint32_t G3D::superFastHash ( const void _data,
size_t  numBytes 
)
inline

A hash function that is faster than CRC32 for arbitrary long strings.

Referenced Code:
From http://www.azillionmonkeys.com/qed/hash.html by Paul Hsieh

Referenced by HashTrait< std::string >::hashCode(), HashTrait< G3D::uint128 >::hashCode(), HashTrait< G3D::Vector3int32 >::hashCode(), and G3D::GBuffer::Specification::hashCode().

void G3D::tesselateComplexPolygon ( const Array< Vector3 > &  input,
Array< Triangle > &  output 
)

Tesselates a complex polygon into a triangle set which is appended to the output.

The input is a series of counter-clockwise winding vertices, where the last is implicitly connected to the first. Self-intersections are allowed; "inside" is determined by an "odd" winding rule. You may need to introduce a sliver polygon to cut holes out of the center.

double G3D::toDegrees ( double  rad)
inline
float G3D::toDegrees ( float  rad)
inline
float G3D::toDegrees ( int  rad)
inline
std::string G3D::toLower ( const std::string x)
double G3D::toRadians ( double  deg)
inline
float G3D::toRadians ( float  deg)
inline
float G3D::toRadians ( int  deg)
inline
SimTime G3D::toSeconds ( int  hour,
int  minute,
double  seconds,
AMPM  ap 
)

Converts a 12 hour clock time into the number of seconds since midnight.

Note that 12:00 PM is noon and 12:00 AM is midnight.

Example: toSeconds(10, 00, AM)

SimTime G3D::toSeconds ( int  hour,
int  minute,
AMPM  ap 
)
std::string G3D::toUpper ( const std::string x)

Returns a new string that is an uppercase version of x.

std::string G3D::trimWhitespace ( const std::string s)

Strips whitespace from both ends of the string.

Referenced by G3D::GuiNumberBox< int >::commit().

double G3D::twoPi ( )
inline
float G3D::uniformRandom ( float  low = 0.0f,
float  hi = 1.0f 
)
inline

Uniform random number between low and hi, inclusive.

[low, hi]

Deprecated:
See Also
Random::uniform

Referenced by G3D::RayShape::randomInteriorPoint(), G3D::ArrowShape::randomInteriorPoint(), and G3D::Rect2D::randomPoint().

std::string G3D::vformat ( const char *  fmt,
va_list  argPtr 
)

Like format, but can be called with the argument list from a ...

function.

uint32_t G3D::wangHash6432Shift ( int64  key)
inline

Thomas Wang's 64-to-32-bit mix hash based on Robert Jenkin's hash http://www.concentric.net/~ttwang/tech/inthash.htm.

Found by Morgan to produce the best net performance for building tables from Vector4int16

Referenced by HashTrait< G3D::Vector4int16 >::hashCode().

std::string G3D::wordWrap ( const std::string input,
int  numCols 
)

Produces a new string that is the input string wrapped at a certain number of columns (where the line is broken at the latest space before the column limit.) Platform specific NEWLINEs are inserted to wrap.

See Also
G3D::GFont::wordWrapCut, G3D::TextOutput::Settings::WordWrapMode
float G3D::wrap ( float  t,
float  lo,
float  hi 
)
inline
double G3D::wrap ( double  t,
double  lo,
double  hi 
)
inline
double G3D::wrap ( double  t,
double  hi 
)
inline
void G3D::writeWholeFile ( const std::string filename,
const std::string str,
bool  flush = true 
)
Parameters
flushIf true (default), the file is ready for reading as soon as the function returns. If false, the function returns immediately and writes the file in the background.
bool G3D::zipfileExists ( const std::string filename,
std::string outZipfile,
std::string outInternalFile 
)

Returns true if the given file (or directory) exists within a zipfile.

Called if fileExists initially returns false and the lookInZipfiles flag has been set. Must not end in a trailing slash. Does not work for recursive zipfiles (.zips within another .zip)

Parameters
filenamethe path to test
outZipfilethe path to the .zip file
outInternalFilethe path (within the .zip) where the desired file is located, if valid
bool G3D::zipfileExists ( const std::string filename)

Variable Documentation

const uint32 G3D::DI8DEVCLASS_GAMECTRL = 4
const uint32 G3D::DIDF_ABSAXIS = 0x00000001
const uint32 G3D::DIDF_RELAXIS = 0x00000002
const uint32 G3D::DIDFT_ABSAXIS = 0x00000002
const uint32 G3D::DIDFT_ANYINSTANCE = 0x00FFFF00
const uint32 G3D::DIDFT_AXIS = 0x00000003
const uint32 G3D::DIDFT_BUTTON = 0x0000000C
const uint32 G3D::DIDFT_OPTIONAL = 0x80000000
const uint32 G3D::DIDFT_POV = 0x00000010
const uint32 G3D::DIDFT_RELAXIS = 0x00000001
const uint32 G3D::DIEDFL_ATTACHEDONLY = 0x00000001
const uint32 G3D::DIK_0 = 0x0B
const uint32 G3D::DIK_1 = 0x02
const uint32 G3D::DIK_2 = 0x03
const uint32 G3D::DIK_3 = 0x04
const uint32 G3D::DIK_4 = 0x05
const uint32 G3D::DIK_5 = 0x06
const uint32 G3D::DIK_6 = 0x07
const uint32 G3D::DIK_7 = 0x08
const uint32 G3D::DIK_8 = 0x09
const uint32 G3D::DIK_9 = 0x0A
const uint32 G3D::DIK_A = 0x1E
const uint32 G3D::DIK_ABNT_C1 = 0x73
const uint32 G3D::DIK_ABNT_C2 = 0x7E
const uint32 G3D::DIK_ADD = 0x4E
const uint32 G3D::DIK_APOSTROPHE = 0x28
const uint32 G3D::DIK_APPS = 0xDD
const uint32 G3D::DIK_AT = 0x91
const uint32 G3D::DIK_AX = 0x96
const uint32 G3D::DIK_B = 0x30
const uint32 G3D::DIK_BACK = 0x0E
const uint32 G3D::DIK_BACKSLASH = 0x2B
const uint32 G3D::DIK_C = 0x2E
const uint32 G3D::DIK_CALCULATOR = 0xA1
const uint32 G3D::DIK_CAPITAL = 0x3A
const uint32 G3D::DIK_COLON = 0x92
const uint32 G3D::DIK_COMMA = 0x33
const uint32 G3D::DIK_CONVERT = 0x79
const uint32 G3D::DIK_D = 0x20
const uint32 G3D::DIK_DECIMAL = 0x53
const uint32 G3D::DIK_DELETE = 0xD3
const uint32 G3D::DIK_DIVIDE = 0xB5
const uint32 G3D::DIK_DOWN = 0xD0
const uint32 G3D::DIK_E = 0x12
const uint32 G3D::DIK_END = 0xCF
const uint32 G3D::DIK_EQUALS = 0x0D
const uint32 G3D::DIK_ESCAPE = 0x01
const uint32 G3D::DIK_F = 0x21
const uint32 G3D::DIK_F1 = 0x3B
const uint32 G3D::DIK_F10 = 0x44
const uint32 G3D::DIK_F11 = 0x57
const uint32 G3D::DIK_F12 = 0x58
const uint32 G3D::DIK_F13 = 0x64
const uint32 G3D::DIK_F14 = 0x65
const uint32 G3D::DIK_F15 = 0x66
const uint32 G3D::DIK_F2 = 0x3C
const uint32 G3D::DIK_F3 = 0x3D
const uint32 G3D::DIK_F4 = 0x3E
const uint32 G3D::DIK_F5 = 0x3F
const uint32 G3D::DIK_F6 = 0x40
const uint32 G3D::DIK_F7 = 0x41
const uint32 G3D::DIK_F8 = 0x42
const uint32 G3D::DIK_F9 = 0x43
const uint32 G3D::DIK_G = 0x22
const uint32 G3D::DIK_GRAVE = 0x29
const uint32 G3D::DIK_H = 0x23
const uint32 G3D::DIK_HOME = 0xC7
const uint32 G3D::DIK_I = 0x17
const uint32 G3D::DIK_INSERT = 0xD2
const uint32 G3D::DIK_J = 0x24
const uint32 G3D::DIK_K = 0x25
const uint32 G3D::DIK_KANA = 0x70
const uint32 G3D::DIK_KANJI = 0x94
const uint32 G3D::DIK_L = 0x26
const uint32 G3D::DIK_LBRACKET = 0x1A
const uint32 G3D::DIK_LCONTROL = 0x1D
const uint32 G3D::DIK_LEFT = 0xCB
const uint32 G3D::DIK_LMENU = 0x38
const uint32 G3D::DIK_LSHIFT = 0x2A
const uint32 G3D::DIK_LWIN = 0xDB
const uint32 G3D::DIK_M = 0x32
const uint32 G3D::DIK_MAIL = 0xEC
const uint32 G3D::DIK_MEDIASELECT = 0xED
const uint32 G3D::DIK_MEDIASTOP = 0xA4
const uint32 G3D::DIK_MINUS = 0x0C
const uint32 G3D::DIK_MULTIPLY = 0x37
const uint32 G3D::DIK_MUTE = 0xA0
const uint32 G3D::DIK_MYCOMPUTER = 0xEB
const uint32 G3D::DIK_N = 0x31
const uint32 G3D::DIK_NEXT = 0xD1
const uint32 G3D::DIK_NEXTTRACK = 0x99
const uint32 G3D::DIK_NOCONVERT = 0x7B
const uint32 G3D::DIK_NUMLOCK = 0x45
const uint32 G3D::DIK_NUMPAD0 = 0x52
const uint32 G3D::DIK_NUMPAD1 = 0x4F
const uint32 G3D::DIK_NUMPAD2 = 0x50
const uint32 G3D::DIK_NUMPAD3 = 0x51
const uint32 G3D::DIK_NUMPAD4 = 0x4B
const uint32 G3D::DIK_NUMPAD5 = 0x4C
const uint32 G3D::DIK_NUMPAD6 = 0x4D
const uint32 G3D::DIK_NUMPAD7 = 0x47
const uint32 G3D::DIK_NUMPAD8 = 0x48
const uint32 G3D::DIK_NUMPAD9 = 0x49
const uint32 G3D::DIK_NUMPADCOMMA = 0xB3
const uint32 G3D::DIK_NUMPADENTER = 0x9C
const uint32 G3D::DIK_NUMPADEQUALS = 0x8D
const uint32 G3D::DIK_O = 0x18
const uint32 G3D::DIK_OEM_102 = 0x56
const uint32 G3D::DIK_P = 0x19
const uint32 G3D::DIK_PAUSE = 0xC5
const uint32 G3D::DIK_PERIOD = 0x34
const uint32 G3D::DIK_PLAYPAUSE = 0xA2
const uint32 G3D::DIK_POWER = 0xDE
const uint32 G3D::DIK_PREVTRACK = 0x90
const uint32 G3D::DIK_PRIOR = 0xC9
const uint32 G3D::DIK_Q = 0x10
const uint32 G3D::DIK_R = 0x13
const uint32 G3D::DIK_RBRACKET = 0x1B
const uint32 G3D::DIK_RCONTROL = 0x9D
const uint32 G3D::DIK_RETURN = 0x1C
const uint32 G3D::DIK_RIGHT = 0xCD
const uint32 G3D::DIK_RMENU = 0xB8
const uint32 G3D::DIK_RSHIFT = 0x36
const uint32 G3D::DIK_RWIN = 0xDC
const uint32 G3D::DIK_S = 0x1F
const uint32 G3D::DIK_SCROLL = 0x46
const uint32 G3D::DIK_SEMICOLON = 0x27
const uint32 G3D::DIK_SLASH = 0x35
const uint32 G3D::DIK_SLEEP = 0xDF
const uint32 G3D::DIK_SPACE = 0x39
const uint32 G3D::DIK_STOP = 0x95
const uint32 G3D::DIK_SUBTRACT = 0x4A
const uint32 G3D::DIK_SYSRQ = 0xB7
const uint32 G3D::DIK_T = 0x14
const uint32 G3D::DIK_TAB = 0x0F
const uint32 G3D::DIK_U = 0x16
const uint32 G3D::DIK_UNDERLINE = 0x93
const uint32 G3D::DIK_UNLABELED = 0x97
const uint32 G3D::DIK_UP = 0xC8
const uint32 G3D::DIK_V = 0x2F
const uint32 G3D::DIK_VOLUMEDOWN = 0xAE
const uint32 G3D::DIK_VOLUMEUP = 0xB0
const uint32 G3D::DIK_W = 0x11
const uint32 G3D::DIK_WAKE = 0xE3
const uint32 G3D::DIK_WEBBACK = 0xEA
const uint32 G3D::DIK_WEBFAVORITES = 0xE6
const uint32 G3D::DIK_WEBFORWARD = 0xE9
const uint32 G3D::DIK_WEBHOME = 0xB2
const uint32 G3D::DIK_WEBREFRESH = 0xE7
const uint32 G3D::DIK_WEBSEARCH = 0xE5
const uint32 G3D::DIK_WEBSTOP = 0xE8
const uint32 G3D::DIK_X = 0x2D
const uint32 G3D::DIK_Y = 0x15
const uint32 G3D::DIK_YEN = 0x7D
const uint32 G3D::DIK_Z = 0x2C
const uint32 G3D::DIPH_BYID = 2
const uint32 G3D::DIPH_BYOFFSET = 1
const uint32 G3D::DIPH_BYUSAGE = 3
const uint32 G3D::DIPH_DEVICE = 0
const uint32 G3D::DIRECTINPUT_VERSION = 0x0800
const uint32 G3D::DISCL_BACKGROUND = 0x00000008
const uint32 G3D::DISCL_EXCLUSIVE = 0x00000001
const uint32 G3D::DISCL_FOREGROUND = 0x00000004
const uint32 G3D::DISCL_NONEXCLUSIVE = 0x00000002
const uint32 G3D::DISCL_NOWINKEY = 0x00000010
const bool G3D::DONT_SHRINK_UNDERLYING_ARRAY = false
const DIDATAFORMAT G3D::G3DJOYDF
Initial value:
= {
sizeof(DIDATAFORMAT),
sizeof(G3DJOYDATA),
}
const DIDATAFORMAT G3D::G3DKEYDF
Initial value:
= {
sizeof(DIDATAFORMAT),
sizeof(G3DKEYDATA),
}
bool G3D::ignoreBool
DIOBJECTDATAFORMAT G3D::keyodf[]
typedef G3D::LPVOID
const char* G3D::NEWLINE
const uint32 G3D::numJoyObjects = (sizeof(rgodf) / sizeof(rgodf[0]))
const uint32 G3D::numKeyObjects = (sizeof(keyodf) / sizeof(keyodf[0]))
</
HDC G3D::OpenGLWindowHDC