Support Forum       G3D Web Page     
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
G3D Namespace Reference

Namespaces

 _BSPMAP
 
 _internal
 
 chrono
 
 Discovery
 
 units
 Use using namespace G3D::units; to include all units into your program.
 

Classes

class  _GuiSliderBase
 
class  AABox
 
An axis-aligned box. More...
 
class  Access
 Access specifier for a buffer of data. More...
 
class  ActiveEvent
 Application visibility event structure. More...
 
class  AlignedMemoryManager
 Allocates memory on 16-byte boundaries. More...
 
class  AlphaFilter
 How the alpha value should be interpreted for partial coverage. 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
 Arguments to use when running a Shader. 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  ArticulatedModelSpecificationEditorDialog
 
class  AttributeArray
 
A block of GPU memory storing a stream of vector data (e.g., vertices, normals, texture coordinates) More...
 
class  AudioChannel
 A playing Sound. More...
 
class  AudioDevice
 
Initializes the audio system. More...
 
class  AxesShape
 
class  BilateralFilter
 
(Separated) 2D Bilateral Filter. More...
 
class  BilateralFilterSettings
 
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  BindlessTextureHandle
 
A wrapper for bindless texture handles, as introduced by https://www.opengl.org/registry/specs/ARB/bindless_texture.txt Only use this class if your OpenGL context supports ARB_bindless_texture. 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  BufferTexture
 
A 1D array stored on the GPU, backed by a buffer object. More...
 
class  BufferUnmapper
 "Frees" mapped memory by unmapping it. More...
 
class  BumpMap
 
Normal + bump map for use with G3D::UniversalMaterial. More...
 
class  CallbackWidget
 A widget that takes std::functions for its event handlers, avoiding the need to subclass Widget for basic "heartbeat" functions. 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  Color1unorm8
 
Represents a single-channel color on [0, 1] with G3D::unorm8 precision. More...
 
class  Color2unorm8
 Matches OpenGL GL_RG8 format. More...
 
class  Color3
 
Do not subclass– this implementation makes assumptions about the memory layout. More...
 
class  Color3unorm8
 
Represents a Color3 as a packed integer. More...
 
class  Color4
 
Do not subclass– this implementation makes assumptions about the memory layout. More...
 
class  Color4unorm8
 
Represents a Color4 as a packed integer. 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  ContinuousStopwatch
 Provides accurate measurement of sequences of durations. More...
 
class  ControlPointEditor
 
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  CubeMap
 A CPU seamless cube map. More...
 
class  CubeMapConvention
 Image alignment conventions specified by different APIs. More...
 
class  CullFace
 
class  Cylinder
 
Right cylinder More...
 
class  CylinderShape
 
class  DDGIVolume
 A volume of space within which irradiance queries at arbitrary points are supported using a grid of DDGI probes. More...
 
class  DDGIVolumeSpecification
 A volume of space within which irradiance querries at arbitrary points are supported using a grid of DDGI probes. More...
 
class  DebugTextWidget
 Renders rasterizer statistics and debug text for GApp. More...
 
class  DebugVisualizationMode
 
class  DefaultRenderer
 Supports both traditional forward shading and full-screen deferred shading. More...
 
class  DepthEncoding
 Encoding of the depth buffer (not the GBuffer::Field::CS_Z buffer) More...
 
class  DepthFirstTreeBuilder
 
Template class for a depth first tree traversal supporting methods enterChild and goToParent. More...
 
class  DepthOfField
 
Defocus post-process shader More...
 
class  DepthOfFieldModel
 
The depth of field model. More...
 
class  DepthOfFieldSettings
 
class  DepthReadMode
 A m_depth texture can automatically perform the m_depth comparison used for shadow mapping on a texture lookup. More...
 
class  DeveloperWindow
 
Developer HUD controls instantiated by GApp::createDeveloperHUD for debugging. More...
 
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  EmulatedGazeTracker
 Simulates the presence of a gaze tracker by assuming that the user is always looking straight forward, and making the eyes converge on the point hit by a ray cast. More...
 
class  EmulatedXR
 
class  Entity
 Base class for objects in a G3D::Scene. More...
 
class  EventCoordinateMapper
 Used by Widgets for mapping between 2D events and 3D rendering. More...
 
class  ExposeEvent
 The "screen redraw" event. More...
 
class  FastPODTable
 Implemented with an open-addressing hash table that does not support remove. More...
 
class  FastPointHashGrid
 A multiset of values (i.e., with duplicates allowed) indexed efficiently by spatial location. More...
 
class  FileDialog
 
More...
 
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
 
More...
 
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  FogVolumeSurface
 An infinite fog volume, implemented by drawing at the near plane and ray marching until it hits the depth buffer. More...
 
class  FontModel
 
class  FOVDirection
 Stores the direction of the field of view for a G3D::Projection. More...
 
class  Framebuffer
 
Holds a set of G3D::Textures for use as draw targets. More...
 
class  FrameName
 
class  Frustum
 
class  FullScreenWidget
 A widget that renders below everything else and fills the OSWindow. More...
 
class  G3DAllocator
 Maps the G3D default allocator (System::malloc) to an std::allocator. More...
 
class  G3DSpecification
 Options for initG3D and initGLG3D. More...
 
class  G3DString
 Very fast string class that follows the std::string/std::basic_string interface. More...
 
class  GameController
 
Platform-independent tracking of input from an Xbox360 controller. More...
 
class  GApp
 
Optional base class for quickly creating 3D applications. More...
 
class  GaussianBlur
 
1D Gaussian blur. More...
 
class  GaussianMIPFilter
 
class  GazeTracker
 API for low-level gaze tracking. More...
 
class  GBuffer
 Saito and Takahashi's Geometry Buffers, typically used today for deferred and forward+ 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  GLSamplerObject
 
A class holding all of the parameters one would want to use to when accessing a Texture, and an associated OpenGL Sampler Object More...
 
class  Grid
 A dense 3D grid of templated Cells. 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  GuiFrameBox
 
For editing coordinate frames 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  GuiMultiLineTextBox
 Text box with multiple line support for entering strings. 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  GuiScrollBar
 
class  GuiScrollPane
 
A conventional pane with scroll bars that allow the user to determine which part of the pane to view. 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  GuiWidgetDestructor
 Detects when this object is removed from the GUI and removes the corresponding widget from its manager. More...
 
class  GuiWindow
 Retained-mode graphical user interface window. More...
 
class  GUniqueID
 Globally unique identifiers. More...
 
class  HaltonSequence
 
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  InterpolateMode
 
class  Intersect
 
More...
 
class  Journal
 Routines for programmatically working with journal.md.html and journal.dox files. More...
 
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  JoystickIndex
 Analog controller axes. 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  lazy_ptr
 
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  Light
 An (invisible) emitting surface (AREA) or point (DIRECTIONAL, SPOT, OMNI) light. More...
 
class  LightingEnvironment
 Lighting environment (not just "environment map") intended for hardware rendering using screen-space approximations of indirect light. 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  MarkerEntity
 A normally invisible Entity used for example, as a trigger, invisible collision, or spawn point. 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  Matrix2x3
 A 2x3 matrix. More...
 
class  Matrix3
 A 3x3 matrix. More...
 
class  Matrix3x4
 A 3x4 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  MonitorXR
 
class  MotionBlur
 Screen-space post-processed motion blur. More...
 
class  MotionBlurSettings
 
class  MouseButtonEvent
 
class  MouseMotionEvent
 Mouse motion event structure. More...
 
class  MouseScroll2DEvent
 2D scroll event structure More...
 
class  NativeTriTree
 
Native C++ implementation of a static bounding interval hierarchy that is very good for box queries and OK for ray-triangle. More...
 
class  NegativeAdapter
 Negates a numeric type G3D::Pointer value. More...
 
class  NetAddress
 
class  NetConnection
 A network connection between two machines that can send and receive messages. More...
 
class  NetConnectionIterator
 Note that it is not possible to construct a NetConnectionIterator (since nothing good could happen with it), so this must be initialized with a reference, e.g.,. More...
 
class  NetMessageIterator
 Iterates through new messages on a NetConnection. More...
 
class  NetSendConnection
 
Base class for NetConnection that provides only the sending functionality. More...
 
class  NetServer
 
Manages connections for a machine that accepts incoming ones. More...
 
class  NetworkDevice
 Abstraction of network (socket) functionality. More...
 
class  Noise
 
3D fixed point Perlin noise generator. More...
 
class  NotAdapter
 Wraps a boolean Pointer with one that inverts its value. More...
 
class  OpenVR
 
Implementation of the G3D::XR interface using the OpenVR API by Valve. More...
 
class  OptiXTriTree
 
class  OrderedTable
 
A Table that can be iterated through by index, preserves ordering, and implicitly supports removal during iteration. More...
 
class  OSWindow
 
Interface to window APIs for window management, event processing, and OpenGL context management. More...
 
class  PacketSizeException
 
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  ParseSchematic
 Parser for the MagicaVoxel sparse voxel format http://ephtracy.github.io/index.html?page=mv_vox_format. More...
 
class  ParseVOX
 Parser for the MagicaVoxel sparse voxel format http://ephtracy.github.io/index.html?page=mv_vox_format. More...
 
class  ParticleMaterial
 For efficiency, individual Particles use materials that have been pre-registered with the ParticleSystem that are addressed with these handles. More...
 
class  ParticleSurface
 Each ParticleSurface is the set of particles for a single ParticleSystem (not a single particle–this allows them to be culled reasonably without creating a huge amount of CPU work managing the particles). More...
 
class  ParticleSystem
 An Entity composed of multiple translucent particles. More...
 
class  ParticleSystemModel
 
Shared state for quickly instantiating particular types of ParticleSystems. More...
 
class  PathDirection
 Direction of light transport along a ray or path. More...
 
class  Pathfinder
 
Finds good paths between nodes in an arbitrary directed graph. More...
 
class  PathTracer
 
class  PercentageAdapter
 Maps a floating point fraction to a percentage G3D::Pointer value. 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
 2D/3D control for editing PhysicsFrameSplines. More...
 
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  PointModel
 
class  PointShape
 
class  PointSurface
 A G3D::Surface for point splatting. More...
 
class  PowerOfTwoAdapter
 Maps an integer pointer to a power of two G3D::Pointer value. More...
 
class  PrecomputedRandom
 Fast random numbers using a precomputed data table. More...
 
class  PrecomputedRay
 A 3D Ray optimized for AABox and Tri intersection, optionally limited to a positive subsegment of the ray. More...
 
class  PrefixTree
 
class  PrimitiveType
 These are defined to have the same value as the equivalent OpenGL constant. More...
 
class  Profiler
 Measures execution time of CPU and GPU events across multiple threads. More...
 
class  ProfilerWindow
 
More...
 
class  Projection
 A 3D perspective projection with bounding planes in camera space. More...
 
class  PythonInterpreter
 This class implements the Singleton design pattern. 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, optionally limited to a positive subsegment of the 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  RefractionHint
 Values for UniversalSurface::GPUGeom::refractionHint. More...
 
class  RegistryUtil
 Provides generalized Windows registry querying. More...
 
class  RenderDevice
 
Abstraction of a graphics rendering context (GPU). More...
 
class  Renderer
 Base class for 3D rendering pipelines. More...
 
class  RenderPassType
 Used by G3D::Surface and G3D::Renderer to specify the kind of rendering pass. More...
 
class  ResampleFilter
 Values for FilmSettings::upscaleFilter and FilmSettings::downscaleFilter. 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  Sampler
 
A class holding all of the parameters one would want to use to when accessing a Texture More...
 
class  Scene
 Base class for a scene graph. More...
 
class  SceneEditorWindow
 
class  SceneVisualizationSettings
 Visualization and debugging render options for Surface. More...
 
class  ScreenCapture
 Handles screenshot and video capture with managed filename generation and Journal output. More...
 
class  Set
 An unordered data structure that has at most one of each element. More...
 
class  SettingsWindow
 
More...
 
class  Shader
 Abstraction of the programmable hardware pipeline with G3D preprocessor extensions. More...
 
class  ShadowMap
 
When rendering into a shadow map, SHADOW_MAP_FRAMEBUFFER is set to 1 in the depth shader by the ShadowMap's framebuffer. More...
 
class  Shape
 Base class for debugging shapes that can render themselves. More...
 
class  Skybox
 
An infinite box with a cube-map texture. More...
 
class  SkyboxSurface
 An infinite cube that simulates the appearance of distant objects in the scene. More...
 
class  SlowMesh
 Used to convert old immediate mode OpenGL code to OpenGL 3+ core. More...
 
class  SmallArray
 Embeds N elements to reduce allocation time and increase memory coherence when working with arrays of arrays. More...
 
class  SmallTable
 
An unordered data structure mapping keys to values; maintained behind the scenes in a linear array More...
 
class  snorm16
 Represents numbers on [-1, 1] in 16 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL. More...
 
class  snorm8
 Represents numbers on [-1, 1] in 8 bits as a signed normalized 0.8 fixed-point value using the same encoding scheme as OpenGL. More...
 
class  Sound
 Sound file loaded into memory that can be played on an AudioChannel. More...
 
class  SoundEntity
 An invisilbe Entity that plays a positional sound and removes itself from the Scene when the sound ends. More...
 
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  SplineExtrapolationMode
 
Describes the behavior of G3D::Spline, etc. More...
 
class  SplineInterpolationMode
 Describes the interpolation behavior of G3D::Spline. More...
 
class  SquareAdapter
 Maps an integer pointer to a perfect square. More...
 
class  Stopwatch
 Provides accurate measurement of durations. 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  SVO
 
Sparse Voxel Octree: (compressed) 3D Analog of a GBuffer. More...
 
class  System
 
OS and processor abstraction. More...
 
class  Table
 
An unordered data structure mapping keys to values. More...
 
class  TemporalFilter
 A simple helper class for temporally filtering a screen-space buffer filled with world-space data. More...
 
class  TextInput
 
A simple tokenizer for parsing text files. More...
 
class  TextOutput
 Convenient formatting of ASCII text written to a file. More...
 
class  TextSurface
 
A billboard displaying text. 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  TextureBrowserWindow
 
Gui used by DeveloperWindow default for displaying all currently allocated textures. More...
 
class  ThirdPersonManipulator
 By default, the ThirdPersonManipulator moves an object relative to its own axes. More...
 
class  ThreadsafeQueue
 A queue whose methods are synchronized with respect to each other. More...
 
class  TimeQueue
 
Dynamic queue that works with timestamps to allow simulating latency. More...
 
class  Token
 
For use with TextInput. More...
 
class  TransparencyTestMode
 
Only used for depth writing purposes by G3D::Surface. More...
 
class  TransparencyType
 "Transparency" in G3D = transmission + alpha coverage 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
 Interface for ray-casting data structures. More...
 
class  TriTreeBase
 Common partial implementation base class for ray-casting data structures. More...
 
class  uint128
 Limited functionality 128-bit unsigned integer. More...
 
class  UniformTable
 Uniform and macro arguments for a G3D::Shader. 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  unorm16
 Represents numbers on [0, 1] in 16 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL. More...
 
class  unorm8
 Represents numbers on [0, 1] in 8 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL. 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  Vector2int16
 
A Vector2 that packs its fields into G3D::int16 s. More...
 
class  Vector2int32
 
A Vector2 that packs its fields into int32s. More...
 
class  Vector2uint16
 
A Vector2 that packs its fields into G3D::uint16 s. More...
 
class  Vector2uint32
 
A Vector2 that packs its fields into int32s. More...
 
class  Vector2unorm16
 
A Vector2 that packs its fields into G3D::unorm16s. More...
 
class  Vector3
 
3x1 or 1x3 vector using float32 representation. More...
 
class  Vector3int16
 
A Vector3 that packs its fields into uint16s. More...
 
class  Vector3int32
 
\ Vector3int32 A Vector3 that packs its fields into uint32s. More...
 
class  Vector3uint8
 
class  Vector4
 
Do not subclass– this implementation makes assumptions about the memory layout. More...
 
class  Vector4int16
 
class  Vector4int32
 
\ Vector4int32 A Vector4 that packs its fields into int32s. More...
 
class  Vector4int8
 
Homogeneous vector stored efficiently in four signed int8s. More...
 
class  Vector4uint16
 
class  Vector4uint8
 
class  Vector4unorm8
 
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
 Creates video files such as mp4/h264 from provided frames or textures. More...
 
class  VideoPlayer
 Play videos back at the correct speed and automatically update frame Textur or PixelTransferBuffer. More...
 
class  VideoRecordDialog
 A widget that allows the user to launch recording of the on-screen image to a movie. More...
 
class  VideoStreamClient
 
class  VideoStreamServer
 Server-side class for streaming low-latency lossy video with GPU MPEG encoding. More...
 
class  VisibleEntity
 Base class for Entitys that use a built-in G3D::Model subclass. More...
 
class  VisualizeCameraSurface
 
Displays a 3D representation of a Camera. More...
 
class  VisualizeLightSurface
 
Displays a 3D representation of a Light. More...
 
class  VoxelModel
 
class  VoxelSurface
 A G3D::Surface for voxel rendering. More...
 
class  VRApp
 Application framework for HMD Virtual Reality programs on HTC Vive, Oculus Rift, and Oculus DK2. More...
 
class  VulkanTriTree
 
class  WeakCache
 A cache that does not prevent its members from being garbage collected. More...
 
class  WebServer
 
Web server with support for https and websockets 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  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...
 
class  XR
 Low-level eXtended Reality (AR/VR/MR) API base class, analogous to 2D GUI OSWindow for a VR system. More...
 
class  XRWidget
 A G3D::Widget that manages world-space G3D::MarkerEntitys based on polling a low-level XR instance. More...
 

Typedefs

typedef class Rect2D AABox2D
 
typedef bool(* AssertionHook) (const char *_expression, const String &message, const char *filename, int lineNumber, bool useGuiPrompt)
 
typedef float Biradiance
 
typedef Color3 Biradiance3
 Radiance * measure(Solid Angle) between two points, measured at the receiver orthogonal to the axis between them; W/m^2. More...
 
typedef _BSPMAP::Map BSPMap
 
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 String &)
 
typedef int DebugID
 Used with debugDraw. More...
 
typedef Color3 Energy3
 Force * distance; J. More...
 
typedef float float32
 
typedef double float64
 
typedef shared_ptr< class GConsoleGConsoleRef
 
typedef HGLRC GLContext
 
OpenGL context (argument to glMakeCurrent, return value of glGetCurrentContext). More...
 
typedef shared_ptr< class Image3unorm8Image3unorm8Ref
 
typedef shared_ptr< class Image4Image4Ref
 
typedef shared_ptr< class Image4unorm8Image4unorm8Ref
 
typedef int16_t int16
 
typedef int32_t int32
 
typedef int64_t int64
 
typedef int8_t int8
 
typedef float Irradiance
 
typedef Color3 Irradiance3
 Incident power per area; W/m^2. More...
 
typedef shared_ptr< class LightweightConduitLightweightConduitRef
 
typedef Table< String, lazy_ptr< Model > > ModelTable
 
typedef uint32 NetChannel
 Messages sent on different channels are asynchronous. More...
 
typedef shared_ptr< class NetListenerNetListenerRef
 
typedef uint32 NetMessageType
 
Application defined message type. More...
 
typedef PhysicsFrame PFrame
 
using Point2 = Vector2
 
typedef Vector2int16 Point2int16
 
typedef Vector2int32 Point2int32
 
typedef Vector2uint16 Point2uint16
 
typedef Vector2uint32 Point2uint32
 
typedef Vector2unorm16 Point2unorm16
 
typedef Vector3 Point3
 
Points are technically distinct mathematical entities from vectors. More...
 
typedef Vector3int16 Point3int16
 
typedef Vector3int32 Point3int32
 
typedef Vector3uint8 Point3uint8
 
typedef Vector4int32 Point4int32
 
typedef float Power
 
typedef Color3 Power3
 Energy per time; W. More...
 
typedef Spline< Power3Power3Spline
 
typedef Vector4 ProjInfo
 
typedef float Radiance
 
typedef Color3 Radiance3
 Power per (measure(SolidAngle) * measure(Area)); W / (m^2 sr) More...
 
typedef float Radiosity
 
typedef Color3 Radiosity3
 Power per area; J / m^2. More...
 
typedef double RealTime
 
Actual wall clock time in seconds (Unix time). More...
 
typedef shared_ptr< class ReliableConduitReliableConduitRef
 
typedef float SimTime
 
Time, in seconds in a simulation. More...
 
typedef std::string String
 
typedef ImageFormat TextureFormat
 
typedef shared_ptr< class ThirdPersonManipulatorThirdPersonManipulatorRef
 
typedef uint16_t uint16
 
typedef uint32_t uint32
 
typedef uint64_t uint64
 
typedef uint8_t uint8
 
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,
  VECTOR4UINT16_BINFMT,
  COLOR3_BINFMT,
  COLOR3UNORM8_BINFMT,
  COLOR3INT16_BINFMT,
  COLOR4_BINFMT,
  COLOR4UNORM8_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 = 0,
  MOVE_TO_GPU = 1,
  COPY_TO_CPU = 2,
  COPY_TO_GPU = 3,
  IMAGE_STORAGE_CURRENT = 4
}
 Used by Component. More...
 
enum  SpawnBehavior {
  USE_NEW_THREAD,
  USE_CURRENT_THREAD
}
 
enum  State {
  RECEIVING,
  HOLDING,
  NO_MESSAGE
}
 

Functions

 ~LightweightConduit ()
 Closes the socket. More...
 
 ~NetListener ()
 
 ~ReliableConduit ()
 Closes the socket. More...
 
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)
 
NetAddress address () const
 The address of the other end of the conduit. More...
 
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. More...
 
bool alphabeticalIgnoringCaseG3DFirstLessThan (const String &a, const String &b)
 Compares a < b ignoring case, but puts names beginning with "G3D" first in a sort. More...
 
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. More...
 
double aSin (double fValue)
 
AssertionHook assertionHook ()
 
double aTan (double fValue)
 
double aTan2 (double fY, double fX)
 
bool beginsWith (const String &test, const String &pattern)
 
Returns true if the test string begins with the pattern string. More...
 
void buildPrefixTree (const Array< String > &list, DepthFirstTreeBuilder< String > &tree)
 Does a depth first traversal of a prefix tree generated from the passed list. More...
 
int32 byteSize (BinaryFormat f)
 Returns -1 if the format is custom, otherwise the byte size of a single element in this format. More...
 
template<class PointerType >
void categorizeByDerivedType (const Array< PointerType > &all, Array< Array< PointerType > > &derivedArray)
 
Separates a large array into subarrays by their typeid(). More...
 
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. More...
 
int ceilPow2 (int in)
 
int ceilPow2 (float in)
 
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)
 
Vector3int32 clamp (const Vector3int32 &v, const Vector3int32 &a, const Vector3int32 &b)
 
int clamp (int val, int low, int hi)
 
double clamp (double val, double low, double hi)
 
float clamp (float val, float low, float hi)
 
bool clientWaiting () const
 True if a client is waiting (i.e. More...
 
String consolePrint (const String &)
 
String consolePrintf (const char *fmt ...)
 Sends output to the log and to the last GConsole instantiated. More...
 
ConsolePrintHook consolePrintHook ()
 
template<class T >
bool contains (const T *array, int len, const T &e)
 Array::contains for C-arrays. More...
 
int countNewlines (const String &s)
 Number of new lines in the given string (handles \r\n and \n). More...
 
FILE * createTempFile ()
 Returns a temporary file that is open for read/write access. More...
 
Vector3 cross (const Vector3 &v1, const Vector3 &v2)
 
template<class YType >
YType cyclicCatmullRomSpline (double t, const YType *controlY, int numPoints)
 See also G3D::Spline. More...
 
template<class YType >
YType cyclicCatmullRomSpline (double t, const Array< YType > &controlY)
 
A cubic spline with regularly spaced control points. More...
 
DebugID debugDraw (const shared_ptr< Shape > &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. More...
 
DebugID debugDraw (const Box &b, float displayTime=0.0f, const Color4 &solidColor=Color3::white(), const Color4 &wireColor=Color3::black(), const CoordinateFrame &cframe=CoordinateFrame())
 overloaded forms of debugDraw so that more common parameters can be passed (e.g Boxes, Spheres) More...
 
DebugID debugDraw (const Array< Vector3 > &vertices, const Array< int > &indices, float displayTime=0.0f, const Color4 &solidColor=Color3::white(), const Color4 &wireColor=Color3::black(), const CoordinateFrame &cframe=CoordinateFrame())
 
DebugID debugDraw (const CPUVertexArray &vertices, const Array< Tri > &tris, float displayTime=0.0f, const Color4 &solidColor=Color3::white(), const Color4 &wireColor=Color3::black(), const CoordinateFrame &cframe=CoordinateFrame())
 
DebugID debugDraw (const Sphere &s, float displayTime=0.0f, const Color4 &solidColor=Color3::white(), const Color4 &wireColor=Color3::black(), const CoordinateFrame &cframe=CoordinateFrame())
 
DebugID debugDraw (const Point3 &p, float displayTime=0.0f, const Color4 &solidColor=Color3::white(), const Color4 &wireColor=Color3::black(), const CoordinateFrame &cframe=CoordinateFrame())
 Drawing of Points implemented as drawing small spheres. More...
 
DebugID debugDraw (const CoordinateFrame &cf, float displayTime=0.0f, const Color4 &solidColor=Color3::white(), const Color4 &wireColor=Color3::black(), const CoordinateFrame &cframe=CoordinateFrame())
 
DebugID debugDrawLabel (const Point3 &wsPos, const Vector3 &csOffset, const GuiText &text, float displayTime=0.0f, float size=0.1f, bool sizeInPixels=false, const GFont::XAlign xalign=GFont::XALIGN_CENTER, const GFont::YAlign yalign=GFont::YALIGN_CENTER)
 Draws a label onto the screen for debug purposes. More...
 
DebugID debugDrawLabel (const Point3 &wsPos, const Vector3 &csOffset, const String &text, const Color3 &color, float displayTime=0.0f, float size=0.1f, bool sizeInPixels=false, const GFont::XAlign xalign=GFont::XALIGN_CENTER, const GFont::YAlign yalign=GFont::YALIGN_CENTER)
 
String debugPrintf (const char *fmt ...)
 Under Visual Studio, appears in the Debug pane of the Output window On Unix-based operating systems the output is sent to stderr. More...
 
void describeSystem (class RenderDevice *rd, class NetworkDevice *nd, class TextOutput &t)
 
Prints a human-readable description of this machine to the text output stream. More...
 
void describeSystem (class RenderDevice *rd, class NetworkDevice *nd, String &s)
 
void deserialize (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 (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 (String &b, TextInput &ti)
 
void deserialize (Vector3 &v, class BinaryInput &b)
 
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) More...
 
double drand48 ()
 
bool endsWith (const String &test, const String &pattern)
 
Returns true if the test string ends with the pattern string. More...
 
template<class EnumClass , class EnumClassValue >
void enumToJavaScriptDeclaration (TextOutput &t)
 
Generates JavaScript source code defining an enum equivalent to EnumClass. More...
 
double eps (double a, double b)
 
Computes an appropriate epsilon for comparing a and b. More...
 
float eps (float a, float b)
 
Quat exp (const Quat &q)
 
AssertionHook failureHook ()
 
String filenameBase (const 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. More...
 
String filenameBaseExt (const String &filename)
 
Returns the part of the filename that includes the base and ext from parseFilename (i.e. More...
 
bool filenameContainsWildcards (const String &filename)
 Returns true if '*' or '?' appears in the string. More...
 
String filenameExt (const String &filename)
 
Returns the extension on a filename. More...
 
String filenamePath (const String &filename)
 
Returns the drive (if Win32) and path from a filename, including a slash if there was one. More...
 
size_t findLastSlash (const String &f, size_t start=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). More...
 
size_t findSlash (const String &f, size_t start=0)
 Finds the index of the first '\' or '/' character, starting at index start. More...
 
float finf ()
 
uint16 flipEndian16 (const uint16 x)
 
Given a 16-bit integer, returns the integer with the bytes in the opposite order. More...
 
uint32 flipEndian32 (const uint32 x)
 
Given a 32-bit integer, returns the integer with the bytes in the opposite order. More...
 
float fnan ()
 
String format (const char *fmt ...)
 Produces a string from arguments of the style of printf. More...
 
float fract (float x)
 
double fract (double x)
 
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. More...
 
bool fuzzyEq (float a, float b)
 
bool fuzzyGe (double a, double b)
 Is a near or greater than b? More...
 
bool fuzzyGt (double a, double b)
 Is a strictly greater than b? (Guaranteed false if a <= b). More...
 
bool fuzzyLe (double a, double b)
 Is a near or less than b? More...
 
bool fuzzyLt (double a, double b)
 Is a strictly less than b? (Guaranteed false if a >= b) More...
 
bool fuzzyNe (double a, double b)
 True if a is definitely not equal to b. More...
 
int g3dfnmatch (const char *pattern, const char *string, int flags)
 
Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. More...
 
void gaussian1D (Array< float > &coeff, int N=5, float std=0.5f)
 
Generates a set of 1D gaussian filter coefficients of size N. More...
 
float gaussRandom (float mean=0.0f, float stdev=1.0f)
 
Normally distributed random number. More...
 
uint32 gcchtonl (uint32)
 
String generateFilenameBase (const String &prefix="", const String &suffix="")
 Creates a unique filename base in the current directory using the specified prefix and suffix. More...
 
String generateFileNameBaseAnySuffix (const String &prefix)
 Creates a unique filename base in the current directory using the specified prefix, though any suffix is possible. More...
 
String getOpenGLState (bool showDisabled=true)
 
Returns all OpenGL state as a formatted string of C++ code that will reproduce that state. More...
 
void glClipToBox (const class AABox &box)
 Configure (and enable) OpenGL clipping planes to clip to the inside of this box. More...
 
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. More...
 
void glDisableAllTextures ()
 Calls glDisable() for all supported texture types: 1D, 2D, 3D, cube, rectangle. More...
 
const char * GLenumToString (GLenum i)
 
Pretty printer for GLenums. More...
 
GLboolean glGetBoolean (GLenum which)
 
A functional version of glGetDoublev More...
 
GLContext glGetCurrentContext ()
 
Returns the current OpenGL context if more than one is in use. More...
 
GLdouble glGetDouble (GLenum which)
 
A functional version of glGetDoublev More...
 
void glGetErrors ()
 Read all errors off the OpenGL stack and ignore them. More...
 
GLfloat glGetFloat (GLenum which)
 
A functional version of glGetFloatv More...
 
GLint glGetInteger (GLenum which)
 
A functional version of glGetIntegerv More...
 
void glGetMatrix (GLenum name, Matrix4 &m)
 
Matrix4 glGetMatrix (GLenum name)
 
void * glGetProcAddress (const char *name)
 Platform independent version of wglGetProcAddress/glXGetProcAddress/NSGLGetProcAddress. More...
 
Vector2 glGetVector2 (GLenum which)
 Safe to call even if the glGet would return more than 2 values. More...
 
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. More...
 
void glLoadMatrix (const CoordinateFrame &cf)
 
Loads a coordinate frame into the current OpenGL matrix slot. More...
 
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. More...
 
void glMultInvMatrix (const CoordinateFrame &cf)
 
Multiplies the current GL matrix slot by the inverse of a matrix. More...
 
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. More...
 
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. More...
 
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)
 
String greatestCommonPrefix (const String a, const String b)
 Finds the greatest common prefix of two strings of ' ', ':', ';', '/', and '\' separated words. More...
 
double halfPi ()
 
void hammersleySequence2D (int i, const int N, float &x, float &y)
 Returns the ith Hammersley point from a N-point sequence on the unit square, [0, 1]. More...
 
int highestBit (uint32 x)
 Returnes the 0-based index of the highest 1 bit from the left. More...
 
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) More...
 
int16 iClamp (int16 val, int16 low, int16 hi)
 
int iFloor (double fValue)
 
Vector4int32 iFloor (const Vector4 &)
 
Vector3int32 iFloor (const Vector3 &)
 
int iMax (int x, int y)
 
int iMin (int x, int y)
 
int iMod3 (int x)
 
Computes x % 3. More...
 
bool inConstSegment (const char *c)
 Returns true if this C string pointer is definitely located in the constant program data segment and does not require memory management. More...
 
double inf ()
 This value should not be tested against directly, instead G3D::isNan() and G3D::isFinite() will return reliable results. More...
 
void initG3D (const G3DSpecification &spec=G3DSpecification())
 
Call from main() to initialize the G3D library state and register shutdown memory managers. More...
 
void initGLG3D (const G3DSpecification &spec=G3DSpecification())
 
Call from main() to initialize the GLG3D library state and register shutdown memory managers. More...
 
int iRound (double fValue)
 Fast round to integer using the lrint routine. More...
 
int iRound (float f)
 Fast round to integer using the lrint routine. More...
 
bool isDigit (const unsigned char c)
 These standard C functions are renamed for clarity/naming conventions and to return bool, not int. More...
 
bool isDigitFast (const unsigned char c)
 Much faster than isDigit in MSVC. More...
 
bool isEven (int num)
 
bool isFinite (double x)
 
Returns true if the argument is a finite real number. More...
 
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. More...
 
bool isNaN (double x)
 
Returns true if the argument is NaN (not a number). More...
 
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. More...
 
template<class T >
bool isNull (const shared_ptr< T > &ptr)
 
template<class T >
bool isNull (const T *ptr)
 
template<class T >
bool isNull (const lazy_ptr< 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. More...
 
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. More...
 
bool isValidIdentifier (const String &s)
 Returns true if s is a valid C identifier. More...
 
bool isValidPointer (const void *x)
 
Returns true if the pointer is likely to be a valid pointer (instead of an arbitrary number). More...
 
bool isWhitespace (const unsigned char c)
 These standard C functions are renamed for clarity/naming conventions and to return bool, not int. More...
 
int iWrap (int val, int hi)
 
Wraps the value to the range [0, hi) (exclusive on the high end). More...
 
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; More...
 
float lerp (float a, float b, float f)
 
float lerpAngle (float a, float b, float t)
 A lerp() for angles in radians that guarantees moving the shortest way around the circle. More...
 
String license ()
 G3D, SDL, and IJG libraries require license documentation to be distributed with your program. More...
 
 LightweightConduit (uint16 receivePort, bool enableReceive, bool enableBroadcast)
 
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. More...
 
Color3 log (const Color3 &c)
 
Computes the log of each component. More...
 
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. More...
 
void logPrintf (const char *fmt,...)
 Prints to the common system log, log.txt, which is usually in the working directory of the program. More...
 
String makeValidIndentifierWithUnderscores (const String &s)
 Replaces invalid characters in a string with underscroes to make the string a valid C identifier. More...
 
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)
 
int maxMessageSize () const
 The maximum length of a message that can be sent (G3D places a small header at the front of each UDP packet; this is already taken into account by the value returned). More...
 
size_t maxNotNPOS (size_t i, size_t j)
 Returns the larger string index, ignoring String::npos. More...
 
virtual bool messageWaiting ()
 The message is actually copied from the socket to an internal buffer during this call. More...
 
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)
 
float mod1 (float t)
 
double mod1 (double t)
 
void msgBox (const String &message, const String &title="Message")
 
Displays a GUI prompt with "Ok" as the only choice. More...
 
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) More...
 
double nan ()
 This value should not be tested against directly, instead G3D::isNan() and G3D::isFinite() will return reliable results. More...
 
 NetListener (uint16 port)
 Port is in host byte order. More...
 
RealTime networkCommunicationInterval ()
 
unsigned int networkSendBacklog ()
 Return the number of network transactions pending across all NetSendConnections. More...
 
int nextMod3 (int i)
 
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) More...
 
template<class T >
bool notNull (const shared_ptr< T > &ptr)
 
template<class T >
bool notNull (const T *ptr)
 
template<class T >
bool notNull (const lazy_ptr< T > &ptr)
 
template<class T >
bool notNull (const Pointer< T > &p)
 
bool ok () const
 
template<class T1 , class T2 >
bool operator!= (const G3DAllocator< T1 > &, const G3DAllocator< T2 > &) throw ()
 
bool operator!= (const NetAddress &a, const NetAddress &b)
 
Color4 operator* (const Color3 &c3, const Color4 &c4)
 
Extends the c3 with alpha = 1.0 More...
 
G3D::Color3 operator* (float s, const G3D::Color3 &c)
 
G3D::Color3 operator* (G3D::Color1 &s, const G3D::Color3 &c)
 
Vector2 operator* (double s, const Vector2 &v)
 
G3D::Color3 operator* (const G3D::Color3 &c, G3D::Color1 &s)
 
Vector2 operator* (float s, const Vector2 &v)
 
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 More...
 
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)
 
G3D::Color3 operator/ (float s, const G3D::Color3 &c)
 
std::ostream & operator<< (std::ostream &os, const NetAddress &)
 
std::ostream & operator<< (std::ostream &os, const Vector3 &)
 
template<class T1 , class T2 >
bool operator== (const G3DAllocator< T1 > &, const G3DAllocator< T2 > &) throw ()
 
bool operator== (const NetAddress &a, const NetAddress &b)
 
Two addresses may point to the same computer but be != because they have different IP's. More...
 
void parseCommaSeparated (const String s, Array< String > &array, bool stripQuotes=true)
 Separates a comma-separated line, properly escaping commas within double quotes (") and super quotes ("""). More...
 
void parseFilename (const String &filename, String &drive, Array< String > &path, String &base, String &ext)
 Parses a filename into four useful pieces. More...
 
String pathConcat (const String &dirname, const String &file)
 Appends file onto dirname, ensuring a / if needed. More...
 
double pi ()
 
float pif ()
 
int pow2 (unsigned int x)
 Returns 2^x. More...
 
template<class T >
pow5 (T x)
 Returns x5 More...
 
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. More...
 
int prompt (const char *windowTitle, const char *promptx, const char **choice, int numChoices)
 Prints a prompt and waits for user input. More...
 
String readWholeFile (const String &filename)
 Returns the contents of a text file as a single string. More...
 
template<typename T >
bool receive (T &message)
 If a message is waiting, deserializes the waiting message into message and returns true, otherwise returns false. More...
 
void receive ()
 Removes the current message from the queue. More...
 
bool receive (NetAddress &sender)
 
template<typename T >
bool receive (NetAddress &sender, T &message)
 
void receiveHeader ()
 Receives the messageType and messageSize from the socket. More...
 
void receiveIntoBuffer ()
 Accumulates whatever part of the message (not the header) is still waiting on the socket into the receiveBuffer during state = RECEIVING mode. More...
 
 ReliableConduit (const NetAddress &addr)
 
 ReliableConduit (const SOCKET &sock, const NetAddress &addr)
 
String replace (const String &s, const String &pattern, const String &replacement)
 Returns a string which is s, with all instances of pattern replaced. More...
 
double round (double f)
 
float round (float f)
 
int roundStochastically (float f)
 Rounds so that the mean of a set of rounded numbers is close to the mean of the original numbers. More...
 
float rsq (float x)
 
Computes 1 / sqrt(x). More...
 
double rsqrt (double x)
 
float rsqrt (float x)
 
void runConcurrently (const Point3int32 &start, const Point3int32 &stopBefore, const std::function< void(Point3int32)> &callback, bool singleThread=false)
 Iterates over a 3D region using multiple threads and blocks until all threads have completed. More...
 
void runConcurrently (const Point2int32 &start, const Point2int32 &stopBefore, const std::function< void(Point2int32)> &callback, bool singleThread=false)
 
void runConcurrently (const int &start, const int &stopBefore, const std::function< void(int)> &callback, bool singleThread=false)
 
void runConcurrently (const size_t &start, const size_t &stopBefore, const std::function< void(size_t)> &callback, bool singleThread=false)
 
void screenPrintf (const char *fmt ...)
 Displays output on the last G3D::GApp instantiated. More...
 
void screenPrintf (const String &t ...)
 
template<typename T >
void send (uint32 type, const T &message)
 
Serializes the message and schedules it to be sent as soon as possible, and then returns immediately. More...
 
void send (uint32 type)
 Sends an empty message with the given type. More...
 
template<typename T >
void send (const NetAddress &a, uint32 type, const T &msg)
 
template<typename T >
void send (const Array< NetAddress > &a, uint32 type, const T &m)
 Send the same message to multiple addresses (only serializes once). More...
 
void sendBuffer (const BinaryOutput &b)
 
void sendBuffer (const NetAddress &a, BinaryOutput &b)
 
void serialize (const 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 More...
 
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 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)
 
template<typename T >
void serializeMessage (uint32 type, const T &m, BinaryOutput &b) const
 
void serviceNetwork ()
 If NOT using G3D's internal threaded networking, you must invoke this periodically to service the receiving side network connections. More...
 
void serviceNetworkSender (const G3D::NetChannel &channel)
 If NOT using G3D's internal threaded networking, you must invoke this periodically to service the sending side network connections. More...
 
void setAssertionHook (AssertionHook hook)
 
Allows customization of the global function invoked when a debugAssert fails. More...
 
void setCocoaIcon (const char *filename)
 
void setConsolePrintHook (ConsolePrintHook h)
 Called by consolePrintf after the log and terminal have been written to. More...
 
void setFailureHook (AssertionHook hook)
 
Called by alwaysAssertM in case of failure in release mode. More...
 
void setNetworkCommunicationInterval (const RealTime t)
 
This is the amount of time G3D will pause the network thread to perform network communication, in seconds (default is 0s). More...
 
Vector2 sign (const Vector2 &v)
 
Vector3 sign (const Vector3 &v)
 
Vector4 sign (const Vector4 &v)
 
double sign (double fValue)
 
float sign (float x)
 
float signedPow (float b, float e)
 Computes |b|^e * sign(b) More...
 
double signedPow (double b, double e)
 Computes |b|^e * sign(b) More...
 
double sinc (double x)
 
sin(x)/x More...
 
int sizeOfGLFormat (GLenum format)
 
Returns the number of bytes occupied by a value in an OpenGL format (e.g. More...
 
float smootherstep (float edge0, float edge1, float x)
 Perlin's C2 continous variation on smoothstep() More...
 
float smoothstep (float edge0, float edge1, float x)
 The GLSL smoothstep function. More...
 
Array< StringsplitLines (const String &s)
 Splits string at new lines (handles \r\n and \n). More...
 
double square (double fValue)
 
float square (float x)
 
int square (int x)
 
Vector2 squareMagnitude (const Vector2 &x)
 Preserves sign while squaring magnitude. More...
 
Vector3 squareMagnitude (const Vector3 &x)
 Preserves sign while squaring magnitude. More...
 
float squareMagnitude (float x)
 Preserves sign while squaring magnitude. More...
 
double squareMagnitude (double x)
 Preserves sign while squaring magnitude. More...
 
int squareMagnitude (int x)
 Preserves sign while squaring magnitude. More...
 
int stringCompare (const String &s1, const String &s2)
 
A comparison function for passing to Array::sort. More...
 
String stringJoin (const G3D::Array< String > &a, char joinChar)
 
joinChar is not inserted at the beginning or end, just in between elements. More...
 
String stringJoin (const G3D::Array< String > &a, const String &joinStr)
 
int stringPtrCompare (const String *s1, const String *s2)
 
Array< StringstringSplit (const String &x, char splitChar)
 
Splits x at each occurance of splitChar. More...
 
void stringSplit (const String &x, char splitChar, Array< String > &out)
 
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. More...
 
void System_free (void *)
 
void * System_malloc (size_t)
 
void tesselateComplexPolygon (const Array< Vector3 > &input, Array< Triangle > &output)
 
Tesselates a complex polygon into a triangle set which is appended to the output. More...
 
double toDegrees (double rad)
 
float toDegrees (float rad)
 
float toDegrees (int rad)
 
String toLower (const 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. More...
 
SimTime toSeconds (int hour, int minute, AMPM ap)
 
String toUpper (const String &x)
 
Returns a new string that is an uppercase version of x. More...
 
void toUTF8 (const String &s, Array< char > &result)
 Convert from ASCII to utf-8 encoding, adapted from https://everything2.com/title/Converting+ASCII+to+UTF-8. More...
 
String trimWhitespace (const String &s)
 
Strips whitespace from both ends of the string. More...
 
double twoPi ()
 
unsigned int uiClamp (unsigned int val, unsigned int low, unsigned int hi)
 
float uniformRandom (float low, float hi)
 
double uniformRandomD (double low, double hi)
 
String vformat (const char *fmt, va_list argPtr)
 Like format, but can be called with the argument list from a ... More...
 
ReliableConduitRef waitForConnection ()
 Block until a connection is received. More...
 
virtual uint32 waitingMessageType ()
 
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 More...
 
String wordWrap (const 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. More...
 
float wrap (float t, float lo, float hi)
 
Computes a floating point modulo; the result is t wrapped to the range [lo, hi). More...
 
float wrap (float t, float hi)
 
double wrap (double t, double lo, double hi)
 
double wrap (double t, double hi)
 
void writeWholeFile (const String &filename, const String &str, bool flush=true)
 
More...
 
bool zipfileExists (const String &filename, String &outZipfile, String &outInternalFile)
 
Returns true if the given file (or directory) exists within a zipfile. More...
 
bool zipfileExists (const String &filename)
 

Variables

NetAddress addr
 
bool alreadyReadMessage
 
True when waitingForMessageType has read the message from the network into messageType/messageStream. More...
 
const bool DONT_SHRINK_UNDERLYING_ARRAY = false
 
Constant for passing to Array::resize More...
 
bool ignoreBool
 
double ignoreDouble
 For use with default output arguments. More...
 
float ignoreFloat
 For use with default output arguments. More...
 
int ignoreInt
 For use with default output arguments. More...
 
String ignoreString
 For use with default output arguments. More...
 
Array< uint8messageBuffer
 
The message received (the type has already been read off). More...
 
NetAddress messageSender
 
Origin of the received message. More...
 
uint32 messageSize
 
Total size of the incoming message (read from the header). More...
 
uint32 messageType
 
Type of the incoming message. More...
 
int MTU
 Maximum transmission unit (packet size in bytes) for this socket. More...
 
const char * NEWLINE
 
HDC OpenGLWindowHDC
 The HDC that wglMakeCurrent will use on Windows. More...
 
void * receiveBuffer
 Shared buffer for receiving messages. More...
 
size_t receiveBufferTotalSize
 Total size of the receiveBuffer. More...
 
size_t receiveBufferUsedSize
 Size occupied by the current message... More...
 
SOCKET sock
 
const int SORT_DECREASING = -1
 Constant for Array::sort. More...
 
const int SORT_INCREASING = 1
 Constant for Array::sort. More...
 
enum G3D::State state
 

Typedef Documentation

◆ AABox2D

◆ AssertionHook

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

◆ Biradiance

typedef float G3D::Biradiance

◆ Biradiance3

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

◆ BSPMap

◆ CFrame

◆ CoherentAllocator

◆ CompassBearing

◆ Component1

◆ Component3

◆ Component4

◆ ConsolePrintHook

typedef void(* G3D::ConsolePrintHook) (const String &)

◆ DebugID

typedef int G3D::DebugID

Used with debugDraw.

◆ Energy3

Force * distance; J.

◆ float32

typedef float G3D::float32

◆ float64

typedef double G3D::float64

◆ GConsoleRef

typedef shared_ptr<class GConsole> G3D::GConsoleRef

◆ GLContext

typedef HGLRC G3D::GLContext


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

◆ Image3unorm8Ref

typedef shared_ptr<class Image3unorm8> G3D::Image3unorm8Ref

◆ Image4Ref

typedef shared_ptr<class Image4> G3D::Image4Ref

◆ Image4unorm8Ref

typedef shared_ptr<class Image4unorm8> G3D::Image4unorm8Ref

◆ int16

typedef int16_t G3D::int16

◆ int32

typedef int32_t G3D::int32

◆ int64

typedef int64_t G3D::int64

◆ int8

typedef int8_t G3D::int8

◆ Irradiance

typedef float G3D::Irradiance

◆ Irradiance3

Incident power per area; W/m^2.

◆ LightweightConduitRef

◆ ModelTable

◆ NetChannel

Messages sent on different channels are asynchronous.

This is a way to send out-of-band information, such as transferring a giant file on one channel while sending small object updates on another.

See also
G3D::NetSendConnection::send

◆ NetListenerRef

typedef shared_ptr<class NetListener> G3D::NetListenerRef

◆ NetMessageType


Application defined message type.

See also
G3D::NetSendConnection::send

◆ PFrame

◆ Point2

using G3D::Point2 = typedef Vector2

◆ Point2int16

◆ Point2int32

◆ Point2uint16

◆ Point2uint32

◆ Point2unorm16

◆ Point3


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.

◆ Point3int16

◆ Point3int32

◆ Point3uint8

◆ Point4int32

◆ Power

typedef float G3D::Power

◆ Power3

Energy per time; W.

◆ Power3Spline

◆ ProjInfo

◆ Radiance

typedef float G3D::Radiance

◆ Radiance3

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

◆ Radiosity

typedef float G3D::Radiosity

◆ Radiosity3

Power per area; J / m^2.

◆ RealTime

typedef double G3D::RealTime


Actual wall clock time in seconds (Unix time).

◆ ReliableConduitRef

typedef shared_ptr<class ReliableConduit> G3D::ReliableConduitRef

◆ SimTime

typedef float G3D::SimTime


Time, in seconds in a simulation.

Relatively low precision compared to RealTime.

◆ String

typedef std::string G3D::String

◆ TextureFormat

◆ ThirdPersonManipulatorRef

◆ uint16

typedef uint16_t G3D::uint16

◆ uint32

typedef uint32_t G3D::uint32

◆ uint64

typedef uint64_t G3D::uint64

◆ uint8

typedef uint8_t G3D::uint8

◆ VAR

◆ VertexRange

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

General keyboard/mouse state definitions.

Deprecated:
Use GButtonState
Enumerator
SDL_PRESSED 
SDL_RELEASED 

◆ anonymous enum

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

anonymous enum
Deprecated:
Enumerator
SECOND 
MINUTE 
HOUR 
DAY 
SUNRISE 
SUNSET 
MIDNIGHT 
METER 
KILOMETER 

◆ AMPM

enum G3D::AMPM
Enumerator
AM 
PM 

◆ BinaryFormat


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 
VECTOR4UINT16_BINFMT 
COLOR3_BINFMT 
COLOR3UNORM8_BINFMT 
COLOR3INT16_BINFMT 
COLOR4_BINFMT 
COLOR4UNORM8_BINFMT 
COLOR4INT16_BINFMT 
STRING_BINFMT 
STRINGEVEN_BINFMT 
STRING8_BINFMT 
STRING16_BINFMT 
STRING32_BINFMT 
CHUNK_BINFMT 
CUSTOM_BINFMT 
LAST_BINFMT 

◆ G3DEndian


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 

◆ ImageStorage

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.

◆ SpawnBehavior

Enumerator
USE_NEW_THREAD 
USE_CURRENT_THREAD 

◆ State

enum G3D::State
Enumerator
RECEIVING 
HOLDING 
NO_MESSAGE 

Function Documentation

◆ ~LightweightConduit()

G3D::~LightweightConduit ( )

Closes the socket.

◆ ~NetListener()

G3D::~NetListener ( )

◆ ~ReliableConduit()

G3D::~ReliableConduit ( )

Closes the socket.

◆ abs() [1/4]

Vector2 G3D::abs ( const Vector2 v)
inline

◆ abs() [2/4]

Vector3 G3D::abs ( const Vector3 v)
inline

◆ abs() [3/4]

Vector4 G3D::abs ( const Vector4 v)
inline

◆ abs() [4/4]

double G3D::abs ( double  fValue)
inline

◆ aCos()

double G3D::aCos ( double  fValue)
inline

◆ acos()

float G3D::acos ( float  fValue)
inline

Referenced by aCos().

◆ address()

NetAddress G3D::address ( ) const

The address of the other end of the conduit.

◆ all() [1/4]

bool G3D::all ( const Vector2 v)
inline

◆ all() [2/4]

bool G3D::all ( const Vector3 v)
inline

◆ all() [3/4]

bool G3D::all ( const Vector4 v)
inline

◆ all() [4/4]

bool G3D::all ( float  x)
inline


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

Referenced by categorizeByDerivedType(), and glsl::screenSpaceRayTrace_glsl::numLayers().

◆ alphabeticalIgnoringCaseG3DFirstLessThan()

bool G3D::alphabeticalIgnoringCaseG3DFirstLessThan ( const String a,
const String b 
)

Compares a < b ignoring case, but puts names beginning with "G3D" first in a sort.

See also
Array::sort

◆ any() [1/4]

bool G3D::any ( const Vector2 v)
inline

◆ any() [2/4]

bool G3D::any ( const Vector3 v)
inline

◆ any() [3/4]

bool G3D::any ( const Vector4 v)
inline

◆ any() [4/4]

bool G3D::any ( float  x)
inline

◆ aSin()

double G3D::aSin ( double  fValue)
inline

◆ assertionHook()

AssertionHook G3D::assertionHook ( )

◆ aTan()

double G3D::aTan ( double  fValue)
inline

◆ aTan2()

double G3D::aTan2 ( double  fY,
double  fX 
)
inline

◆ beginsWith()

bool G3D::beginsWith ( const String test,
const String pattern 
)


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

◆ buildPrefixTree()

void G3D::buildPrefixTree ( const Array< String > &  list,
DepthFirstTreeBuilder< String > &  tree 
)

Does a depth first traversal of a prefix tree generated from the passed list.

The list must be sorted alphabetically.

Parameters
listalphabetically sorted list of strings
treedepth first tree traversal, providing functions enterChild(n) and goToParent()

◆ byteSize()

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< Color4unorm8 >::x().

◆ categorizeByDerivedType()

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(all, skyboxArray, derivedArray);

◆ ceilPow2() [1/3]

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.

Referenced by ceilPow2(), and G3D::FastPODTable< Key, Value, HashFunc, EqualsFunc, valueIsSimplePOD >::clear().

◆ ceilPow2() [2/3]

int G3D::ceilPow2 ( int  in)
inline

◆ ceilPow2() [3/3]

int G3D::ceilPow2 ( float  in)
inline

◆ clamp() [1/7]

Vector2 G3D::clamp ( const Vector2 v,
const Vector2 a,
const Vector2 b 
)
inline

◆ clamp() [2/7]

Vector3 G3D::clamp ( const Vector3 v,
const Vector3 a,
const Vector3 b 
)
inline

◆ clamp() [3/7]

Vector4 G3D::clamp ( const Vector4 v,
const Vector4 a,
const Vector4 b 
)
inline

◆ clamp() [4/7]

Vector3int32 G3D::clamp ( const Vector3int32 v,
const Vector3int32 a,
const Vector3int32 b 
)
inline

◆ clamp() [5/7]

int G3D::clamp ( int  val,
int  low,
int  hi 
)
inline

◆ clamp() [6/7]

double G3D::clamp ( double  val,
double  low,
double  hi 
)
inline

◆ clamp() [7/7]

float G3D::clamp ( float  val,
float  low,
float  hi 
)
inline

◆ clientWaiting()

bool G3D::clientWaiting ( ) const

True if a client is waiting (i.e.

waitForConnection will return immediately).

◆ consolePrint()

String G3D::consolePrint ( const String )

◆ consolePrintf()

String 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()

ConsolePrintHook G3D::consolePrintHook ( )

◆ contains()

template<class T >
bool G3D::contains ( const T *  array,
int  len,
const T &  e 
)

◆ countNewlines()

int G3D::countNewlines ( const String s)
inline

Number of new lines in the given string (handles \r\n and \n).

◆ createTempFile()

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.

◆ cross()

Vector3 G3D::cross ( const Vector3 v1,
const Vector3 v2 
)
inline

◆ cyclicCatmullRomSpline() [1/2]

template<class YType >
YType G3D::cyclicCatmullRomSpline ( double  t,
const YType *  controlY,
int  numPoints 
)

See also G3D::Spline.

Referenced by cyclicCatmullRomSpline().

◆ cyclicCatmullRomSpline() [2/2]

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/

◆ debugDraw() [1/7]

DebugID G3D::debugDraw ( const shared_ptr< Shape > &  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)));
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

◆ debugDraw() [2/7]

DebugID G3D::debugDraw ( const Box b,
float  displayTime = 0.0f,
const Color4 solidColor = Color3::white(),
const Color4 wireColor = Color3::black(),
const CoordinateFrame cframe = CoordinateFrame() 
)

overloaded forms of debugDraw so that more common parameters can be passed (e.g Boxes, Spheres)

◆ debugDraw() [3/7]

DebugID G3D::debugDraw ( const Array< Vector3 > &  vertices,
const Array< int > &  indices,
float  displayTime = 0.0f,
const Color4 solidColor = Color3::white(),
const Color4 wireColor = Color3::black(),
const CoordinateFrame cframe = CoordinateFrame() 
)

◆ debugDraw() [4/7]

DebugID G3D::debugDraw ( const CPUVertexArray vertices,
const Array< Tri > &  tris,
float  displayTime = 0.0f,
const Color4 solidColor = Color3::white(),
const Color4 wireColor = Color3::black(),
const CoordinateFrame cframe = CoordinateFrame() 
)

◆ debugDraw() [5/7]

DebugID G3D::debugDraw ( const Sphere s,
float  displayTime = 0.0f,
const Color4 solidColor = Color3::white(),
const Color4 wireColor = Color3::black(),
const CoordinateFrame cframe = CoordinateFrame() 
)

◆ debugDraw() [6/7]

DebugID G3D::debugDraw ( const Point3 p,
float  displayTime = 0.0f,
const Color4 solidColor = Color3::white(),
const Color4 wireColor = Color3::black(),
const CoordinateFrame cframe = CoordinateFrame() 
)

Drawing of Points implemented as drawing small spheres.

◆ debugDraw() [7/7]

DebugID G3D::debugDraw ( const CoordinateFrame cf,
float  displayTime = 0.0f,
const Color4 solidColor = Color3::white(),
const Color4 wireColor = Color3::black(),
const CoordinateFrame cframe = CoordinateFrame() 
)

◆ debugDrawLabel() [1/2]

DebugID G3D::debugDrawLabel ( const Point3 wsPos,
const Vector3 csOffset,
const GuiText text,
float  displayTime = 0.0f,
float  size = 0.1f,
bool  sizeInPixels = false,
const GFont::XAlign  xalign = GFont::XALIGN_CENTER,
const GFont::YAlign  yalign = GFont::YALIGN_CENTER 
)

Draws a label onto the screen for debug purposes.

◆ debugDrawLabel() [2/2]

DebugID G3D::debugDrawLabel ( const Point3 wsPos,
const Vector3 csOffset,
const String text,
const Color3 color,
float  displayTime = 0.0f,
float  size = 0.1f,
bool  sizeInPixels = false,
const GFont::XAlign  xalign = GFont::XALIGN_CENTER,
const GFont::YAlign  yalign = GFont::YALIGN_CENTER 
)

◆ debugPrintf()

String G3D::debugPrintf ( const char *  fmt ...)

Under Visual Studio, appears in the Debug pane of the Output window 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 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(), and G3D::Table< String, double >::debugPrintStatus().

◆ describeSystem() [1/2]

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 nullptr.

◆ describeSystem() [2/2]

void G3D::describeSystem ( class RenderDevice rd,
class NetworkDevice nd,
String s 
)

◆ deserialize() [1/17]

void G3D::deserialize ( String s,
BinaryInput b 
)
inline

◆ deserialize() [2/17]

void G3D::deserialize ( int32 i,
BinaryInput b 
)
inline

◆ deserialize() [3/17]

void G3D::deserialize ( uint32 i,
BinaryInput b 
)
inline

◆ deserialize() [4/17]

void G3D::deserialize ( bool &  i,
BinaryInput b 
)
inline

◆ deserialize() [5/17]

void G3D::deserialize ( float32 f,
BinaryInput b 
)
inline

◆ deserialize() [6/17]

void G3D::deserialize ( float64 f,
BinaryInput b 
)
inline

◆ deserialize() [7/17]

template<typename T >
void G3D::deserialize ( Array< T > &  array,
BinaryInput b 
)

◆ deserialize() [8/17]

void G3D::deserialize ( Vector2 v,
class BinaryInput b 
)

◆ deserialize() [9/17]

void G3D::deserialize ( Vector3::Axis a,
class BinaryInput bo 
)

◆ deserialize() [10/17]

void G3D::deserialize ( Vector4 v,
class BinaryInput b 
)

◆ deserialize() [11/17]

void G3D::deserialize ( bool &  b,
TextInput ti 
)

◆ deserialize() [12/17]

void G3D::deserialize ( int &  b,
TextInput ti 
)

◆ deserialize() [13/17]

void G3D::deserialize ( uint8 b,
TextInput ti 
)

◆ deserialize() [14/17]

void G3D::deserialize ( double &  b,
TextInput ti 
)

◆ deserialize() [15/17]

void G3D::deserialize ( float &  b,
TextInput ti 
)

◆ deserialize() [16/17]

void G3D::deserialize ( String b,
TextInput ti 
)

◆ deserialize() [17/17]

void G3D::deserialize ( Vector3 v,
class BinaryInput b 
)

◆ determinant() [1/2]

double G3D::determinant ( const Matrix3 m)
inline

◆ determinant() [2/2]

double G3D::determinant ( const Matrix4 m)
inline

◆ distance() [1/4]

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

◆ distance() [2/4]

double G3D::distance ( double  x,
double  y,
double  z 
)
inline

◆ distance() [3/4]

float G3D::distance ( float  x,
float  y 
)
inline

◆ distance() [4/4]

float G3D::distance ( float  x,
float  y,
float  z 
)
inline

◆ dot() [1/4]

float G3D::dot ( const Vector2 a,
const Vector2 b 
)
inline

◆ dot() [2/4]

float G3D::dot ( const Vector3 a,
const Vector3 b 
)
inline

◆ dot() [3/4]

float G3D::dot ( const Vector4 a,
const Vector4 b 
)
inline

◆ dot() [4/4]

float G3D::dot ( float  a,
float  b 
)
inline

◆ drand48()

double G3D::drand48 ( )
inline

◆ endsWith()

bool G3D::endsWith ( const String test,
const String pattern 
)


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

◆ enumToJavaScriptDeclaration()

template<class EnumClass , class EnumClassValue >
void G3D::enumToJavaScriptDeclaration ( TextOutput t)


Generates JavaScript source code defining an enum equivalent to EnumClass.

TextOutput t("WrapMode.js");
enumToJavaScriptDeclaration<WrapMode, WrapMode::Value>(t);
t.commit();

◆ eps() [1/2]

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().

◆ eps() [2/2]

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

◆ exp()

Quat G3D::exp ( const Quat q)
inline

◆ failureHook()

AssertionHook G3D::failureHook ( )

◆ filenameBase()

String G3D::filenameBase ( const 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.

◆ filenameBaseExt()

String G3D::filenameBaseExt ( const 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).

◆ filenameContainsWildcards()

bool G3D::filenameContainsWildcards ( const String filename)

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

◆ filenameExt()

String G3D::filenameExt ( const String filename)


Returns the extension on a filename.

◆ filenamePath()

String G3D::filenamePath ( const String filename)


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

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

◆ findLastSlash()

size_t G3D::findLastSlash ( const String f,
size_t  start = 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

◆ findSlash()

size_t G3D::findSlash ( const 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

◆ finf()

float G3D::finf ( )

◆ flipEndian16()

uint16 G3D::flipEndian16 ( const uint16  x)
inline


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

◆ flipEndian32()

uint32 G3D::flipEndian32 ( const uint32  x)
inline


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

◆ fnan()

float G3D::fnan ( )

◆ format()

String 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::GBuffer::Specification::memorySize(), G3D::Array< G3D::AABox >::operator[](), G3D::GuiNumberBox< int >::precision(), serializeMessage(), G3D::Image::set(), G3D::Map2D< Color1, Color1 >::slowGet(), G3D::Framebuffer::texture(), G3D::GuiNumberBox< int >::updateText(), and G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::verifyNode().

◆ fract() [1/2]

float G3D::fract ( float  x)
inline

◆ fract() [2/2]

double G3D::fract ( double  x)
inline

◆ fuzzyEq() [1/2]

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

◆ fuzzyEq() [2/2]

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

◆ fuzzyGe()

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

Is a near or greater than b?

◆ fuzzyGt()

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

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

(Possibly false if a > b)

◆ fuzzyLe()

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

Is a near or less than b?

◆ fuzzyLt()

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

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

◆ fuzzyNe()

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::Vector4::fuzzyNe(), G3D::Vector3::fuzzyNe(), G3D::Color4::fuzzyNe(), and G3D::Color3::fuzzyNe().

◆ g3dfnmatch()

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

◆ gaussian1D()

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)

◆ gaussRandom()

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


Normally distributed random number.

Deprecated:
See also
Random::gaussian

◆ gcchtonl()

uint32 G3D::gcchtonl ( uint32  x)
inline

◆ generateFilenameBase()

String G3D::generateFilenameBase ( const String prefix = "",
const String suffix = "" 
)

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

◆ generateFileNameBaseAnySuffix()

String G3D::generateFileNameBaseAnySuffix ( const String prefix)

Creates a unique filename base in the current directory using the specified prefix, though any suffix is possible.

◆ getOpenGLState()

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: {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).

◆ glClipToBox()

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.

◆ glColor() [1/4]

void G3D::glColor ( const G3D::Color3 c)
inline

◆ glColor() [2/4]

void G3D::glColor ( const G3D::Color4 c)
inline

◆ glColor() [3/4]

void G3D::glColor ( float  r,
float  g,
float  b,
float  a 
)
inline

◆ glColor() [4/4]

void G3D::glColor ( float  r,
float  g,
float  b 
)
inline

◆ glDisableAllClipping()

void G3D::glDisableAllClipping ( )

Turn off all OpenGL clipping planes.

◆ glDisableAllTextures()

void G3D::glDisableAllTextures ( )

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

◆ GLenumToString()

const char* G3D::GLenumToString ( GLenum  i)


Pretty printer for GLenums.

Useful for debugging OpenGL code.

◆ glGetBoolean()

GLboolean G3D::glGetBoolean ( GLenum  which)


A functional version of glGetDoublev

◆ glGetCurrentContext()

GLContext G3D::glGetCurrentContext ( )
inline


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

BETA API– subject to change

◆ glGetDouble()

GLdouble G3D::glGetDouble ( GLenum  which)


A functional version of glGetDoublev

◆ glGetErrors()

void G3D::glGetErrors ( )
inline

Read all errors off the OpenGL stack and ignore them.

◆ glGetFloat()

GLfloat G3D::glGetFloat ( GLenum  which)


A functional version of glGetFloatv

◆ glGetInteger()

GLint G3D::glGetInteger ( GLenum  which)


A functional version of glGetIntegerv

◆ glGetMatrix() [1/2]

void G3D::glGetMatrix ( GLenum  name,
Matrix4 m 
)

◆ glGetMatrix() [2/2]

Matrix4 G3D::glGetMatrix ( GLenum  name)

◆ glGetProcAddress()

void* G3D::glGetProcAddress ( const char *  name)

Platform independent version of wglGetProcAddress/glXGetProcAddress/NSGLGetProcAddress.

◆ glGetVector2()

Vector2 G3D::glGetVector2 ( GLenum  which)

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

◆ glGetVector3()

Vector3 G3D::glGetVector3 ( GLenum  which)

◆ glGetVector4()

Vector4 G3D::glGetVector4 ( GLenum  which)

◆ glLoadInvMatrix()

void G3D::glLoadInvMatrix ( const CoordinateFrame cf)


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

◆ glLoadMatrix() [1/2]

void G3D::glLoadMatrix ( const CoordinateFrame cf)


Loads a coordinate frame into the current OpenGL matrix slot.

◆ glLoadMatrix() [2/2]

void G3D::glLoadMatrix ( const Matrix4 m)

◆ glMakeCurrent()

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.

◆ glMultInvMatrix()

void G3D::glMultInvMatrix ( const CoordinateFrame cf)


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

◆ glMultiTexCoord() [1/6]

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

Referenced by glMultiTexCoord().

◆ glMultiTexCoord() [2/6]

void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector2 v 
)
inline

◆ glMultiTexCoord() [3/6]

void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector2int16 v 
)
inline

◆ glMultiTexCoord() [4/6]

void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector3 v 
)
inline

◆ glMultiTexCoord() [5/6]

void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector3int16 v 
)
inline

◆ glMultiTexCoord() [6/6]

void G3D::glMultiTexCoord ( GLint  unit,
const G3D::Vector4 v 
)
inline

◆ glMultMatrix()

void G3D::glMultMatrix ( const CoordinateFrame cf)


Multiplies the current GL matrix slot by this matrix.

◆ glNormal()

void G3D::glNormal ( const G3D::Vector3 n)
inline

◆ glTexCoord() [1/4]

void G3D::glTexCoord ( const G3D::Vector4 t)
inline

◆ glTexCoord() [2/4]

void G3D::glTexCoord ( const G3D::Vector3 t)
inline

◆ glTexCoord() [3/4]

void G3D::glTexCoord ( const G3D::Vector2 t)
inline

◆ glTexCoord() [4/4]

void G3D::glTexCoord ( const float  t)
inline

◆ glToScreen()

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.

◆ glVertex() [1/5]

void G3D::glVertex ( const G3D::Vector2 v)
inline

◆ glVertex() [2/5]

void G3D::glVertex ( const G3D::Vector2int16 v)
inline

◆ glVertex() [3/5]

void G3D::glVertex ( const G3D::Vector3 v)
inline

◆ glVertex() [4/5]

void G3D::glVertex ( const G3D::Vector3int16 v)
inline

◆ glVertex() [5/5]

void G3D::glVertex ( const G3D::Vector4 v)
inline

◆ greatestCommonPrefix()

String G3D::greatestCommonPrefix ( const String  a,
const String  b 
)
inline

Finds the greatest common prefix of two strings of ' ', ':', ';', '/', and '\' separated words.

Parameters
aconst String
bconst String

◆ halfPi()

double G3D::halfPi ( )
inline

Referenced by aSin().

◆ hammersleySequence2D()

void G3D::hammersleySequence2D ( int  i,
const int  N,
float &  x,
float &  y 
)

Returns the ith Hammersley point from a N-point sequence on the unit square, [0, 1].

Referenced by G3D::Vector2::hammersleySequence2D().

◆ highestBit()

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.org

◆ iAbs()

int G3D::iAbs ( int  iValue)
inline

◆ iCeil()

int G3D::iCeil ( double  fValue)
inline

◆ iClamp() [1/2]

int G3D::iClamp ( int  val,
int  low,
int  hi 
)
inline


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

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

◆ iClamp() [2/2]

int16 G3D::iClamp ( int16  val,
int16  low,
int16  hi 
)
inline

◆ iFloor() [1/3]

int G3D::iFloor ( double  fValue)
inline

◆ iFloor() [2/3]

Vector4int32 G3D::iFloor ( const Vector4 )

◆ iFloor() [3/3]

Vector3int32 G3D::iFloor ( const Vector3 )

◆ iMax()

int G3D::iMax ( int  x,
int  y 
)
inline

◆ iMin()

int G3D::iMin ( int  x,
int  y 
)
inline

◆ iMod3()

int G3D::iMod3 ( int  x)
inline


Computes x % 3.

◆ inConstSegment()

bool G3D::inConstSegment ( const char *  c)

Returns true if this C string pointer is definitely located in the constant program data segment and does not require memory management.

Used by G3D::G3DString.

Referenced by G3D::G3DString< INTERNAL_SIZE >::ensureAllocation(), G3D::G3DString< INTERNAL_SIZE >::G3DString(), G3D::G3DString< INTERNAL_SIZE >::inConst(), G3D::G3DString< INTERNAL_SIZE >::operator=(), and G3D::G3DString< INTERNAL_SIZE >::testInvariants().

◆ inf()

double G3D::inf ( )

◆ initG3D()

void G3D::initG3D ( const G3DSpecification spec = G3DSpecification())


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.

◆ initGLG3D()

void G3D::initGLG3D ( const G3DSpecification spec = G3DSpecification())


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

◆ iRound() [1/2]

int G3D::iRound ( double  fValue)
inline

Fast round to integer using the lrint routine.

Typically 6x faster than casting to integer.

Referenced by G3D::Icon::height(), G3D::XML::operator int(), and G3D::Icon::width().

◆ iRound() [2/2]

int G3D::iRound ( float  f)
inline

Fast round to integer using the lrint routine.

Typically 6x faster than casting to integer.

◆ isDigit()

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

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

◆ isDigitFast()

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

Much faster than isDigit in MSVC.

◆ isEven()

bool G3D::isEven ( int  num)
inline

◆ isFinite() [1/2]

bool G3D::isFinite ( double  x)
inline

◆ isFinite() [2/2]

bool G3D::isFinite ( float  x)
inline

◆ iSign() [1/3]

int G3D::iSign ( int  iValue)
inline

Referenced by iSign(), and squareMagnitude().

◆ iSign() [2/3]

int G3D::iSign ( double  fValue)
inline

◆ iSign() [3/3]

int G3D::iSign ( float  f)
inline

◆ isLetter()

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

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

◆ isNaN() [1/4]

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::Quat::isNaN(), G3D::ShadowMap::setPolygonOffset(), sinc(), and G3D::GuiNumberBox< int >::updateText().

◆ isNaN() [2/4]

bool G3D::isNaN ( float  x)

◆ isNaN() [3/4]

bool G3D::isNaN ( int  x)
inline

◆ isNaN() [4/4]

bool G3D::isNaN ( uint64  x)
inline

◆ isNewline()

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

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

◆ isNull() [1/4]

template<class T >
bool G3D::isNull ( const shared_ptr< T > &  ptr)

◆ isNull() [2/4]

template<class T >
bool G3D::isNull ( const T *  ptr)

◆ isNull() [3/4]

template<class T >
bool G3D::isNull ( const lazy_ptr< T > &  ptr)

◆ isNull() [4/4]

template<class T >
bool G3D::isNull ( const Pointer< T > &  p)

◆ isOdd()

bool G3D::isOdd ( int  num)
inline

◆ isPow2() [1/3]

bool G3D::isPow2 ( int  num)
inline

◆ isPow2() [2/3]

bool G3D::isPow2 ( uint64  num)
inline

◆ isPow2() [3/3]

bool G3D::isPow2 ( uint32  x)
inline

◆ isQuote()

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

◆ isSlash()

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

◆ isValidHeapPointer()

bool G3D::isValidHeapPointer ( const void *  x)
inline

◆ isValidIdentifier()

bool G3D::isValidIdentifier ( const String s)

Returns true if s is a valid C identifier.

◆ isValidPointer()

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.

◆ isWhitespace()

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

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

◆ iWrap()

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(), G3D::Map2D< Color1, Color1 >::slowGet(), and G3D::Vector3int32::wrap().

◆ length() [1/4]

float G3D::length ( float  v)
inline

◆ length() [2/4]

float G3D::length ( const Vector2 v)
inline

◆ length() [3/4]

float G3D::length ( const Vector3 v)
inline

◆ length() [4/4]

float G3D::length ( const Vector4 v)
inline

◆ lerp() [1/8]

Vector2 G3D::lerp ( const Vector2 v1,
const Vector2 v2,
float  f 
)
inline

◆ lerp() [2/8]

Vector3 G3D::lerp ( const Vector3 v1,
const Vector3 v2,
float  f 
)
inline

◆ lerp() [3/8]

Vector4 G3D::lerp ( const Vector4 v1,
const Vector4 v2,
float  f 
)
inline

◆ lerp() [4/8]

Color1 G3D::lerp ( const Color1 v1,
const Color1 v2,
float  f 
)
inline

◆ lerp() [5/8]

Color3 G3D::lerp ( const Color3 v1,
const Color3 v2,
float  f 
)
inline

◆ lerp() [6/8]

Color4 G3D::lerp ( const Color4 v1,
const Color4 v2,
float  f 
)
inline

◆ lerp() [7/8]

double G3D::lerp ( double  a,
double  b,
double  f 
)
inline


Returns a + (b - a) * f;

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

◆ lerp() [8/8]

float G3D::lerp ( float  a,
float  b,
float  f 
)
inline

◆ lerpAngle()

float G3D::lerpAngle ( float  a,
float  b,
float  t 
)

A lerp() for angles in radians that guarantees moving the shortest way around the circle.

◆ license()

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

◆ LightweightConduit()

G3D::LightweightConduit ( uint16  receivePort,
bool  enableReceive,
bool  enableBroadcast 
)

◆ linearSpline()

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.

◆ log() [1/2]

Color3 G3D::log ( const Color3 c)
inline


Computes the log of each component.

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

◆ log() [2/2]

Quat G3D::log ( const Quat q)
inline

Referenced by log2().

◆ log2() [1/3]

double G3D::log2 ( double  x)
inline

◆ log2() [2/3]

float G3D::log2 ( float  x)
inline

◆ log2() [3/3]

double G3D::log2 ( int  x)
inline

◆ logLazyPrintf()

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

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

◆ logPrintf()

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.

◆ makeValidIndentifierWithUnderscores()

String G3D::makeValidIndentifierWithUnderscores ( const String s)

Replaces invalid characters in a string with underscroes to make the string a valid C identifier.

◆ max() [1/8]

Vector2 G3D::max ( const Vector2 v1,
const Vector2 v2 
)
inline

◆ max() [2/8]

Vector3 G3D::max ( const Vector3 v1,
const Vector3 v2 
)
inline

◆ max() [3/8]

Vector4 G3D::max ( const Vector4 v1,
const Vector4 v2 
)
inline

◆ max() [4/8]

Color3 G3D::max ( const Color3 v1,
const Color3 v2 
)
inline

◆ max() [5/8]

Color4 G3D::max ( const Color4 v1,
const Color4 v2 
)
inline

◆ max() [6/8]

template<class T >
T G3D::max ( const T &  x,
const T &  y 
)
inline

Referenced by G3D::GuiPane::addNumberBox(), G3D::GuiPane::addRadioButton(), G3D::GuiPane::addSlider(), glsl::BilateralFilter_apply_pix::calculateBilateralWeight(), G3D::Rect2D::center(), G3D::G3DString< INTERNAL_SIZE >::chooseAllocationSize(), glsl::DepthOfField_glsl::circleOfConfusionRadiusPixels(), G3D::FastPointHashGrid< Value, PosFunc >::clear(), glsl::Light_glsl::computeAttenuation(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::computeBounds(), glsl::Light_glsl::computeShading(), G3D::Rect2D::contains(), G3D::Rect2D::corner(), G3D::AttributeArray::createInterleaved(), G3D::FastPointHashGrid< Value, PosFunc >::debugPrintStatistics(), glsl::UniversalMaterial_sample_glsl::dim(), G3D::G3DString< INTERNAL_SIZE >::erase(), G3D::Rect2D::extent(), glsl::Film_FXAA_13_performance_pix::FxaaLuma(), glsl::Film_FXAA_13_performance_pix::FxaaPixelShader(), G3D::FastPODTable< Key, Value, HashFunc, EqualsFunc, valueIsSimplePOD >::getStats(), G3D::GLFWWindow::handleResizeFromCallback(), glsl::gradient_glsl::heatmapGradient(), G3D::Rect2D::height(), G3D::Rect2D::intersect(), G3D::Rect2D::intersects(), G3D::Rect2D::intersectsOrTouches(), G3D::Rect2D::isEmpty(), G3D::Rect2D::isFinite(), glsl::g3dmath_glsl::lengthSquared(), G3D::Rect2D::lerp(), glsl::DepthOfField_blur_pix::main(), G3D::Color4unorm8::max(), G3D::Color3unorm8::max(), G3D::Vector3uint8::max(), G3D::Vector2uint32::max(), G3D::Vector2int32::max(), G3D::Vector3int16::max(), G3D::Vector2uint16::max(), G3D::Vector2int16::max(), G3D::Vector4int32::max(), G3D::Vector3int32::max(), G3D::Color1::max(), G3D::Color4::max(), G3D::Vector4::max(), G3D::Vector2::max(), G3D::Color3::max(), max(), G3D::Vector3::max(), glsl::g3dmath_glsl::max3(), G3D::G3DAllocator< T >::max_size(), maxNotNPOS(), glsl::g3dmath_glsl::meanComponent(), G3D::Rect2D::merge(), glsl::g3dmath_glsl::min4(), glsl::DefaultRenderer_pathTracedIndirect_pix::neonGradient(), glsl::gradient_glsl::neonGradient(), G3D::Texture::numMipMapLevels(), G3D::Rect2D::operator!=(), G3D::Rect2D::operator*(), G3D::Rect2D::operator+(), G3D::Rect2D::operator-(), G3D::Rect2D::operator/(), G3D::Rect2D::operator==(), G3D::Image::R(), G3D::Map2D< Color1, Color1 >::R(), G3D::Rect2D::randomPoint(), G3D::Rect2D::Rect2D(), G3D::SmallArray< G3D::Vector4, 8 >::resize(), G3D::Array< G3D::AABox >::resize(), glsl::AmbientOcclusion_sample_glsl::sampleAO(), glsl::LightingEnvironment_environmentMapUniforms_glsl::sampleEnvironmentMap(), glsl::DDGIVolume_glsl::sampleOneDDGIVolume(), G3D::UniversalBSDF::schlickFresnel(), G3D::UserInput::setArtificialLatency(), G3D::DepthOfFieldSettings::setFarBlurryPlaneZ(), G3D::DepthOfFieldSettings::setFarSharpPlaneZ(), G3D::GuiScrollBar::setMax(), G3D::DepthOfFieldSettings::setNearSharpPlaneZ(), G3D::GuiSlider< int >::setRange(), G3D::GuiNumberBox< int >::setRange(), G3D::GuiNumberBox< int >::setRect(), glsl::FogVolumeSurface_render_pix::shade(), G3D::UniversalBSDF::smoothnessToBlinnPhongExponent(), G3D::G3DString< INTERNAL_SIZE >::substr(), glsl::gradient_glsl::techGradient(), glsl::screenSpaceRayTrace_glsl::traceScreenSpaceRay1(), glsl::UniversalMaterial_shade_glsl::UniversalMaterial_shade(), G3D::AttributeArray::updateInterleaved(), G3D::Rect2D::wh(), G3D::Rect2D::width(), G3D::Rect2D::x0y1(), G3D::Rect2D::x1(), G3D::Rect2D::x1y0(), G3D::Rect2D::x1y1(), G3D::Rect2D::xyxy(), and G3D::Rect2D::y1().

◆ max() [7/8]

template<class T >
T G3D::max ( const T &  x,
const T &  y,
const T &  z 
)
inline

◆ max() [8/8]

template<class T >
T G3D::max ( const T &  x,
const T &  y,
const T &  z,
const T &  w 
)
inline

◆ maxMessageSize()

int G3D::maxMessageSize ( ) const
inline

The maximum length of a message that can be sent (G3D places a small header at the front of each UDP packet; this is already taken into account by the value returned).

Referenced by serializeMessage().

◆ maxNotNPOS()

size_t G3D::maxNotNPOS ( size_t  i,
size_t  j 
)
inline

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

Referenced by findLastSlash().

◆ messageWaiting()

bool G3D::messageWaiting ( )
virtual

The message is actually copied from the socket to an internal buffer during this call.

Receive only deserializes.

Referenced by receive().

◆ min() [1/8]

Vector2 G3D::min ( const Vector2 v1,
const Vector2 v2 
)
inline

◆ min() [2/8]

Vector3 G3D::min ( const Vector3 v1,
const Vector3 v2 
)
inline

◆ min() [3/8]

Vector4 G3D::min ( const Vector4 v1,
const Vector4 v2 
)
inline

◆ min() [4/8]

Color3 G3D::min ( const Color3 v1,
const Color3 v2 
)
inline

◆ min() [5/8]

Color4 G3D::min ( const Color4 v1,
const Color4 v2 
)
inline

◆ min() [6/8]

template<class T >
T G3D::min ( const T &  x,
const T &  y 
)
inline

Referenced by glsl::Light_glsl::addLightContribution(), G3D::GuiPane::addNumberBox(), G3D::GuiPane::addSlider(), G3D::Rect2D::center(), glsl::DepthOfField_glsl::circleOfConfusionRadiusPixels(), G3D::G3DString< INTERNAL_SIZE >::compare(), G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::computeBounds(), glsl::LightingEnvironment_LightUniforms_glsl::computeDirectLighting(), G3D::SmallArray< G3D::Vector4, 8 >::contains(), G3D::Rect2D::contains(), G3D::Rect2D::corner(), glsl::UniversalMaterial_sample_glsl::dim(), G3D::Rect2D::extent(), glsl::Film_FXAA_13_performance_pix::FxaaLuma(), glsl::Film_FXAA_13_performance_pix::FxaaPixelShader(), G3D::Rect2D::height(), G3D::Rect2D::intersect(), G3D::Rect2D::intersects(), G3D::Rect2D::intersectsOrTouches(), G3D::Rect2D::isEmpty(), G3D::Rect2D::isFinite(), G3D::Rect2D::lerp(), glsl::g3dmath_glsl::max4(), G3D::Rect2D::merge(), G3D::Color4unorm8::min(), G3D::Color3unorm8::min(), G3D::Vector3uint8::min(), G3D::Vector2uint32::min(), G3D::Vector2int32::min(), G3D::Vector3int16::min(), G3D::Vector2uint16::min(), G3D::Vector4int32::min(), G3D::Vector2int16::min(), G3D::Vector3int32::min(), G3D::Color1::min(), G3D::Color4::min(), G3D::Vector4::min(), G3D::Vector2::min(), G3D::Color3::min(), min(), G3D::Vector3::min(), glsl::g3dmath_glsl::min3(), glsl::DefaultRenderer_pathTracedIndirect_pix::neonGradient(), G3D::Rect2D::operator!=(), G3D::Rect2D::operator*(), G3D::Rect2D::operator+(), G3D::Rect2D::operator-(), G3D::Rect2D::operator/(), G3D::Rect2D::operator==(), G3D::UniversalBSDF::packGlossyExponent(), G3D::Rect2D::randomPoint(), G3D::Rect2D::Rect2D(), G3D::Array< G3D::AABox >::resize(), G3D::G3DString< INTERNAL_SIZE >::rfind(), glsl::AmbientOcclusion_sample_glsl::sampleAO(), G3D::DepthOfFieldSettings::setFarSharpPlaneZ(), G3D::DepthOfFieldSettings::setNearBlurryPlaneZ(), G3D::DepthOfFieldSettings::setNearSharpPlaneZ(), G3D::GuiSlider< int >::setRange(), G3D::GuiNumberBox< int >::setRange(), G3D::UniversalBSDF::smoothnessToBlinnPhongExponent(), glsl::Light_glsl::spotLightFalloff(), G3D::G3DString< INTERNAL_SIZE >::substr(), glsl::gradient_glsl::techGradient(), glsl::screenSpaceRayTrace_glsl::traceScreenSpaceRay1(), G3D::Rect2D::wh(), G3D::Rect2D::width(), G3D::Rect2D::x0(), G3D::Rect2D::x0y0(), G3D::Rect2D::x0y1(), G3D::Rect2D::x1y0(), G3D::Rect2D::xyxy(), and G3D::Rect2D::y0().

◆ min() [7/8]

template<class T >
T G3D::min ( const T &  x,
const T &  y,
const T &  z 
)
inline

◆ min() [8/8]

template<class T >
T G3D::min ( const T &  x,
const T &  y,
const T &  z,
const T &  w 
)
inline

◆ mod1() [1/2]

float G3D::mod1 ( float  t)
inline

Referenced by G3D::Vector2::mod1().

◆ mod1() [2/2]

double G3D::mod1 ( double  t)
inline

◆ msgBox()

void G3D::msgBox ( const String message,
const String title = "Message" 
)


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

◆ mul() [1/5]

Matrix4 G3D::mul ( const Matrix4 a,
const Matrix4 b 
)
inline

◆ mul() [2/5]

Vector4 G3D::mul ( const Matrix4 m,
const Vector4 v 
)
inline

◆ mul() [3/5]

Vector3 G3D::mul ( const Matrix3 m,
const Vector3 v 
)
inline

◆ mul() [4/5]

Matrix3 G3D::mul ( const Matrix3 a,
const Matrix3 b 
)
inline

◆ mul() [5/5]

float G3D::mul ( float  a,
float  b 
)
inline


a * b (for DirectX/Cg support)

◆ nan()

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(), G3D::UniversalMaterial::constant(), and G3D::Quat::log().

◆ NetListener()

G3D::NetListener ( uint16  port)

Port is in host byte order.

◆ networkCommunicationInterval()

RealTime G3D::networkCommunicationInterval ( )

◆ networkSendBacklog()

unsigned int G3D::networkSendBacklog ( )

Return the number of network transactions pending across all NetSendConnections.

This is related to the underlying UDP packe queue and should be proportional to the number of bytes sent, but in complicated ways. If this number grows too large, then NetSendConnection::send is sending data faster than either the network can support or the other side can receive.

Use with an arbitrary threshold (e.g., 500) to avoid sending too much data and degrading network performance.

◆ nextMod3()

int G3D::nextMod3 ( int  i)
inline

◆ normalize() [1/4]

Vector2 G3D::normalize ( const Vector2 v)
inline

◆ normalize() [2/4]

Vector3 G3D::normalize ( const Vector3 v)
inline

◆ normalize() [3/4]

Vector4 G3D::normalize ( const Vector4 v)
inline

◆ normalize() [4/4]

float G3D::normalize ( float  v)
inline

◆ notNull() [1/4]

template<class T >
bool G3D::notNull ( const shared_ptr< T > &  ptr)

◆ notNull() [2/4]

template<class T >
bool G3D::notNull ( const T *  ptr)

◆ notNull() [3/4]

template<class T >
bool G3D::notNull ( const lazy_ptr< T > &  ptr)

Referenced by G3D::UniformTable::append(), G3D::ParticleSystem::Block::Block(), G3D::AudioDevice::WeakCleanupArray< G3D::Sound >::cleanup(), G3D::FastPointHashGrid< Value, PosFunc >::clear(), G3D::FastPODTable< Key, Value, HashFunc, EqualsFunc, valueIsSimplePOD >::containsKey(), enumToJavaScriptDeclaration(), G3D::GuiNumberBox< int >::findControlUnderMouse(), G3D::OrderedTable< Key, Value >::findIndexOfKey(), G3D::Scene::getTypedEntityArray(), G3D::WeakCache< G3D::Sampler, shared_ptr< G3D::GLSamplerObject > >::getValues(), G3D::UniversalSurface::GPUGeom::hasBones(), G3D::Args::hasIndirectBuffer(), G3D::Component< Color3, Image3 >::image(), G3D::_internal::FastPODTable_Entry< Key, Value, false >::inUse(), G3D::GuiText::isIcon(), G3D::GBuffer::Specification::memorySize(), G3D::GuiTextureBox::movieRecording(), G3D::SmallTable< Key, Value, HashFunc, EqualsFunc >::Iterator::operator Entry *(), G3D::SmallTable< Key, Value, HashFunc, EqualsFunc >::Iterator::operator->(), G3D::Grid< Cell >::operator[](), G3D::CPUPixelTransferBuffer::ownsMemory(), G3D::Array< G3D::AABox >::removeNulls(), G3D::GuiNumberBox< int >::render(), G3D::Framebuffer::resize(), G3D::GuiNumberBox< int >::roundAndClamp(), G3D::GLPixelTransferBuffer::runMapHooks(), G3D::GLPixelTransferBuffer::runReallocateHooks(), G3D::Component< Color3, Image3 >::sample(), G3D::GApp::setCameraManipulator(), G3D::GuiNumberBox< int >::setEnabled(), G3D::RenderDevice::setFramebuffer(), G3D::Component< Color3, Image3 >::setStorage(), G3D::GuiWindow::setVisible(), G3D::FastPODTable< Key, Value, HashFunc, EqualsFunc, valueIsSimplePOD >::sizeInMemory(), G3D::Component< Color3, Image3 >::texture(), and G3D::Framebuffer::texture().

◆ notNull() [4/4]

template<class T >
bool G3D::notNull ( const Pointer< T > &  p)

◆ ok()

bool G3D::ok ( ) const

◆ operator!=() [1/2]

template<class T1 , class T2 >
bool G3D::operator!= ( const G3DAllocator< T1 > &  ,
const G3DAllocator< T2 > &   
)
throw (
)

◆ operator!=() [2/2]

bool G3D::operator!= ( const NetAddress a,
const NetAddress b 
)
inline

◆ operator*() [1/14]

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


Extends the c3 with alpha = 1.0

◆ operator*() [2/14]

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

◆ operator*() [3/14]

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

◆ operator*() [4/14]

Vector2 G3D::operator* ( double  s,
const Vector2 v 
)
inline

◆ operator*() [5/14]

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

◆ operator*() [6/14]

Vector2 G3D::operator* ( float  s,
const Vector2 v 
)
inline

◆ operator*() [7/14]

Vector2 G3D::operator* ( int  s,
const Vector2 v 
)
inline

◆ operator*() [8/14]

Color4 G3D::operator* ( float  fScalar,
const Color4 other 
)
inline

◆ operator*() [9/14]

Vector3 G3D::operator* ( const Vector3 rkPoint,
const Matrix3 rkMatrix 
)
inline

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

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

◆ operator*() [10/14]

G3D::Vector3 G3D::operator* ( float  s,
const G3D::Vector3 v 
)
inline

◆ operator*() [11/14]

G3D::Vector3 G3D::operator* ( double  s,
const G3D::Vector3 v 
)
inline

◆ operator*() [12/14]

G3D::Vector3 G3D::operator* ( int  s,
const G3D::Vector3 v 
)
inline

◆ operator*() [13/14]

G3D::Quat G3D::operator* ( double  s,
const G3D::Quat q 
)
inline

◆ operator*() [14/14]

G3D::Quat G3D::operator* ( float  s,
const G3D::Quat q 
)
inline
Referenced Code: Based on Watt & Watt, page 360

◆ operator/()

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

◆ operator<<() [1/2]

std::ostream& G3D::operator<< ( std::ostream &  os,
const NetAddress  
)

◆ operator<<() [2/2]

std::ostream& G3D::operator<< ( std::ostream &  os,
const Vector3  
)

◆ operator==() [1/2]

template<class T1 , class T2 >
bool G3D::operator== ( const G3DAllocator< T1 > &  ,
const G3DAllocator< T2 > &   
)
throw (
)

◆ operator==() [2/2]

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.

◆ parseCommaSeparated()

void G3D::parseCommaSeparated ( const String  s,
Array< 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

◆ parseFilename()

void G3D::parseFilename ( const String filename,
String drive,
Array< String > &  path,
String base,
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"

◆ pathConcat()

String G3D::pathConcat ( const String dirname,
const String file 
)

Appends file onto dirname, ensuring a / if needed.

Deprecated:
Use FilePath::concat

◆ pi()

double G3D::pi ( )
inline

◆ pif()

float G3D::pif ( )
inline

◆ pow2()

int G3D::pow2 ( unsigned int  x)
inline

Returns 2^x.

Referenced by G3D::SVO::fineVoxelResolution().

◆ pow5()

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

◆ prompt() [1/2]

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, mmcguire.com
Referenced Code: Font setting code by Kurt Miller, kurt.com

Referenced by prompt().

◆ prompt() [2/2]

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.

◆ readWholeFile()

String G3D::readWholeFile ( const String filename)

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

◆ receive() [1/4]

template<typename T >
bool G3D::receive ( T &  message)
inline

If a message is waiting, deserializes the waiting message into message and returns true, otherwise returns false.

You can determine the type of the message (and therefore, the class of message) using G3D::ReliableConduit::waitingMessageType().

Referenced by receive().

◆ receive() [2/4]

bool G3D::receive ( )
inline

Removes the current message from the queue.

◆ receive() [3/4]

bool G3D::receive ( NetAddress sender)

◆ receive() [4/4]

template<typename T >
bool G3D::receive ( NetAddress sender,
T &  message 
)
inline

◆ receiveHeader()

void G3D::receiveHeader ( )

Receives the messageType and messageSize from the socket.

◆ receiveIntoBuffer()

void G3D::receiveIntoBuffer ( )

Accumulates whatever part of the message (not the header) is still waiting on the socket into the receiveBuffer during state = RECEIVING mode.

Closes the socket if anything goes wrong. When receiveBufferUsedSize == messageSize, the entire message has arrived.

◆ ReliableConduit() [1/2]

G3D::ReliableConduit ( const NetAddress addr)

◆ ReliableConduit() [2/2]

G3D::ReliableConduit ( const SOCKET sock,
const NetAddress addr 
)

◆ replace()

String G3D::replace ( const String s,
const String pattern,
const String replacement 
)

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

◆ round() [1/2]

double G3D::round ( double  f)
inline

◆ round() [2/2]

float G3D::round ( float  f)
inline

◆ roundStochastically()

int G3D::roundStochastically ( float  f)

Rounds so that the mean of a set of rounded numbers is close to the mean of the original numbers.

◆ rsq()

float G3D::rsq ( float  x)
inline


Computes 1 / sqrt(x).

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

◆ rsqrt() [1/2]

double G3D::rsqrt ( double  x)
inline
Deprecated:
Use rsq

◆ rsqrt() [2/2]

float G3D::rsqrt ( float  x)
inline
Deprecated:
Use rsq

◆ runConcurrently() [1/4]

void G3D::runConcurrently ( const Point3int32 start,
const Point3int32 stopBefore,
const std::function< void(Point3int32)> &  callback,
bool  singleThread = false 
)

Iterates over a 3D region using multiple threads and blocks until all threads have completed.

Has highest coherence per thread in x, and then in blocks of y.

Evaluates object->method(x, y) for every start.x <= x < upTo.x and start.y <= y < upTo.y. Iteration is row major, so each thread can expect to see successive x values.

Parameters
singleThreadIf true, force all computation to run on the calling thread. Helpful when debugging

Example:

class RayTracer {
public:
void trace(const Vector2int32& pixel) {
...
}
void traceAll() {
Thread::runConcurrently(Point2int32(0,0), Point2int32(w,h), [this](pixel) { trace(pixel); );
}
};

Referenced by G3D::Image::forEachPixel().

◆ runConcurrently() [2/4]

void G3D::runConcurrently ( const Point2int32 start,
const Point2int32 stopBefore,
const std::function< void(Point2int32)> &  callback,
bool  singleThread = false 
)

◆ runConcurrently() [3/4]

void G3D::runConcurrently ( const int &  start,
const int &  stopBefore,
const std::function< void(int)> &  callback,
bool  singleThread = false 
)

◆ runConcurrently() [4/4]

void G3D::runConcurrently ( const size_t &  start,
const size_t &  stopBefore,
const std::function< void(size_t)> &  callback,
bool  singleThread = false 
)

◆ screenPrintf() [1/2]

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.

Referenced by screenPrintf().

◆ screenPrintf() [2/2]

void G3D::screenPrintf ( const String t ...)
inline

◆ send() [1/4]

template<typename T >
void G3D::send ( uint32  type,
const T &  message 
)
inline


Serializes the message and schedules it to be sent as soon as possible, and then returns immediately.

The message can be any class with a serialize and deserialize method. On the receiving side, use G3D::ReliableConduit::waitingMessageType() to detect the incoming message and then invoke G3D::ReliableConduit::receive(msg) where msg is of the same class as the message that was sent.

The actual data sent across the network is preceeded by the message type and the size of the serialized message as a 32-bit integer. The size is sent because TCP is a stream protocol and doesn't have a concept of discrete messages.

◆ send() [2/4]

void G3D::send ( uint32  type)

Sends an empty message with the given type.

Useful for sending commands that have no parameters.

◆ send() [3/4]

template<typename T >
void G3D::send ( const NetAddress a,
uint32  type,
const T &  msg 
)
inline

◆ send() [4/4]

template<typename T >
void G3D::send ( const Array< NetAddress > &  a,
uint32  type,
const T &  m 
)
inline

Send the same message to multiple addresses (only serializes once).

Useful when server needs to send to a known list of addresses (unlike direct UDP broadcast to all addresses on the subnet)

◆ sendBuffer() [1/2]

void G3D::sendBuffer ( const BinaryOutput b)

Referenced by send().

◆ sendBuffer() [2/2]

void G3D::sendBuffer ( const NetAddress a,
BinaryOutput b 
)

◆ serialize() [1/18]

void G3D::serialize ( const String s,
BinaryOutput b 
)
inline

◆ serialize() [2/18]

void G3D::serialize ( const int32 i,
BinaryOutput b 
)
inline

◆ serialize() [3/18]

void G3D::serialize ( const uint32 i,
BinaryOutput b 
)
inline

◆ serialize() [4/18]

void G3D::serialize ( const bool &  i,
BinaryOutput b 
)
inline

◆ serialize() [5/18]

void G3D::serialize ( const float32 f,
BinaryOutput b 
)
inline

◆ serialize() [6/18]

void G3D::serialize ( const float64 f,
BinaryOutput b 
)
inline

◆ serialize() [7/18]

template<typename T >
void G3D::serialize ( const Array< T > &  array,
BinaryOutput b 
)

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

◆ serialize() [8/18]

void G3D::serialize ( const bool &  b,
TextOutput to 
)

◆ serialize() [9/18]

void G3D::serialize ( const int &  b,
TextOutput to 
)

◆ serialize() [10/18]

void G3D::serialize ( const uint8 b,
TextOutput to 
)

◆ serialize() [11/18]

void G3D::serialize ( const double &  b,
TextOutput to 
)

◆ serialize() [12/18]

void G3D::serialize ( const float &  b,
TextOutput to 
)

◆ serialize() [13/18]

void G3D::serialize ( const String b,
TextOutput to 
)

◆ serialize() [14/18]

void G3D::serialize ( const char *  b,
TextOutput to 
)

◆ serialize() [15/18]

void G3D::serialize ( const Vector2 v,
class BinaryOutput b 
)

◆ serialize() [16/18]

void G3D::serialize ( const Vector3::Axis a,
class BinaryOutput bo 
)

◆ serialize() [17/18]

void G3D::serialize ( const Vector4 v,
class BinaryOutput b 
)

◆ serialize() [18/18]

void G3D::serialize ( const Vector3 v,
class BinaryOutput b 
)

◆ serializeMessage()

template<typename T >
void G3D::serializeMessage ( uint32  type,
const T &  m,
BinaryOutput b 
) const

Referenced by send().

◆ serviceNetwork()

void G3D::serviceNetwork ( )

If NOT using G3D's internal threaded networking, you must invoke this periodically to service the receiving side network connections.

Receiving messages will only update inside this call–all other network calls queue for processing.

If using G3D's internal threaded networking, this is automatically called continuously on a separate thread.

See also
setNetworkCommunicationInterval, G3D::G3DSpecification::threadedNetwork

◆ serviceNetworkSender()

void G3D::serviceNetworkSender ( const G3D::NetChannel channel)

If NOT using G3D's internal threaded networking, you must invoke this periodically to service the sending side network connections.

Sending messages will only update inside this call–all other network calls queue for processing.

If using G3D's internal threaded networking, this is automatically called continuously on a separate thread.

See also
setNetworkCommunicationInterval, G3D::G3DSpecification::threadedNetwork

◆ setAssertionHook()

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 nullptr, assertions are not handled.

◆ setCocoaIcon()

void G3D::setCocoaIcon ( const char *  filename)

◆ setConsolePrintHook()

void G3D::setConsolePrintHook ( ConsolePrintHook  h)

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

Used by GConsole to intercept printing routines.

◆ setFailureHook()

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).

◆ setNetworkCommunicationInterval()

void G3D::setNetworkCommunicationInterval ( const RealTime  t)


This is the amount of time G3D will pause the network thread to perform network communication, in seconds (default is 0s).

This is equivalent to the timeout value for the POSIX select() call. If G3DSpecification::threadedNetwork is true, then a value of 0 minimizes network latency.

0 = 1 quantum (process already waiting messages, do not wait for new ones). Because the enet protocal requires confirmation messages, this can cause the network queue to backup.

Set this number higher if you are sending large messages and think that you are bottlenecked by not being able to send confirmation messages. Set lower if you think the network time is not being fully utilized

Or just multithread your network code.

For the current implementation, the effective precision is 1ms, the effective accuracy can be as poor as 50ms on Windows.

See also
serviceNetwork, G3D::G3DSpecification::threadedNetwork

◆ sign() [1/5]

Vector2 G3D::sign ( const Vector2 v)
inline

◆ sign() [2/5]

Vector3 G3D::sign ( const Vector3 v)
inline

◆ sign() [3/5]

Vector4 G3D::sign ( const Vector4 v)
inline

◆ sign() [4/5]

double G3D::sign ( double  fValue)
inline

◆ sign() [5/5]

float G3D::sign ( float  x)
inline

◆ signedPow() [1/2]

float G3D::signedPow ( float  b,
float  e 
)
inline

Computes |b|^e * sign(b)

◆ signedPow() [2/2]

double G3D::signedPow ( double  b,
double  e 
)
inline

Computes |b|^e * sign(b)

◆ sinc()

double G3D::sinc ( double  x)
inline


sin(x)/x

◆ sizeOfGLFormat()

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.

◆ smootherstep()

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

Perlin's C2 continous variation on smoothstep()

◆ smoothstep()

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

The GLSL smoothstep function.

Referenced by glsl::gradient_glsl::neonGradient().

◆ splitLines()

Array<String> G3D::splitLines ( const String s)

Splits string at new lines (handles \r\n and \n).

Will create an empty string after new line if last character.

◆ square() [1/3]

double G3D::square ( double  fValue)
inline

◆ square() [2/3]

float G3D::square ( float  x)
inline

◆ square() [3/3]

int G3D::square ( int  x)
inline

◆ squareMagnitude() [1/5]

Vector2 G3D::squareMagnitude ( const Vector2 x)
inline

Preserves sign while squaring magnitude.

◆ squareMagnitude() [2/5]

Vector3 G3D::squareMagnitude ( const Vector3 x)
inline

Preserves sign while squaring magnitude.

◆ squareMagnitude() [3/5]

float G3D::squareMagnitude ( float  x)
inline

Preserves sign while squaring magnitude.

◆ squareMagnitude() [4/5]

double G3D::squareMagnitude ( double  x)
inline

Preserves sign while squaring magnitude.

◆ squareMagnitude() [5/5]

int G3D::squareMagnitude ( int  x)
inline

Preserves sign while squaring magnitude.

◆ stringCompare()

int G3D::stringCompare ( const String s1,
const String s2 
)


A comparison function for passing to Array::sort.

◆ stringJoin() [1/2]

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


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

◆ stringJoin() [2/2]

String G3D::stringJoin ( const G3D::Array< String > &  a,
const String joinStr 
)

◆ stringPtrCompare()

int G3D::stringPtrCompare ( const String s1,
const String s2 
)

◆ stringSplit() [1/2]

Array<String> G3D::stringSplit ( const String x,
char  splitChar 
)


Splits x at each occurance of splitChar.

◆ stringSplit() [2/2]

void G3D::stringSplit ( const String x,
char  splitChar,
Array< String > &  out 
)

◆ sumSquares() [1/4]

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

Referenced by distance().

◆ sumSquares() [2/4]

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

◆ sumSquares() [3/4]

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

◆ sumSquares() [4/4]

float G3D::sumSquares ( float  x,
float  y,
float  z 
)
inline

◆ superFastHash()

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 G3D::Vector4int32::hashCode(), HashTrait< G3D::String >::hashCode(), HashTrait< G3D::uint128 >::hashCode(), and HashTrait< G3D::Vector3int32 >::hashCode().

◆ System_free()

void G3D::System_free ( void *  )

◆ System_malloc()

void* G3D::System_malloc ( size_t  )

◆ tesselateComplexPolygon()

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.

◆ toDegrees() [1/3]

double G3D::toDegrees ( double  rad)
inline

◆ toDegrees() [2/3]

float G3D::toDegrees ( float  rad)
inline

◆ toDegrees() [3/3]

float G3D::toDegrees ( int  rad)
inline

◆ toLower()

String G3D::toLower ( const String x)

◆ toRadians() [1/3]

double G3D::toRadians ( double  deg)
inline

◆ toRadians() [2/3]

float G3D::toRadians ( float  deg)
inline

◆ toRadians() [3/3]

float G3D::toRadians ( int  deg)
inline

◆ toSeconds() [1/2]

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)

◆ toSeconds() [2/2]

SimTime G3D::toSeconds ( int  hour,
int  minute,
AMPM  ap 
)

◆ toUpper()

String G3D::toUpper ( const String x)


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

◆ toUTF8()

void G3D::toUTF8 ( const String s,
Array< char > &  result 
)

Convert from ASCII to utf-8 encoding, adapted from https://everything2.com/title/Converting+ASCII+to+UTF-8.

◆ trimWhitespace()

String G3D::trimWhitespace ( const String s)


Strips whitespace from both ends of the string.

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

◆ twoPi()

double G3D::twoPi ( )
inline

◆ uiClamp()

unsigned int G3D::uiClamp ( unsigned int  val,
unsigned int  low,
unsigned int  hi 
)
inline

◆ uniformRandom()

float G3D::uniformRandom ( float  low,
float  hi 
)
inline

◆ uniformRandomD()

double G3D::uniformRandomD ( double  low,
double  hi 
)
inline

◆ vformat()

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

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

function.

◆ waitForConnection()

ReliableConduitRef G3D::waitForConnection ( )

Block until a connection is received.

Returns nullptr if something went wrong.

◆ waitingMessageType()

uint32 G3D::waitingMessageType ( )
virtual

◆ wangHash6432Shift()

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(), and HashTrait< G3D::Vector4uint16 >::hashCode().

◆ wordWrap()

String G3D::wordWrap ( const 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

◆ wrap() [1/4]

float G3D::wrap ( float  t,
float  lo,
float  hi 
)
inline

◆ wrap() [2/4]

float G3D::wrap ( float  t,
float  hi 
)
inline

◆ wrap() [3/4]

double G3D::wrap ( double  t,
double  lo,
double  hi 
)
inline

◆ wrap() [4/4]

double G3D::wrap ( double  t,
double  hi 
)
inline

◆ writeWholeFile()

void G3D::writeWholeFile ( const String filename,
const 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.

◆ zipfileExists() [1/2]

bool G3D::zipfileExists ( const String filename,
String outZipfile,
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

◆ zipfileExists() [2/2]

bool G3D::zipfileExists ( const String filename)

Variable Documentation

◆ addr

NetAddress G3D::addr

◆ alreadyReadMessage

bool G3D::alreadyReadMessage


True when waitingForMessageType has read the message from the network into messageType/messageStream.

◆ DONT_SHRINK_UNDERLYING_ARRAY

const bool G3D::DONT_SHRINK_UNDERLYING_ARRAY = false

◆ ignoreBool

bool G3D::ignoreBool

◆ ignoreDouble

double G3D::ignoreDouble

For use with default output arguments.

The value is always undefined.

◆ ignoreFloat

float G3D::ignoreFloat

For use with default output arguments.

The value is always undefined.

◆ ignoreInt

int G3D::ignoreInt

For use with default output arguments.

The value is always undefined.

◆ ignoreString

String G3D::ignoreString

For use with default output arguments.

The value is always undefined.

◆ messageBuffer

Array<uint8> G3D::messageBuffer


The message received (the type has already been read off).

Referenced by receive().

◆ messageSender

NetAddress G3D::messageSender


Origin of the received message.

◆ messageSize

uint32 G3D::messageSize


Total size of the incoming message (read from the header).

Referenced by receive().

◆ messageType

uint32 G3D::messageType


Type of the incoming message.


The type of the last message received.

Referenced by receive().

◆ MTU

int G3D::MTU

Maximum transmission unit (packet size in bytes) for this socket.

May vary between sockets.

Referenced by maxMessageSize(), and serializeMessage().

◆ NEWLINE

const char* G3D::NEWLINE

◆ OpenGLWindowHDC

HDC G3D::OpenGLWindowHDC

The HDC that wglMakeCurrent will use on Windows.

Referenced by glMakeCurrent().

◆ receiveBuffer

void* G3D::receiveBuffer

Shared buffer for receiving messages.

Referenced by receive().

◆ receiveBufferTotalSize

size_t G3D::receiveBufferTotalSize

Total size of the receiveBuffer.

◆ receiveBufferUsedSize

size_t G3D::receiveBufferUsedSize

Size occupied by the current message...

so far. This will be equal to messageSize when the whole message has arrived.

Referenced by receive().

◆ sock

SOCKET G3D::sock

◆ SORT_DECREASING

const int G3D::SORT_DECREASING = -1

Constant for Array::sort.

◆ SORT_INCREASING

const int G3D::SORT_INCREASING = 1

◆ state

enum G3D::State G3D::state

documentation generated on Wed Nov 24 2021 08:01:52 using doxygen 1.8.15