Virtools SDK Documentation

  • Changes in New Version

    This paper describes the modifications made to the SDK in this version.
  • Virtools SDK Architecture and Principles

    This chapter introduces the basic concepts of Virtools : Behavioral and Render Engines.
  • Using Virtools SDK

    This chapter contains several articles with examples to help you to use each concept of the Virtools SDK.
  • Virtools SDK Reference

    This is the reference for all classes,functions,structures,macros introduced by the SDK.
  • Available Source Code

    This article gives the list of sample source code that is provided with the SDK.


Virtools SDK Architecture and Principles

Introducing Virtools SDK

The rest of the SDK documentation assumes that the principles involved with Virtools usage (Behaviors, Parameters, Behavioral objects, scenes, scripts, etc..) and the basic architecture of the Virtools SDK are known and understood. If it's not your case, take the time to read this chapter...

Presentation

The Virtools SDK (Software Development Kit) is a set of development tools (libraries, DLLs, header files) that give programmers access to all the functionalities used in Virtools applications, enabling them to write software components that directly use these functionalities, like:

  • custom applications using the Virtools engines as an underlying technology
  • extensions to the Virtools engines, like :
    • Behavior Plugins,
    • Media Plugins,
    • Managers Plugins,
    • Extensions Plugins (specific Parameter Types),
    • Render Engines Plugins,
    • Rasterizers.
    • Virtools Dev UI SDK

This current part of the documentation gives an overview of the internal principles and the inner workings of the Virtools engines.

Plan of Part 1 - Virtools SDK Architecture and Principles

This overview contains the following information :

  • 1. Virtools API Architecture
  • 2. Presentation of the Process Loop
  • 3. Presentation of the Behavioral Engine :
    • 3.1. What are Behaviors ?
    • 3.2. What are Parameters ?
    • 3.3. What are Behavioral Objects ?
    • 3.4. Level Organization
  • 4. Presentation of the Render Engine
    • 4.1. About the Rendering Loop
    • 4.2. Presentation of the Rasterizers
  • 5. Virtools Plugins Overview
  • 6. Main Virtools Events


Virtools API Architecture

The Virtools software components are organized in a very modular architecture. Here is the big scheme:

All the Virtools executables (Player, Creation, Dev, Web Plugin, etc..) are implemented on top of this common software architecture, made of dynamically linked libraries (DLLs), and which implement all the common functionalities of Virtools.

The central software component is made of two DLLs: CK2 and VxMath, with VxMath providing the low level functionalities, CK2 providing the core behavioral engine, and the glue for managing all the other software components.

All the other functionalities of the Virtools engine are implemented through Plugins. The Virtools software suite includes a number of standard plugins, and software developer can write their own Plugins using the SDK. See the Virtools Plugins Overview for more details about writing your own Plugins.

Also, using the SDK, developers can write their own custom executable using the Virtools core engine as a provider of 3D real-time behavioral capabilities. An example of a Standalone Player is provided in the SDK. The Virtools library still takes into account potential Plugins. See the Creating a Standalone Application chapter for more information.

Virtools APIs

Basically, the SDK consists in the API (header files .h) containing definitions of C++ functions, constants and classes, and stub libraries. Using the header files and linking against the libraries, software programmers can write software components in the form of DLLs or of executables, that can interact with the existing Virtools software components. See the Using Virtools SDK for details on how to use the APIs, and for details on development environments.

The APIs can be split into functional parts:

  • VxMath APIs
  • the CK2 APIs
  • Standard External Managers APIs
  • RenderEngine APIs
  • Rasterizer APIs

VxMath API

VxMath is a DLL that deals with low level functions, types, and utilities, like vectors, matrices, mathematical functions, etc... Most of the Virtools software components use the objects of VxMath. See The VxMath Library chapter for more details.

CK2 API

CK2 is the main DLL of the Virtools engine and it corresponds to the core technology that Virtools brings to the world. The CK2 library is made of about 100 C++ classes, accessible through the CK2 API.

Basically, CK2 is centered around the behavioral engine, which deals with behaviors, behavioral objects, narrative elements like levels and scenes. All the elements that do not deal with spatial representation are implemented in this library (the elements dealing with geometry, space and visualization are implemented in the RenderEngine). For detailed information, see the Presentation of the Behavioral Engine chapter.

CK2 also implements internal system-wide functionnalities in the form of internal Managers, like the TimeManager, the PluginManager, etc.. See the Using the Existing Managers chapter for more details.

Standard External Managers API

Managers implement system-wide functionalities. Some are internal and are considered to be part of CK2 (see above), and some are external to CK2, but are still accessible through an API. These Managers can be removed from the suite, or replaced by a custom implementation. Some external Managers are provided in source code in the SDK.

The standard external managers are the InputManager, the SoundManager, the CollisionManager, the GridManager and the FloorManager. See the Using Managers chapter for more information.

The RenderEngine API

The Render Engine contains all the 3D rendering functionalities, and provides an API to address rendering, like management of meshes, of the render context, of the textures, etc.. This API can be used in two ways. First, software component can address this API to control the rendering process. This is the case for behavioral objects for example. Also, the RenderEngine is itself a Plugin and can be replaced by a custom RenderEngine, in which case the API corresponds to the functionalities that the custom engine should implement.

See the Presentation of the Render Engine chapter for more information.

The Rasterizer API

The Rasterizer provides the functionalities corresponding to final drawing of the 3D scene : polygons, textures and rendering options. The Rasterizer API is mainly used by the RenderEngine. It is also the API that a custom Rasterizer must implement. See the Presentation of the Rasterizers chapter for details.

The standard Virtools rasterizers are provided in source code as part of the SDK. See the Available Source Code chapter for more information.


Presentation of the Process Loop

Real-time

Virtools is a real-time engine: it allows any behavior to react constantly and consistently to its environment, including the user/player. Each Virtools context (corresponding to one Virtools composition) runs in a single system process and thread, which means that it does its prioritizing and scheduling of tasks itself : it does not leave to the operating system the decision of what amount of CPU to assign to each algorithmic element. Real real-time operating systems do not exist and this way the Virtools engine precisely controls its own time.

When a Virtools composition (a context) is played, the Virtools core engine indefinitely loops in what is called the Process Loop. Each cycle of the loop is a succession of phases, which always happen in the same order. All that should happen happens in this Process Loop. The duration of one cycle is called one "Frame". The Process Loop loops until the content pauses or is reset.

This scheme, very classical in real time engines, means that all processing should be time-split. Indeed, the frame is the minimal delay between an action of the user and a reaction of the system, and the framerate is the measure of real-time systems. So each frame should last as little as possible : processes (like behaviors) that take a long time to accomplish should be designed to happen in an iterative manner, that is bit by bit, with every bit taking as little time to process as possible, so as not to slow down the other processes and not to lengthen the frame duration. Only one badly written behavior can slow down the whole system ! The actual time (in milliseconds) is accessible to behaviors through the TimeManager API, for those behaviors needing to index their actions on time rather than on frames.

Standard Process Loop

The Virtools core engine defines the process loop in a standard way. Note that if you write your own custom executable, you can change the process loop, and insert your own processing in the Process Loop.

Here are the phases of each cycle of the Standard Process Loop:

PreProcess and PostProcess

The PreProcess and PostProcess phases enable Managers to performs actions before or after the two main phases (Behavioral and Rendering). Note that if you write a Manager, you should remember the time-split constraints and write your pre- and post-processing algorithms in an iterative manner.

Behavioral Process

This is where behaviors are processed. In Virtools, almost every type of object can have behaviors attached to it.

During the behavioral process, all the active behaviors are executed, one after the other, using a complex prioritizing scheme : first the priority of the objects are considered, then the ones of the scripts attached to the objects, then the Building Blocks and Graphs inside the scripts. When two objects have the same priority, the order in which they are executed is unknown (it is the same if two scripts inside an object have the same priority, or two behaviors inside a script).

Each behavior, when executed, may activate other behaviors through behavior links. These links have a delay corresponding to the number of frames after which the newly activated behavior will really become active. This delay can be 0, in which case, the newly activated behaviors will be processed in the same Process Loop cycle (frame) as the one that activated it (at a moment corresponding to its priority).

Behavior links can point from a behavior to itself. In such a case, having a looped link delay of 1 is way of implementing the time-splitting that we talked about above, with each bit of processing taking place at each Process Loop cycle. Looped link delays of 0 are a way of implementing time-intensive algorithms. But beware of having an exit condition for these algorithms, so as not to introduce infinite loops that would halt the whole system.

See the Presentation of the Behavioral Engine for more details on behaviors and their execution.

Rendering

3d Objects (Characters, scene geometry ) and 2d Objects (cursors, sprites, interface elements) are drawn during the rendering phase, by the current Render Context. The Render Context keeps a list of objects to be drawn. Objects can be added or removed from the Render Context during the Behavioral Process phase.

Note that the Rendering phase also allows for many pre- and post-processing, for highly customized rendering. See the Presentation of the Render Engine and Custom Rendering chapters for more details.


Presentation of the Behavioral Engine

General Presentation

The behavioral engine is the central core of the CK2 library, which means that it is the central part of Virtools. It manages and processes Behaviors, Behavioral Objects, Parameters, Attributes, Inputs, Outputs, etc.. The behavioral engine does not correspond to one class or function per se, but rather is a set of interrelated functions and classes that collaborate.

The management involves organizing the data corresponding to these object is memory, and providing read and write access to these objects, while keeping the overall consistency of the interrelationships between these objects.

The processing is started when a context is played, and stops when the context stops or pauses. It is called the Behavioral Process and is part of the main Process Loop (See the Presentation of the Process Loop chapter for more details). The Behavioral Process is the moment when all the behaviors are executed by the behavioral engine.

To be precise, here are the details of the Behavioral Process :

The first time a composition is played every behavior of every BeObject is reset and deactivated. BeObjects and their scripts that should be activated when a scene starts are activated and the input of these scripts is activated.

  • For each active BeObject (sorted according to their priority)

    • For each of the active Scripts of this BeObject (also sorted according to their priority)

      • Execute the Script, which will in its turn execute its sub-behaviors (also sorted according to their priority).
        • Each behavior keeps up a list of active behaviors to execute this frame. The execution of a behavior can activate a new behavior to be executed in the same frame (Link delay of 0) which is then pushed on the stack of active behaviors. When the stack of behaviors to execute this frame is empty we go to the next active behavior.
      • If a Script does not have any active sub-behavior, the Script is deactivated.

    • If all the Scripts of the BeObject are deactivated, the BeObject is deactivated.

For more information check the What are Behavioral Objects ? and What are Behaviors ? chapter.

The behavioral engine and the SDK

The Behavioral Engine is accessed through the CKContext class. This class, among other things, gives access to Playing, Pausing, Restting, Processing of the engine. It also gives access to all the Objects (BeObjects, Parameters, etc..) that are in the engine.

You rarely have to access the Behavior Engine directly, except when you write your own executable, in which case you may want to create and Remove Objects, manage the Process Loop precisely, etc..

More Informations

For more information, you can check out the other parts of this chapter ::

  • What are Behaviors ?
  • What are Parameters ?
  • What are Behavioral Objects ?
  • Level Organization


What are Behaviors ?

General concept

Behaviors are at the heart of the Virtools engine. They are descriptions and implementations of the actions and reactions that an object can have relatively to time or to its environment. Every dynamic change on objects during the execution of a Virtools content is implemented with behaviors.

Behaviors represent the verbs in the vocabulary of algorithms in Virtools. Other elements of this vocabulary are the Parameters (the adjectives), Owners and Targets (the nouns) and the Behavior Links (the punctuation). Verbs describe actions. And as we are in a computer system, they not only describe the actions, but actually perform them, when asked to do so by the Behavior Engine, at runtime. This action description can be in the form of Graphs or of C++ language.

General Description

From the outside, all behaviors have the same structure and way of functioning.

Here is the visual representation of the "ParameterSelector" behavior, as displayed in the Schematic Editor of Virtools. Outlined in red are the inputs and outputs of this behavior.

A behavior is activated when one of its input is activated. According to which input is activated the behavior performs its action and input parameters can influence this action. When done a behavior activates one or more of its output to indicate a result or situation and propagate this way the activity flux. Behaviors can also store result information in output parameters. Finally, they decide whether or not they want to remain active. See the Presentation of the Process Loop chapter for more information on when and how behaviors are actually called.

All behaviors have an owner, to which it is attached. The owner of a behavior never changes over time. The owner is a Behavioral Object. Some behaviors have a target, which is either its owner (default case), either a specific other object, which may change over time. The target of a behavior is also a Behavioral Object. See the What are Behavioral Objects ? chapter for more details.

Behaviors can use or generate data of about any type. Data passing between various elements of the Virtools engine, and especially between Behaviors, are called Parameters. See the What are Parameters ? chapter for more details.

Types of Behaviors

In Virtools there are three types of behaviors:

  • The basic type of behavior is a Building Block (BB) that is implemented as a C++ function :

Since during one "frame" a lot of behaviors can be executed, each behavior is supposed to perform only a short operation. For example if we want a BB to be waiting 1s before triggering its output we must keep it active for as many "frames" as needed for the time to elapsed. That's why in this case the BB activates its second output (and this way reactivates itself for the next "frame") until the time specified in its input parameter is elapsed.

Building Blocks implementation reside in DLLs defining Behavior Plugins. All the behaviors provided with Virtools are Building Blocks. Using the SDK, software programmer can create their own Building Blocks, to add new functionalities to Virtools objects. Building Blocks are the way to go to add new behavioral capabilities to Virtools content. See the Creating Building Blocks chapter for more details.

  • Building Blocks or Behavior can be encapsulated in a larger behavior that we call Behavior Graphs :

When executed this behavior graph will execute the timer BB which will activate the rotate BB. Since the activation delay is 0 this BB will be also executed in the same "frame" and will in its turn activate the Timer BB to be executed next "frame".

Behavior Graphs can be recursively encapsulated inside other Behavior Graphs, and so on. Behavior Graphs are created using the Virtools application, and saved inside the Virtools content. You cannot create a Behavior Graph using the SDK, though you may access existing Behavior Graphs.

  • The top level of a hierarchy of Behavior Graphs is called a Script. A Script is a Graph Behavior itself and has only one input :

This input is automatically triggered when a Virtools composition is started or when a script is reactivated at runtime.

Using the SDK, you can dynamically add or remove scripts from a Behavioral Object.

Behaviors and the SDK

The base class for all types of behaviors is CKBehavior.

The SDK is primarily designed to define new behaviors in the form of Building Blocks encapsulated inside DLLs. You should never have to directly create an instance of CKBehavior. The creation of the instance is done by Virtools, according to the description of the behavior that you provide in the form of a Behavior Prototype (CKBehaviorPrototype). This prototype also defines the C++ functions that will be called at various moments in the lifetime of the behavior, especially the execution function. These functions receive, as a C++ function parameter, the instance of the CKBehavior that it relates to, so you can get access to it. See the Creating Building Blocks chapter for more details.

You may also encounter behaviors while developing other kind of Virtools Plugins, like Managers.

In all cases, you can access the behavior's state and structure, and change them. You rarely directly "call" a behavior, rather, you change its settings to alter the moment or the way it is used by the Behavioral Engine.


What are Parameters ?

General concept

Parameters are used to transfer data between behaviors, and to add information to objects (through the use of attributes). A parameter is defined by the type of value it contains. Many value types have been already defined (float, string, integer, enum, object, etc.) but new types can be defined using the SDK (See the Creating Extensions Plugins chapter for more details).

Parameters and related objects

Kind of parameters

There are 3 kind of parameters : Input Parameters, Output Parameters, Local Parameters.

Input Parameter (pIn) :

Outlined in red are the two Input Parameters of the "Parameter Selector" Behavior, as represented in the Schematic Editor of the Virtools application.

Input parameters do not store any value, they are simply data inputs for behaviors and define the name and type of the data that is needed. input parameters are defined by the behavior. They get their value from a source which can be either another input parameter (from the enclosing Graph), an output parameter or a local parameter ( i.e. the output of another behavior, the result of a parameter operation, a local parameter..). In the Virtools application, they appear on the top of the behaviors. In an analogy with C language an Parameter Input can be seen as a typed pointer: Either NULL or pointing to a local or output parameter.

When an input parameter value is asked, it is found by asking the value from its source. See below (When are the values computed and propagated) for more details about value propagation.

Output Parameters (pOut) :

Outlined in red is the only output parameter of the "Parameter Selector" behavior, as represented in the Schematic Editor of the Virtools application.

An pOut stores its own data in memory. As an pIn has a source, a pOut can have one or more destinations, which are pOuts or local parameters. In Virtools application, pOuts appear at the bottom of the behavior. They are also used when adding attributes to objects in Virtools.

When an pOut changes, its new value is automatically and instantly propagated to its destinations. See below (When are the values computed and propagated) for more details about value propagation.

Note that as destinations of pOuts are pOuts or local parameters, and not pIns, the destination of any pIn's source cannot be this pIn itself. And vice-versa : the destinations of a pOut do not have a source (as they are pOuts or local parameters).

Local Parameters :

Outlined in red are two local parameters, which are the sources of two pIns of the "Parameter Selector" behavior, and belonging to the enclosing Graph, as represented in the Schematic Editor of the Virtools application. The "sources" links are represented by dashes.

Local parameters are like pOuts: they store their value with the exception that can not have any destinations. It can be either created in memory in a Building Block , in order to store local values, or directly in the Schematic Editor of the Virtools application, in which case it belongs to the enclosing Graph Behavior.

Parameter Operations

Here is a parameter operation, which two pIns have two local Parameters as sources, and of which Parameter Outputs does not have destinations, as represented in the Schematic Editor of the Virtools application.

Parameter operations define and implement simple operations between parameters such as addition, multiplication, etc... They are limited to two pIns, which may or may not have sources. They always have one pOut.

A Parameter operation is only evaluated when the value of its pOut is asked, and it is evaluated each time its pOut value is asked. See below (When are the values computed and propagated) for more details about value propagation.

New Parameter Operations can be defined using the SDK. (See the Creating Extensions Plugins chapter for more details).

Parameter Links

Links between parameters do not have a class representation in CK2. They are just visual representations, in the Virtools application, of the source of an pIn, or of the destinations of an pOut. Note that these two types of Parameter Links have the same visual representation in Virtools, even though their meaning is different.

When are the values computed and propagated ?

Here are the rules:

And pIn does not store its value, but pulls (asks) it from its (unique) source.

An pOut or a local parameter stores its value.

A pOut immediately pushes its (new) value towards its destination(s).

If a pOut is the output of a Parameter Operation's pOut, when asked its value, it triggers the execution of the operation (which updates its value) before returning it to the requesting pIn and pushing it towards its destinations.

Here is an example:

  • When the Graph1 is executed, it executes the first behavior of its Graph, i.e. Beh1.
  • Beh1 needs the value of its pIn I1. The source link of I1 is followed.
  • The source of I1 is O1, the pOut of the Parameter Operation PO1 (an Addition). As it is the pOut of an Parameter Operation, the operation is executed. To execute PO1, the values of its pIns, I5 and I6, are needed.
  • The sources of I5 and I6 are also pIns, but of the enclosing behavior Graph1. We follow their sources again.
  • Their respective sources are L2 and L3, two Local Parameters of the Behavior enclosing Graph1. Their values are used as the inputs to PO1. The value of O1 is computed.
  • O1 has one destination, L1, a Local Parameter of Graph1. The new value of O1 is propagated to L1, which stores it.
  • The new value of O1 is also returned to I1, which requested it. So we now have I1's value: Beh1 is executed.
  • Suppose that it activates its output. Beh2 should be executed.
  • Beh2 needs the value of I2. The source of I2 is L1. L1 has its value stored and returns it to I2: Beh2 is executed.
  • Beh2 has an pOut, O2, that it fills with a computed value. O2 stores its value.
  • Suppose that Beh2 activates its output: Beh3 should be executed. It needs I3 and I4's values.
  • For I3, the source is O1, the pOut of PO1. As PO1 is a Parameter Operation, it is again computed, using the same process as before (eventually getting the values from L2 and L3 and performing the operation, and O1 pushing its new value down to L1, and returning it to I3, which had requested it).
  • For I4, the source is O2. O2 has a stored value and returns it to I4.
  • We have the values for I3 and I4: Beh3 is executed.
  • It fills up the value of its pOut, O3.
  • O3 has a destination, O4, so it propagates its new value to O4, which stores it.
  • Suppose that Beh3 activates its output: the output of Graph1 is also activated, and we are done executing Graph1.

Overall, during the execution of Graph1, the PO1 operation has been computed twice using the enclosing Local Parameters L2 and L3, and the pOut O4 has been set to a new value. We see that Local Parameters act as a kind of data buffer, that Parameter Operations are always computed, that pIns pull their values from their source and that pOuts push their values down to their destinations.

In this example, we can also see that we could have optimized the process by having I3 get its value from L1, instead of O1, thus saving one execution of the Parameter Operation PO1.

Parameters and the SDK

First of all, with the SDK, you can create new Parameters Types. Usually, when you defines new types, you need to define new Parameter Operations that know how to act on these new types. By analogy, it is like creating a new class in C++, with its associated methods. See the Creating Extensions Plugins chapter for more details.

The second case where you encounter Parameters while using the SDK is when you write Building Blocks. In the Building Block's functions (execution function, callbacks), you usually need to access the Parameter Inputs and set the value of your Parameter Outputs. In the SDK, the CKBehavior class provides helper functions to iterate over, and access the pIns and pOuts.

In a pIn, you can get the source, which is a pOut or a Local Parameter, and get its value. There are helper functions that automatically walk the Parameter Links to get the value.

In a pOut, you can set the value, which is automatically propagated to its destinations.

When you write Building Blocks, you can also create a Local Parameter for the Behavior, which will not be seen from the outside, but can be used to store local data between frames. You can set and retrieve the value of your Local Parameter in your execution and callback functions.


What are Behavioral Objects ?

General Concept

Behavioral Object have Behaviors

While behaviors are the central concept inside Virtools, they would be of no use if they where not attached to objects. Inside Virtools, the Behavioral Objects (BeObjects) are the objects which can have behaviors attached to them. They do not necessarily have behaviors, but they can. The BeObjects are the nouns of the Virtools language. The behaviors attached to a BeObjects may change this object or other objects, behavioral or not. All behaviors are attached to one and only one BeObject. BeObjects may have zero or many behaviors attached. When a BeObject has behaviors attached, it is said to be the owner of these behaviors.

Most of the objects found in the Virtools SDK are Behavioral Objects, but not all. For example, none of the objects of the VxMath library are BeObjects. All BeObjects are instances of classes derived from the important base class CKBeObject.

Behavioral Objects have Attributes

Behavioral objects can also have attributes, which is a way to attach almost any type of data to these objects. An attribute is defined by a type (or name) and the type of parameter value that is associated. Attributes data is stored inside Output Parameters so they can be used inside behaviors, through their Input Parameters.

Behavioral Objects and the Process Loop

Behavioral Objects are the entry point of the Behavioral Process of the Process Loop. All the processing that is done in this phase is done inside behaviors that are in a way or another attached to a BeObject.

Behavioral Objects have a priority that is used by the Behavioral Proces to decide the order in which BeObjects are iterated.

See the Presentation of the Behavioral Engine chapter for more details.

Behavioral Objects and the SDK

In the SDK, you generally access BeObjects through a specialized class that derives from CKBeObject (for example the CKMesh, or CKTexture), which provides specialized functions.

You may have to access the CKBeObject class directly, for example to get or set an attribute's value, or the priority, or more rarely to attach or remove a script.

Typically, access to a BeObject happens inside the execution function of a Building Block, and on the owner or on the target of the BB. See the What are Behaviors ? chapter for more details.


Level Organization

A Virtools composition (a cmo file) contains one and only one Level. The Level is the global container for all objects of the composition. There are many other ways of organizing objects inside Virtools, which are all accessible both through the Virtools application and through the SDK. Here are these means, which all have a different meaning and usage :

  • Context
  • Level
  • Scenes
  • Places
  • Portals
  • Groups
  • Arrays
  • Render Context

Context

There is one context (CKContext class) per Virtools composition. The context contains and gives access to all the objects and algorithms corresponding to a Virtools composition, including file management, memory management, main Process Loop, Managers, Plugins, Render Engine, etc.. It is the main organizational entity of CK2.

There may be many contexts in memory at a given time, if there are many Virtools compositions. Each context correspond to one level. A context is not a Behavioral Object.

See the CKContext class chapter for more details.

Level

There is one and only one Level (class CKLevel) per Virtools composition. The Level gives access to all the composition objects : BeObjects, Behaviors, Places, Scenes, Parameters, etc.. It also manages one or many RenderContexts.

The Level is a Behavioral Object itself, so behaviors can be attached to it.

A Level has at least one Scene, which is created when the Level is created. This scene is called the Level Scene, and contains all the objects of the Level.

Scenes

There is one or more Scenes (class CKScene) in one Level. A default scene is created along with the Level, which is called the Level Scene.

There is always one and only one active Scene per Level at a given time, and only the objects of the currently active scene may be active. The objects that are not member of the active scene will not be active (they will not be visible and their scripts will not be executed). So scenes are the preferred way to segment the level into large scale narrative elements or large time-based periods. The Level Scene (containing all the objects of the level) is made the active scene of the Level at startup. When a new scene is made active (started), the previous active scene is automatically deactivated.

When a scene is made active, it puts all its renderable objects (class CKRenderObject) in the RenderContexts of the Level.

Each object that is referenced in a scene has settings about what occurs when the scene is started :

  • Activity : To indicate if the object or script should be activated, deactivated or left in its current state when we start the scene.
  • Initial Conditions : Objects can have Initial Conditions (IC) on them so they start in given state, for example in a given position and orientation for a character.

Scenes are Behavioral Objects so they can have behaviors attached to them.

See the Scene Management chapter for more details.

Places and Portals

Just like Scenes are a way to organize time segmentation inside a Level, Places (class CKPlace) are a way to organize space segmentation in a Level. There may be zero or many places in a Level. There is no specific link between Scenes and Places.

Places are linked to each other by Portals (class CKPortal). One portal links two places. A place may have many portals, even to the same other place.

Places may contain zero or many 3D entities (CK3dEntity), of which they are the "Parent", so places are part of the 3D entities hierarchy. To add an 3D entity to a place, one only needs to add its higher ancestor to the place.

Places and Portals are used to optimize the rendering phase. The decision of what to display is done through the active camera. When the Portal system is active (Through the "Portal Management" building block for example ), the rule is the following :

Before each rendering phase, the list of places spatially containing the active camera of the level is computed, using the places bounding boxes. These places and all the places that have a portal with these places (and this recursively) are considered to be potentially visible, and processed through the rendering scheme. If an object is not member of one of these places, it will not be seen : it is immediately considered "out-of-view" (even though it may be active and its behaviors may be executed). If the Portal system is not active, there is no optimization of the rendering by places and portals (every 3D entity is considered potentially visible and only a hierarchical culling is done), but places may still be used to organize 3D entities hierarchically for other purposes.

Places are Behavioral Object and so can have behaviors attached to them.

See the Using Portals chapter for more details.

Groups

Groups are the simplest and most powerful organizational entity of Virtools. Groups are ordered lists of Behavioral Objects. They can correspond to any logical organization that you need. They may be created on the fly, reordered, iterated on, etc.. Many standard BuildingBlocks are provided for groups management.

Groups are themselves Behavioral Objects, so they can have behaviors attached to them, and be part of other groups.

See the Using Groups chapter for more details.

Arrays

Arrays are bidimentional matrices, which can contain simple data like floats, but also any kind of objects. Arrays are organized as typed columns (all the elements of a column must have the same type). They may be created on the fly, sorted, filtered, searched through, iterated on, etc.. Many standard Building Blocks are provided to arrays management.

Arrays are themselves Behavioral Objects, so they can have behaviors attached to them.

Set the Using Arrays chapter for more details.

Render Contexts

There are one or many Render Contexts (class CKRenderContext) per level. Render Contexts define which objects (class CKRenderObject) will be processed by the RenderEngine. Objects which are not in any Render Context will not be rendered at all. Objects which are in a RenderContext are eligible for rendering (even though they may not be rendered, if they are out of view of the camera, if the Portal system disables them, is they are invisible, etc..)

The render contexts are automatically managed by the system: when a scene starts, all its RenderObjects are added to the RenderContexts of the Level.

RenderObjects can be added to a RenderContext, in which case they will be rendered, whether or not they belong to the active scene or even to the Level. This is a easy way to create temporary objects used for rendering.

See the Using Render Contexts for details.


Presentation of the Render Engine

The Virtools engine uses an in-house 3D Render Engine, very modular, and ported on different 3D APIS (DirectX7,8,9, XBOX ,OpenGL (up to 2.0)).

The Render Engine of Virtools is called CK2_3D.

Description

The Virtools Render Engine is a 3D engine abstraction, as its API is independent of specific 3D hardware and software. This abstraction isolates the rest of the libraries, and especially the Behavioral Engine, from the details of 3D implementation.

Here is the list of 3D features that it provides or implements:

  • Hierarchical keyframe animation system with motion blending (mix of several animations) and warping (transitions)
  • Support for high level shaders with HLSL (DX9, XBOX)
  • Level of Detail on character animations
  • Support for Linear,Bezier and TCB animations
  • Morph animations ( with blending and warping too)
  • Skin & Bones System
  • Bicubic Patch Meshes (uniform tesselation)
  • Progressive Meshes
  • Spline Curves
  • Per Vertex Color
  • Procedural textures and movie textures
  • Multi Texturing
  • Rendering to a texture
  • Billboarded or axis constrained 3D Sprites
  • Sprites with hierarchical system
  • Hierarchical culling
  • DirectX7, DirectX8, DirectX9, OpenGl support
  • Compressed textures (DX7+ , OpenGL)
  • CubeMap textures (DX7+ , OpenGL)
  • Volume textures (DX8+)
  • Pentium III optimizations

And of course the standard set of default features (hardware dependant for some of them...):

  • Dynamic RGB lights
  • Vertex Fog
  • Mipmapping
  • Transparency
  • Texture Filtering
  • Perspective correction texture mapping
  • etc...

A lot of behaviors implements additionnal visual effects and functionnalities such as :

  • Particle system
  • Portal culling
  • Reflections
  • Environment Mapping
  • Collision Detections
  • Simple Shadows, Shadow casting
  • Motion blur
  • Lens Flares
  • Multi object morphing
  • Level of Detail
  • 360° environment map

Render Objects

The Render Engine actually implements all the Virtools objects having to do with geometry and imaging, like 2D entities, 3D entities, places, textures, lights, cameras, meshes, etc... Most of these object derive from the CKRenderObject class, but not all. All the instances of these objects live in the Render Engine, which is responsible for the memory management, the global consistency, and the interrelationships between these objects.

Also, the Render Engine manages the Render Contexts, that are used to keep a list of objects that should be rendered, and that are heavily used by the Behavioral Engine.

Rendering Loop

The Rendering Engine is responsible for the Rendering Process of the main Process Loop. This phase is called the Rendering Loop.

The Rendering Loop provides many callbacks that can be used by software elements inside Virtools in order to customize their rendering.

For more information, see the About the Rendering Loop chapter.

The main Process Loop is described in the Presentation of the Process Loop chapter.

Rasterizer

The CK2_3D Render Engine itself is built around a Rasterizer abstraction. A Rasterizer is an engine which, starting from a list of polygons, images, and rendering options, draws one frame. The rasterizer takes care of the relationships with specialized 3D hardware and software, thus isolating the Render Engine implementation from the very gory details.

The CK2_3D render engine provides four rasterizers: one for OpenGL, one for DirectX7, one for DirectX8 and one for DirectX9.

For more information on Virtools rasterizers, see the Presentation of the Rasterizers chapter.

Render Engine and the SDK


Changing the Render Engine

The Virtools library is designed so that the standard Render Engine can easily be replaced. This can be useful if you have your custom 3D engine that you would like to use.

Remember that you can highly customize the rendering process of the Render Engine, using various settings and callbacks. You should prefer this solution, whenever possible. See the Custom Rendering chapter for more details.

Remember also that the Virtools Render Engine is built on a software abstraction called Rasterizer. It may be simpler to create a Rasterizer than to create a whole Rendering Engine altogether. See the Presentation of the Rasterizers chapter for more details.

Software architecture

The Virtools Render Engine API consists of pure virtual C++ classes. These classes are declared in the CK2 library, but implemented in the Render Engine Plugin.

These classes correspond to all the objects that have to do with rendering, visualization, geometry and space, like CKMesh, CKCamera, CKLight, CKTexture, etc.... The Render Contexts (CKRenderContext) are the main organizational entities of the Render Engine, as they keep track of which objects should be rendered. (not to be confused with CKContexts, which are related to the main execution context of a Virtools content).

Replacing the Virtools Render Engine Plugin consists in creating a DLL that provides the CK2 library with another implementation of these pure virtual classes. It is thus a matter of replacing the current Render Engine Plugin DLL (CK2_3D.dll) with a new one, implementing the same pure virtual C++ classes.


About the Rendering Loop

The Rendering Loop and the main Process Loop

The Rendering Loop is called by the main Process Loop to do the rendering. It corresponds to the Rendering Process, that happens in every main loop cycle, after the Behavioral Process. See the Presentation of the Process Loop chapter for an overview of the main Process Loop.

The rendering loop is managed by the Render Manager, which manages all the Render Contexts. The CKRenderManager::Process executes the Rendering Loop. Optionnally, your executable can keep trace of all its render contexts and use the CKRenderContext::Render function to do the rendering. This is the preferred way if you want to master all the rendering options, and this is the solutions used by all the Virtools executables.

The Render Manager and Render Context implementations are part of the Render Engine. See the Presentation of the Render Engine chapter for an overview of the Render Engine.

The Rendering loop is highly customizable, through options and through callbacks. It basically draws all the objects starting from the background 2D objects, continuing with the 3D objects, and finishing with the foreground 2D objects. For details, see the Understanding the Render Loop chapter.

Callbacks

The standard rendering loop should be suffisant for most of your needs. But you may want to insert some custom processing at some moments of the rendering loop, like for example to draw temporary objects, or to make some late computations that are only needed if the object is actually rendered (thus saving some processing time if the object is not rendered). Callbacks are possible at all phases of the Rendering Loop.

To get called back, you should first attach your functions at the right place (this can be at the object level, or at a global level). You specify the function that you want called back, and when you want it called back. Dont forget to remove your callback when you dont need it any more.

You function is called back during the rendering process. It then has access to the current Render Context, which provides all the drawing primitives.

For details on render callbacks, see the Custom Rendering chapter.


Presentation of the Rasterizers

Presentation of the Rasterizer

The Rasterizer is a software abstraction introduced by Virtools, and on top of which the standard 3D engine is built. See the Presentation of the Render Engine for an overview of the Render Engine.

The Rasterizer is an API dealing with polygons, textures and rendering settings, and which basically, given these 3D elements, draws one 2D image intended to be shown on screen. It thus corresponds to the last phase of the rendering. It is a crucial phase, performance-wise, and it is often accelerated using specialized 3D hardware. As many such hardware, and hardware APIs exist, Virtools introduced this abstraction, in order to isolate the Render Engine itself from the underlying gory details.

Virtools comes with three rasterizers, for the most common 3D systems : DirectX7, DirectX8, DirectX9 and OpenGL.

Each rasterizer is implemented in a DLL. The Render Engine by default chooses the best rasterizer given the environment, but it can be forced to choose any other Rasterizer.


Virtools Plugins Overview

Around the CK2 library, which constitutes the core engine of Virtools, all the other functionalities of Virtools are implemented through plugins. A Plugin is defined as a DLL that comply to a certain set of rules and protocols, so that the core engine knows how to talk to it.

Virtools defines various kinds of Plugins :

  • Behavior Plugins : implement behaviors that can be applied to objects,
  • Media Plugins: import and export external media formats: bitmaps, video, sound or model
  • Managers Plugins: perform system-wide operations such as collision management,
  • Extensions Plugins : add new parameter types,
  • Render Engines Plugins : implement 3D rendering
  • Rasterizers : implement rasterizing

The SDK gives software programmers the ability to write any kind of Plugin, in order to extend Virtools functionalities.

Examples are provided in the SDK for all the Plugins types that can be written with the SDK. These examples are a good start for writing your own Plugins. See the Available Source Code chapter for more details.

General Plugin architecture information

Plugins using the SDK should be written in C++, and be compiled into a DLL. The only supported development environment is VisualC++ version 6.0. See the Compilation Settings chapter for more details.

These DLLs should then be placed in specific places in the file system in order to be taken into account by the Virtools library. If you write your own custom executable on top of the CK2 library in addition to writing Plugins, you can change the list of places that are used to search for Plugins. See the Using Plugin Manager chapter for more details. In Virtools behaviors (and their related managers) plugins are placed in the "VirtoolsBuildingBlock" directory, standalone managers in the "Managers" directory, Render engines and rasterizers in the "RenderEngines" directory and medias plugins in the "Plugins" directory. These directory are only here to organize things but their name is not used to identify the type of plugin inside so all the plugins DLLs could be placed in any directory they would still be recognized.

The Virtools library parses these Plugin DLLs at startup (so you should restart the executable for new Plugins to be taken into account). The Plugins management is done by the PluginManager. For each Plugin, a special function of the DLL (CKGetPluginInfo and the associated CKGetPluginInfoCount) is called to know which type of Plugin it provides. This is called the Registration phase.

Note that one DLL can provide many Plugins of different types, like for example a Manager, some associated Parameters and Behaviors. During the registration phase, the DLL should register all the Plugins that it provides.

See the See the Creating New Plugins chapter for more details.

Later on in the life of the Plugin and of the CK2 library, other functions of the DLL are called back. Exactly which function is called back at which moment depends on the Plugin type. See later for details.

Here are the main types of plugins that the Virtools core engine expects and that can be written with the SDK:

Behavior Plugins

Behaviors are at the heart of Virtools. Basically a behavior is the description of how certain type of objects act and react in time and according to their environment. Behaviors can implement from very simple actions (an arithmetic operation) to very complex ones (AI simulation for characters).

The name behavior is quite generic, and there are actually three types of behaviors: Building Blocks, Behavior Graphs and Scripts. Behavior Graphs and Scripts are defined in a structural way inside Virtools content, and are created using the Schematic Editor of Virtools application. Building Blocks are implemented in the form of C++ code. This C++ code resides in compiled form inside Behavior Plugins contained in DLLs. See the What are Behaviors ? chapter for more details.

The behavioral engine of the CK2 library does not contain the code of behaviors, but only the knowledge on how to manage and process behaviors. All the standard Building Blocks provided with Virtools are implemented inside external Behavior Plugins. These Behavior Plugins are dynamically loaded inside the executable at runtime.

As we have seen the Behavior Plugins register their type and the Building Blocks that they provide. When a Building Block defined by the Behavior Plugin is needed (for example, when it is drag and dropped into the Schematic Editor for the first time), the DLL is dynamically loaded inside Virtools, is asked to create a Behavior Prototype corresponding to the needed Building Block. This prototype describes the entry points and the options of the Building Block, like for example to which type of object it applies, its execution function, whether or not it should be called back when specific events happen to the behavior (callback and render callback), etc... When the content is played and the behavior is activated, the execution function is called and should do its job. The callback and the render callback are optionally called for specific processing.

Note that the Behavior Plugin never creates an instance of the CKBehavior class : the instance is created and managed by the Behavioral Engine. The Behavior Plugin is a set of C functions, and not C++ classes. These functions act on the object instances provided by the Behavioral Engine.

Using the Virtools SDK, software programmers can write their own Behavior Plugins, using the provided examples and templates, and using the CK2 entry points like: CKBehaviorPrototype, CKBehavior, CKParameterIn, CKParameterOut, etc... The detailed description of how to write a Behavior Plugin and how to connect it to the main behavioral engine is detailed in the chapter Creating Building Blocks.

Once written and compiled, Behavior Plugins can be distributed as closed software components that can be used inside Virtools, thus providing content developers with new functionalities that can be applied to objects. When a Behavior Plugin that is not part of the standard set of Behaviors is used in a content, the corresponding DLL must be distributed along with the content that uses it.

Media Plugins

Virtools is an integration platform. Like behaviors, the media are external to Virtools, and Virtools has no knowledge of media formats. Media Plugins are software components used by CK2 to import outside media into a form usable in Virtools, thus transforming the outside data into representations that can be interpreted by CK2. Media Plugins can also optionally export media. Media Plugin import and export media from memory, files or URLs. The Virtools application suite contains a few Media Plugins corresponding to usual formats..

Using the SDK, programmers can write their own Media Plugins, to manage their specific media formats, like for example an in-house image format, or sound format. There are 4 subtypes of Media Plugins:

  • Image Media Plugins
  • Sound Media Plugins
  • Video Media Plugins
  • 3D Models Media Plugins

See the Creation of Media Plugins chapter for more details.

Managers Plugins

Managers Plugins are software components that manage system-wide algorithms. They typically plug into the main Virtools process loop, and have helper Behaviors related to them, that when attached to objects inside a Virtools composition, talk directly to the Manager for processing and data sharing. For example, the collisions, the grids, the attributes are all managed by Managers inside Virtools. Basically, Managers implement all the processing that is not part of the core behavioral engine, and that could be taken out of the system without removing anything else than the functionality that they implement. Also they implement all processing that needs shared processing or data between individual Behaviors.

Using, the SDK, software programmer will be able to write their own Managers, which all derive from the base class CKBaseManager. For more information see the Creation of a New Manager chapter.

Extensions Plugins

The Extensions Plugins is a generic name for all extensions to the CK2 library which are not Media Plugins, Behavior Plugins, Managers Plugins, RenderEngine Plugins or Rasterizers. Today, the only other type of extension are Parameter Types and Parameter Operations.

Parameters types declare and implement data types that can be processed by the Virtools behavioral engines. The Parameter Operations are small programs that apply simple operations on these parameters.

Using the SDK, software programmers can implement their own parameters types and parameter operations. Once these parameter types are defined, they can be used seamlessly inside Virtools to connect to Behaviors that accept these parameter types. Usually, new Parameter Types and Operations go along with new behaviors or managers. So one often finds one DLL containing a Behavior Plugin, a Manager Plugin and an Extensions Plugin.

For more information, see the Creating Extension Plugins chapter.

Render Engines

The Virtools core engine relies on a Render Engine for its 3D rendering. The Virtools software suite uses its own Render Engine, called CK2_3D. This engine manages and processes all the objects that need to be rendered (3D : meshes, animations, textures, 2D: sprites, other : camera, lights, etc..) It relies on a Rasterizer for the rasterizing phase, that is the transformation of polygons and textures into one 2D image.

For more information , see the Presentation of the Render Engine chapter.

Rasterizers

Rasterizers are software components that, given polygons, textures and rendering options, draw one 2D image for blitting on the screen. Rasterizers are an abstraction introduced by Virtools, and are used as an underlying API for the standard Virtools Render Engine. The Virtools software suite provides 3 rasterizers, for three different 3D hardware and system platforms: DirectX5, DirectX7, and OpenGL.

For more information , see the Presentation of the Render Engine chapter.


Main Virtools Events

Behaviors or managers developers should be aware of the main events that can happen in Virtools. Behaviors and managers can intercept these events to perform specific actions.

The classic example is for behaviors that add custom rendering effects on objects using callbacks, these effects should be available only when the composition is playing not when it is edited inside Virtools interface.

Reset :

The first thing that happens before a composition is played and also the way a composition is stopped. Behaviors and managers can be warned than a reset operation occured. The behavior of our sample should remove its rendering callback when reciving this event.

Play (or Resume) :

Managers and behaviors are warned through this event that we start/resume playing a composition. In this case the behavior of our sample would add its rendering callback if it is active.

Pause :

Managers and behaviors are warned through this event that the execution of a composition is paused. The user has switch back to editing its composition inside Virtools for example.

Activation/deactivation of objects :

An object on which scripts where currently running can be (de)activated by another script. Behaviors that were on the objects won't be executed but can be warned of such events (in order to remove a rendering callback for example)

Scene Changes :

Since a composition can decomposed into several scenes it may happen that, during the execution of composition, a new scene is launched. Once again the behaviors and objects that are not referenced in the new scene won't be executed. So they may need to remove callbacks because they are not useful anymore.

Creation/deletion of objects :

At anytime an object can be created/loaded and added to the current scene. In the same way it can be deleted anytime, since developers may have added application data to such objects, these events should be handled if cleaning is required.

Rendering :

Since the behavioral process occurs before the rendering process, the execution of a behavior is not supposed to perform rendering but a behavior can add callbacks to modify/add rendering effects at almost any moment of the rendering loop.

Saving/loading :

Managers and behaviors are warned before and after a load/save operation occurs. The load event is often used by behavior to initialize their local data. In addition managers can add their own data to the file that is being saved.

Clear :

Managers and behaviors may have allocated memory during the edition/runtime of a composition. A "ClearAll" event is sent to managers when the user quits Virtools or starts editing a new composition.


Using Virtools SDK

Using the Virtools SDK

Presentation

Plan of Part 2 - Using Virtools SDK

This overview contains the following information :

  1. Changes in New Version
  2. Compilation Settings
  3. Using Base Classes and Tools
  4. Creating Building Blocks
  5. Using the Behavior Engine
  6. Using the Render Engine
  7. Using Sounds
  8. Creating New Plugins
  9. Creating a Standalone Application
  10. Binding New C/C++ functionality for VSL
  11. FAQ
  12. Additionnal Tools


Changes in New Version

Changes in Virtools SDK (3.5<= 3.0)

  • .NET 2003 : The Virtools DEV products are now built using Microsoft Visual C++ .NET 2003 instead of Visual C++ 6 . As a result plugins can no longer be compiled using VC 6.
    • A first draft of a .NET 2003 app wizard has been created to create a Behavior or Manager plugin: See the "Using the Visual C++ AppWizard to Create a Building Block" topic .
    • Compilation settings have changed for VC7.
  • A new class has been added to handle the playing of videos ( See CKVideo and CKVideoManager)
  • Fully commented source code for a new standalone Player is now available, explaining how a stand alone player can communicate with Virtools content using attributes to go fullscreen, change resolution, etc. The sample source code can be used to compile your own stand alone player (See Available Source Code)

Changes in Virtools SDK (3.0 <= 2.5.0.11)

  • New Virtools Interface SDK

    The Virtools Interface SDK facilitates the integration of external technology (DLLs) in Dev's user interface. This DLL editor now makes it possible to create user interfaces within Dev for your proprietary technology. For example, you could create a DLL to edit animations directly within Dev's GUI interface. (Be sure to check out the CHM files in the SDK folder for more information).

  • CK2/VXMATH

    • Template class XArray can have its content aligned into a specific memory boundary (aligned on 16 bytes for example)
    • The VxIndexedCopy function also exists using word indices now.

    • On Windows Platform the VxTimeProfiler class now use QueryPerfomanceCounter because it returns correct value on Intel processors with SpeedStep technology. Since the QueryPerfomanceCounter adds an important overhead when profiling small chunks of code a VxRDTSCProfiler class is available which is much more precise, have less overhead but is not "SpeedStep safe" so should only be used for profiling.
    • New manager event : OnRasterizerEvent , from a manager you can be notified from events concerning the current rasterizer, whether it is created, destroyed or resized (CKRST_EVENTS)

  • Render Engine

    • The way objects are rendered has been changed to minimize render states and to avoid sending primitives that are too small (in terms of number of faces) to the video card. Two new variables control this behavior: CK2_3D\DisableBatching and CK2_3D\BatchingMaxVertexCountToBeBatched.
    • CK3dEntity::AddPreRenderCallback, CK3dEntity::AddPostRenderCallback now have an additional argument to indicate whether the callback will be modifying the render pipeline (changing current render states, textures, matrices, etc.) to give a hint to the render engine when sorting the rendering per material.
    • VxDrawPrimitiveData structure was changed to store XPtrSrided members
    • Some enumerations and methods that were not used in the render engine or that could hinder certains optimisations were removed :
      • CK3dEntity::AreRenderChannelsVisible , CK3dEntity::SetRenderChannels
      • VX_MOVEABLE_RENDERCHANNELS,VXMESH_RENDERCHANNELS
      • CKMaterial::SetCallback , CKMaterial::GetCallback
      • CKMesh::AddSubMeshPreRenderCallBack, CKMesh::AddSubMeshPostRenderCallBack
      • CKMesh::SetFaceChannelMask, CKMesh::ChangeFaceChannelMask (Replaced by CKMesh::SetChannelFaceIndices )

    • New classes : CKShader and CKShaderManager were introduced to give access to high level shading languages such as HLSL or CG. The HLSL implementation is given in the sample source code available with this SDK (See Available Source Code).

  • New features included in patches (2.5.0.49 - 2.5.0.11)

  • The Visual C++ App Wizard now supports the creation of Manager plugins.
  • Added a variable to disable animation sorting... "CK2_3D/DisableAnimationSorting" : Animations are sorted by importance so that we can also use animation level of detail. If the Level of detail feature is not used the time needed to sort animations can be avoided by setting this variable to TRUE.
  • CKSprite has now a FlushSurfacePtr function to free the system memory used to store image data once it has been put on video memory.
  • CKTexture::SetDynamicHint, CKSprite::SetDynamicHint : On a DX8 or above rasterizer and with a graphic card that supports them, the texture or sprite will be created with the DX8 "dynamic" flag and so can be directly locked to write values.

  • VxVariableManager (unique instance) becomes CKVariableManager (one per CKContext) to support for several contexts running together with different configuration variables (ex: Web Player)

Changes in Virtools SDK (2.5.0.11 <= 2.1)

  • Global Variables :

    New global variables management : Any C / C++ variable can be exposed to the user through the use of the VxVariableManager (and CKVariableManager) . Theses variables can have their values saved in human readable .ini file or along with a Virtools composition file. This should be the prefered way of exposing settings of certains managers rather than having to code new behaviors.

    The VxVariable manager handles the registration of these variable through simple macros while the CKVariableManager is here to ensure variables are saved along composition files.

    Example :

int g_MaxNumberOfNodes = 50;

void MyModuleInitFunction()
{
    // Adding this macro will expose the variable to the interface so you can tweak your code or expose user some settings
    // The COMPOSITIONBOUND flag indicates that the variable value will be saved in CMO files...
    BIND("MyModule/Max Number of Nodes",&g_MaxNumberOfNodes,50,VxVar::COMPOSITIONBOUND,"A description that explain a little more ... ");

}

    This can also be a member of class, here is the registration of some of the render manager variables for example:

RCKRenderManager::RCKRenderManager(CKContext *Context):CKRenderManager(Context,"Render Manager")
{
    BIND("CK2_3D/Antialias",&m_VarAntialias,0,VxVar::NATIVECOMPOSITIONBOUND,"Enable the antialiasing (values from 2 to 16)");
    BINDREP("CK2_3D/BitmapSystemCaching",&m_VarBitmapSystemCaching,0,VxVar::NATIVECOMPOSITIONBOUND,"enum:0=Procedural;1=VideoShadow;2=Discard","Default system caching for sprites/textures being created");
    BIND("CK2_3D/DisableFilter",&m_VarDisableFilter,0,"Force the texture filtering to nearest (useful in software mode) ");
    BIND("CK2_3D/DisableDithering",&m_VarDisableDithering,0,"Disable the dithering (useful in software mode)");

....
}

    which then appear in the Variable Manager setup in Virtools Dev :

  • CK2

    • Managers (inheriting from base class CKBaseManager) can now handle 4 new events :PreBackToFront / PostBackToFront; PreFullscreen, PostFullscreen.
    • CKContext::LoadVerifyObjectUnicity and CKContext::SetUserLoadCallback were removed.
    • CKStateChunk::WriteArray and CKStateChunk::ReadArray were removed (can use WriteBuffer instead)

    • CollisionManager get a new method : OjbectBetween
    • CKContext::CreateObject now support a replace mode...
    • Changed CKAnimation::CreateMergedAnimation and CKObjectAnimation::CreateMergedAnimation to be able to generate dynamic animations.
    • Every CKObject derived classes have now a static cast operator (::Cast) checking the type.
    • CKTexture and CKSprite : 4 new methods to access the video memory surface pointer : LockVideoMemory / UnlockVideoMemory and control the system memory caching SetSystemCaching /GetSystemCaching.
    • CKWaveSound::GetPlayedMs now returns 0 if the sound is not playing.
    • A behavior can break the execution by returning CKBR_BREAK in its execution function, the execution loop is paused and the behavior is called until it returns a value != than CKBR_BREAK, meanwhile windows messages are still processed leaving the user the opportunity to use the interface....
    • Many optimisations on memory footprint issues. CKobject are created in fixed size pool for both speed and size benefits
    • CKSprite: Rendering of sprites can now be controlled for : Blending, Alpha Testing , Color Modulation and filtering : CKSprite::SetRenderOptions
    • New options to the CK3dEntity::RayIntersection method.
    • New methods CKbehavior- InsertInput, InsertOutput, InsertInputParam, InsertOutputParam
    • Modification and new behavior callback event to support undo capabilities: CKM_BEHAVIORLOAD, CKM_BEHAVIORCREATE, CKM_BEHAVIORATTACH, CKM_BEHAVIORDETACH, CKM_BEHAVIORDELETE (see Writing the Behavior Callback Function).

  • VxMath

    • VxMemoryPool constructor and allocate now take size in bytes and in number of dwords anymore.
    • CKMemoryPool scratch memory system is replaced by the VxScratch and VxScrachString class that gives acces to pools of memory for temporary storages.
    • New File management classes : VxStream, VxFile, VxBigFile to enable platform independant access to files...
    • Logging system :VxLog and VxLogListener classes added.

      Two classes have been added to enable the use of a logging system inside your code. Three default listeners have been implemented to log into : A log , console and the output window of the compiler. Logging can be specific to a given module (Behavior, Manager / Plugin) or global to the application. To enable logging in a module you just need to put

      Typical usage :

VXIMPLOGMODULEEX();	// This macro must be placed with the global variables of your module

void MyModuleInitFunction()
{
    // In the ini function of your module you need to identify the module
    // any VXLOG macro use in this module will output a string preceded by ["MyModuleName"]:LogString....
    VXREGLOGMODULEEX("MyModuleName");

    // Last we must precise where the logs should be put
    // either in the ouput console of visual studio for example:
    VXREGLOGDEBUG();

    // in a file (with a eventual filter on what to output)...
    VXREGLOGFILEEX("MyLogFile",VxLog::VLALL,0,VxLogListener::DATEMILLI);

    // or in a separate console window
    VXREGLOGCONSOLE();

....
}

      You can then call log macros to output messages in your code with following macros :

// These macros can be used as a printf function...

VXLOGD(...) // DEBUG
VXLOGT(...) // TRACE
VXLOGE(...) // ERROR
VXLOGI(...) // INFO
VXLOGW(...) // WARNING

    • New template class XNTree for n-ary trees
    • XArray has new InsertSorted method.
    • Operator -= in the XBitArray.

Changes in Virtools SDK (2.1 <= 2.0)

  • XString

    The XString class has greatly evolved :

    • You now have to link explicitely with VxMath.lib as soon as you use an XString class.
    • The Size() method is now called Length().
    • There is no more (char*) implicit conversion to avoid incorrect and hidden type conversions. You must now use the CStr() (for a const char*) and the Str() (for a char*) function explicitely.
    • The SubString() function has changed of functionning : it now takes the start index and the length instead of the start and end indices. It has been renamed Substring() to avoid silent replacement.
    • The FindLast() functions have changed to RFind() and there using is slightly different (see the documentation)
    • There is a bunch of new functions like Trim(), Strip(), Crop(), Cut(), Replace(), etc. that can make your code easier and more compact. You can get more details on them in the XString documentation.

  • Functions with allocation done inside Virtools DLL on a user provided container.

    • There were a few functions in the Virtools SDK that were taking a template container (XArray<T> for example) by reference and were filling it with data, causing an allocation to be done byVirtools DLLs, whereas the deletion will be done outside them, in user DLL. This was causing memory allocation conflicts when trying to debug a user DLL, compiled in debug with Virtools DLL in release.
    • Now at the price of a few changes in the code, the user should now be able to fully debug/edit and continue its DLL. The functions have globally changed from void Fill...(XObjectArray& oArray,...) to const XObjectArray& Fill(...) now in the user code, the call :

      XObjectArray myArray;

Fill....(myArray);

      can now be written

      XObjectArray myArray = Fill();

      Or better if you are sure not to modify the array you can avoid a copy by using:

      const XObjectArray&  myArray = Fill();

      Here is the list of the functions that have changed :

      CKMesh::ComputeMaterialList()
CKScene::ComputeObjectList(
CKLevel::ComputeObjectList()
CKRenderContext::Compute2DRoot()
CKRenderContext::Compute3DRoot()
CK3Dentity::GetChildren()
CKAttributeManager::FillListByAttribute()
CKAttributeManager::FillListByGlobalAttribute()
CKContext::CKFillObjectsUnused()
CKContext::GetObjectListByType()
CKContext::CopyObjects()
CKStateChunck::ReadObjectArray()

  • New classes

    • CKStructHelper

      A small class to ease the use of "Structure" parameter types.
    • VxConfig

      Helper class to acces the registry on Windows.
    • CKVertexBuffer

      Helps you store vertices in vertex buffers for devices that support them (otherwise a systeme memory backup is used) , this class provides methods to draw a list of primitives using the vertices stored inside it. It can reveal vry useful for terrain generation system or to store a large amount of static data. A vertex buffer is created with CKRenderManager::CreateVertexBuffer and destroyed with CKRenderManager::DestroyVertexBuffer

  • Methods

    • CKLevel::Merge / CKScene::Merge : A level or scene can now be merge in another using this method (same functionnality than the interface Merge)
    • CKMaterial::SetCallback : You can now add a callback function that will be called each time the material will be set as current on a render context (CKMaterial::SetAsCurrent) this enables the user to setup specific render states instead of using the material default settings

    • CKRenderManager::SetRenderOptions: As a .ini file was added to the render engine many of its integer settings (like antialiasing, dithering,etc..) can be set directly with this method
    • CKTexture::SetUserMipMapMode, CKTexture::GetUserMipMapLevel : You can now set your specific images for a given mip-map level.
    • VxResizeImage32 added VxMath performs arbitrary resizing of a 32 bit image
    • CKLight::SetLightPower : Added a light "power" which multiplies the light diffuse and specular color before they are used for rendering, thus enabling the user to change the influence of a light without changing its color value

Changes in Virtools SDK (2.0 <= 1.1)

  • New classes

    • CKContext

      For several content to be played in different threads we had to introduce the CKContext class which now contains most of the global functions that were in the form CK....() in the previous SDK. See The Context paper for more details.
    • CKSceneObject

      All objects that can be referenced as belonging to a scene now inherit from this class.

    • CKRenderObject

      Both CK3dEntity and CK2dEntity now derive from this class which presents the common methods to add/remove render callbacks and test the presence in a given render context.
    • CKParameter

      As local parameter can not have destinations parameters it was useless to make them derives from CKParameterOut, so the new class CKParameter now contain all the methods previously available on CKParameterout except the destinations management and both CKParameterOut and CKParameterLocal derive from CKParameter

  • New plugins type

    All Plugins (Rendering,behaviors,media readers,etc.) now use a standard CKPluginInfo structure to provide information to the engine. New plugin type are CKDataReader,CKSoundReader,CKBitmapReader,CKMovieReader,CKModelReader.

  • XTools

    A set of helper template classes which provide arrays,list,hash table,string have been added : XArray,XSArray,XList,XHashTable,XBinaryTree

  • CKObjectArrays and XObjectArrays

    CKObjectArray was a double-linked list which was use to store CKObjects in the previous SDK, this class is to be removed but some (rare) methods still use it. All other methods now take a XObjectArray,XObjectPointerArray which are respectively a XArray of CK_ID or XArray of CKObject* pointers.

  • Misc

    • VxMatrix definition is now a class instead of a simple float[4][4] typedef.

    • SetSlotBitmap methods have been removed from CKtexture/CKSprite

    • Render Callbacks don't take Vx... objects anymore but directly the CK..Objects (CKMesh,CK3dEntity,CKRenderContext...)

    • CKPGUID_TIME derives now from a Float and no more from an Integer. Thus if, in some of your own building blocks, you read a CKKPGUID_TIME input parameter, think to put its value inside a Float variable.

    • CKBehaviorPrototype,CKObjectDeclaration are not derived from CKObject anymore.

    • CK2dCurve and CK2dCurvePoint are not derived from CKObject anymore. This is important in the CK2dCurve case as it changes the way CK2dCurve is stored inside a CKParameter. In previous SDK a CK2dCurve parameter was retrieved doing :

        //---- OLD VERSION ! -------
    CK2dCurve* Curve = (CK2dCurve*)Beh->GetInputParameterObject(IndexParam);
    // or from a parameter
    CK_ID CurveID;
    ParameterOut->GetValue(&CurveID);
    CK2dCurve* Curve = (CK2dCurve*)CKGetObject(CurveID);

    From now on it becomes :

        CK2dCurve* Curve = NULL;
    Beh->GetInputParameterValue(&Curve);
    // or
    ParameterOut->GetValue(&Curve);

  • Behaviors

    Behaviors execution function and callback does not take the same parameters, for now on they are passed a CKBehaviorContext structure which contain the frequently accessed manager and global object :

    struct CKBehaviorContext {
    //--- Always available ----------------------------------------
            CKBehavior*		Behavior;		// Pointer to executed behavior
            float		DeltaTime;// Last Delta-Time in milliseconds since previous frame
            CKContext*		Context;		// The CKContext this behavior belongs to
            CKLevel*		CurrentLevel; 		// A Pointer to the current CKLevel
            CKScene*		CurrentScene; 		// A Pointer to the current CKScene
            CKScene*		PreviousScene; 		// A Pointer to the previous CKScene if available
            CKRenderContext*	CurrentRenderContext; 	// A Pointer to the main CKRenderContext
            CKParameterManager*	ParameterManager;	// A Pointer to the ParameterManager
            CKMessageManager*	MessageManager;		// A Pointer to the MessageManager
            CKAttributeManager*	AttributeManager;	// A Pointer to the AttributeManager
            CKTimeManager*		TimeManager;		// A Pointer to the TimeManager
    //--- specific to callback function-------------------------------
            CKDWORD CallbackMessage;			// Reason of the callback
            void* CallbackArg;			// Argument if given (rarely used)
        }


Compilation Settings

The samples included in this SDK use Microsoft® Visual C++ .NET 2003 project files and solution files that describe the appropriate source files, project resources, and linker settings for each sample. However, you might need to prepare settings for a new project of your own.

Note: The following discussion presumes the installation path for the SDK has been "C:\Program Files\Virtools\Virtools Dev 3.5\Sdk" to describe file locations. Your installation paths might differ.

Project properties

If you are using the provided sample project files, you do not need to verify these properties; they are specified with the provided project files. For new applications, choose Properties from the Project menu to make the following set of dialog boxes appear.

Note: For some properties we uses environment variable set by Microsoft® Visual C++ .NET 2003 like $(PlatformName), $(ProjectName), $(ConfigurationName) and $(SolutionDir).

  • Output / Intermediate Directory (where object files and other temporary files are created during the compilation) : you are free to set any path you want for those properties.

  • Additional Include Directories : you must set the Additional Include Directories property so it contains (at least) the Includes directory from the Virtools SDK (i.e. "C:\Program Files\Virtools\Virtools Dev 3.5\Sdk\Includes" by default or "..\..\..\Includes" for the samples delivered with the SDK).

  • Runtime Library : you must set the Runtime Library property Multi-threaded DLL in all configurations of your project.

  • Output File and Additional Library Directories : you must set the Output File property so the file is build in the appropriate directory (i.e. "C:\Program Files\Virtools\Virtools Dev 3.5\BuildingBlocks\$(ProjectName).dll" for a building block DLL or "..\..\..\..\BuildingBlocks\$(ProjectName).dll" for the samples delivered with the SDK). You also need to set the Additional Library Directories property so it contains (at least) the Lib\Win32\Release from the Virtools SDK (i.e. "C:\Program Files\Virtools\Virtools Dev 3.5\Sdk\Lib\Win32\Release" or "..\..\..\Lib\$(PlatformName)\Release").

    Note: The Virtools SDK does not contains debug libraries, so even in debug mode your project need to point to the Lib\Win32\Release directory.

  • Generate Program Database File :

Other information about project compilation

  • All plugins (exept sounds & bitmaps readers) applications link to the CK2.lib and VxMath.lib include libraries.

  • When building interface plugins you will also have to link with DllEditor.lib and InterfaceControls,CKControls.lib if you want to use controls with the same look than Dev interface.

  • Use devr.exe (and NOT dev.exe) to start your debug session.

  • The following table shows the various SDK components that might be used and the corresponding link libraries for those components.

    Component | Link library (*.lib)
    SDK Core Library | CK2.lib
    Math & System utilities | VxMath.lib
    Exporting Utilities | Ge2Virtools.lib
    Interface SDK | DllEditor.lib
    Virtools Controls | InterfaceControls.lib, CKControls.lib


Using Base Classes and Tools

  1. The Context
  2. Base Object Class
  3. The VxMath Library
  4. Using X Containers
  5. Dynamic Objects
  6. Using Groups
  7. Using Arrays
  8. Using State Chunks


The Context

The context is a new class introduced in version 2.0 to be able to have several compositions shared in a same process but in multiple threads. It acts as an execution context in which objects will be created and stored. There must always be an execution context to be able to load or play a composition or to create objects, a CKContext is created with :

CKContext* TheCKContext = NULL;
CKERROR res = CKCreateContext(&TheCKContext,MainWindowHandle,RenderEngineIndex);

but you should not need this unless you are building your own application (in which case you should also refer to the Creating a Standalone Application).

Whenever you are in a behavior , a manager or a plugin there is always an acces to the CKContext that was used to create these objects.

//-----------------------------------------------------------
// In a manager ,CKContext is a member of the base class CKBaseManager
CKContext* m_Context;

//----------------------------------------------------------
// In a behavior (callback or execution function
// a CKBehaviorContext is given that contains a pointer
// to the CKContext
CKContext* Context;

//----------------------------------------------------------
// Whenever you have a valid CKObject or CKBaseManager pointer
// you can call :
CKContext* CKObject::GetContext()
CKContext* CKBaseManager::GetContext()

  • Accessing the managers

As a central class in Virtools , the CKContext implements methods to access the manager which can be default Virtools managers or managers implemented by third-party.

//------------------------------------------------------
// Common Managers functions
    CKRenderManager*	GetRenderManager();
    CKBehaviorManager*	GetBehaviorManager();
    CKParameterManager*	GetParameterManager();
    CKMessageManager*	GetMessageManager();
    CKTimeManager*		GetTimeManager();
    CKAttributeManager*	GetAttributeManager();
    CKPathManager*		GetPathManager();
    XManagerHashTableIt	GetManagers();

//-- To access custom managers ------------------------
    CKBaseManager*		GetManagerByGuid(CKGUID guid);
    CKBaseManager*		GetManagerByName(CKSTRING ManagerName);

  • Manipulating Objects

Many objects in Virtools derive from the CKObject and need special methods to create, destroy or copy them. Moreover all these objects can be stored either by pointer or by CK_ID , the concept of the CK_ID being that is safe to keep a reference to an object by its ID (f it is later deleted,CKContext::GetObject will return a NULL pointer ). Many of the methods concerning CKObject accept both CK_ID or CKObject* version.

//------------------------------------------------------
// Objects Management
    CKObject*	CreateObject(CK_CLASSID cid,CKSTRING Name=NULL,CK_OBJECTCREATION_OPTIONS Options=CK_OBJECTCREATION_NONAMECHECK,CK_CREATIONMODE* Res=NULL);

//------- Copying --------------
    CKObject*	CopyObject(CKObject *src,CKDependencies* Dependencies=NULL,CKSTRING AppendName=NULL);
    void		CopyObjects(const XObjectArray& SrcObjects,XObjectArray& NewObjects,CKDependencies* Dependencies=NULL,CK_OBJECTCREATION_OPTIONS Options=CK_OBJECTCREATION_NONAMECHECK,CKSTRING AppendName=NULL);

//------- Deleting an object
    CKERROR		DestroyObject(CKObject *obj,DWORD Flags=0,CKDependencies* depoptions=NULL);
    CKERROR		DestroyObject(CK_ID id,DWORD Flags=0,CKDependencies* depoptions=NULL);
    CKERROR		DestroyObjects(CK_ID* obj_ids,int Count,DWORD Flags=0,CKDependencies* depoptions=NULL);

//---- Cleaning up dynamic objects
    void		DestroyAllDynamicObjects();

//----- Conversion from a CK_ID to CKObject*
    CKObject*	GetObject(CK_ID ObjID);

//----- Global count of the number of CKObject created so far...
    int	GetObjectCount();

//----- Approximation of the memory taken by an object in memory
    int	GetObjectSize(CKObject *obj);

//---- Finding objects by name ------------------------
// (This is definitely never a reasonable solution ! )
    CKObject*	GetObjectByName(CKSTRING name,CKObject *previous=NULL);
    CKObject*	GetObjectByNameAndClass(CKSTRING name,CK_CLASSID cid,CKObject *previous=NULL);
    CKObject*	GetObjectByNameAndParentClass(CKSTRING name,CK_CLASSID pcid,CKObject* previous);

//----- Creation of list given a  class ----------------
    CKERROR		GetObjectListByType(CK_CLASSID cid,XObjectPointerArray& list,CKBOOL derived);

//---- Direct access to list of object by class (Faster method)
    int	GetObjectsCountByClassID(CK_CLASSID cid);
    CK_ID*	GetObjectsListByClassID(CK_CLASSID cid);

//----------------------------------------------------------
// Current Level&Scene Functions
    CKLevel*	GetCurrentLevel();
    CKRenderContext*	GetPlayerRenderContext();
    CKScene*	GetCurrentScene();
    void		SetCurrentLevel(CKLevel *level);

  • Profiling & Debugging

Whenever you want to measure the time taken by a subset of your code or by the Virtools processing you can turn profiling on and use the following methods.The profiling is done using high precision timers (On PC platform the processor cycle counter is used)

//---------------------------------------------------------------
// Turning Profiling On and Off
void	EnableProfiling(CKBOOL enable);
CKBOOL	IsProfilingEnable();

//---------------------------------------------------------------
// Getting statistic from Virtools processing
void	GetProfileStats(CKStats *stats);

//---------------------------------------------------------------
// Use these methods to see in the Virtools Interface
// the time taken by ap art of your code
void	UserProfileStart(CKDWORD UserSlot);
float	UserProfileEnd  (CKDWORD UserSlot);
float	GetLastUserProfileTime  (CKDWORD UserSlot);

Writing messages to a console can help you debugging

//---------------------------------------------------------------
// Writing messages to a console
CKERROR	OutputToConsole(CKSTRING str, CKBOOL bBeep);
CKERROR	OutputToConsoleEx(CKSTRING format, ...);
CKERROR	OutputToConsoleExBeep(CKSTRING format, ...);

//---------------------------------------------------------------
// Writing messages to Virtools DEv status bar
CKERROR	OutputToInfo(CKSTRING format, ...);

  • Runtime methods for standalone application

If you are creating your standalone application you will have to control things like starting/stoping the playback of a compostion, loading

//-----------------------------------------------------------
// Engine runtime
    CKERROR	Play();
    CKERROR	Pause();
    CKERROR	Reset();
    CKBOOL	IsPlaying();
    CKBOOL	IsReseted();

//------------ Runtime mode
    CKERROR	Process();
    CKERROR  ClearAll();
    CKBOOL	IsInClearAll();

  • Loading/Saving files

//---------------------------------------------------------------
// Save/Load functions
    CKERROR	Load(CKSTRING FileName,CKObjectArray *liste,CK_LOAD_FLAGS LoadFlags,CKGUID* ReaderGuid);
    CKERROR	Load(int BufferSize,void* MemoryBuffer,CKObjectArray *ckarray,CK_LOAD_FLAGS LoadFlags);
    CKERROR	LoadAnimationOnCharacter(CKSTRING FileName,CKObjectArray *liste,CKCharacter *carac,CKGUID* ReaderGuid=NULL);
    CKERROR	LoadAnimationOnCharacter(int BufferSize,void* MemoryBuffer,CKObjectArray *ckarray,CKCharacter *carac);

    CKSTRING	GetLastFileLoaded();
    CKSTRING	GetLastCmoLoaded();
    void	SetLastCmoLoaded(CKSTRING str);

    CKERROR	GetFileInfo(CKSTRING FileName,CKFileInfo* FileInfo);
    CKERROR	GetFileInfo(int BufferSize,void* MemoryBuffer,CKFileInfo* FileInfo);
    CKERROR	Save(CKSTRING FileName,CKObjectArray *liste,CKDWORD SaveFlags,CKDependencies *dependencies,CKGUID* ReaderGuid=NULL);

    CKBOOL	IsInLoad();
    CKBOOL	IsInSave();

If you need to save a file you'll surely want to control the following save otpions like file compression, or textures and sounds storage mode.

//----------------------------------------------------------------
// File Save/Load Options
    void		SetCompressionLevel(int level);
    int		GetCompressionLevel();

    void		SetFileWriteMode(CK_FILE_WRITEMODE mode);
    CK_FILE_WRITEMODE		GetFileWriteMode();

    CK_TEXTURE_SAVEOPTIONS	GetGlobalImagesSaveOptions();
    void		SetGlobalImagesSaveOptions(CK_TEXTURE_SAVEOPTIONS Options);

    CK_SOUND_SAVEOPTIONS	GetGlobalSoundsSaveOptions();
    void		SetGlobalSoundsSaveOptions(CK_SOUND_SAVEOPTIONS Options);


Base Object Class

The CKObject is the base class of almost the objects in CK2. It contains the name of the object, its CK_ID and flags describing its states. All class derived from CKObject are created from the CKContext::CreateObject method, the context used to create an object can be retrieve with the CKObject::GetContext method . For more information about contexts, see The Context class paper.

The ID Concept : Details

CKObject::GetID : this function allows you to get the CK_ID of an object. This ID is given when the object is created and possibly released when the object is deleted. Only dynamic objects and object with no dependencies (like a CKParameterOut of a CKDataArray) release their IDs so they can be use by the next created objects. Otherwise, the ID remains until the next CKClearAll, pointing on a NULL object when asked by CKContext::GetObject.

Using ID ensures that you get either a valid or NULL pointer when you convert an ID to a CKObject* pointer. IDs are used as smart pointers could have been to avoid having references to objects that have been deleted. They are also used to store references to other objects in a CMO file

    // Object -> ID
    CKObject* o;
    CK_ID id = o->GetID();

    // ID -> Object
    CK_ID id;
    CKObject* o = context->GetObject(id);
  • Naming

    CKObject::SetName / CKObject::GetName : You give a name when creating an object with CKContext::CreateObject, but with the first function you can change it later on. The second function allows you to access the name of the object. The returned pointer on the string is given directly, so you must not delete it or even modify it directly. Object names aren't supposed to be unique but you can still search an object by it's name and possibly its CK_CLASSID with CKContext::GetObjectByName* functions.

  • Class

    CKObject::GetClassID : this function gets the CK_CLASSID, the type in a way, of an object. See Class Identifiers for a list of all CK_CLASSID availables in CK2 (see the Class Hierarchy for derivation information).

  • Visiblity functions:

    To hide and show an object, use CKObject::Show. You can hide an object with the command CKHIDE, show it with the command CKSHOW or hide it and all its hierarchy with the command CKHIERARCHICALHIDE. All the class cannot be hierarchically hidden, or even hidden. To see if an object of a specific class is able to be hidden, use the function CKObject::CanBeHide. To check if an object is visible, use CKObject::IsVisible. But if it was hidden by one of its parent, you must check if it is not hiererchically hidden with the function CKObject::IsHiddenByParent.

  • Flags

    The flags of the CKObject allows you too to see if the object is being deleted (CKObject::IsToBeDeleted) or to see if it's a dynamic object.

  • Application Data

    It is possible to associate arbitrary data to each instance of CKObject and derived classes. This data is not taken into account by the CK library. It is a service provided to the client application. The client application is responsible for the memory management of this data, for conflict resolution about the access to the data and for its internal organization. You attach the data with the SetAppData method and you get it back with the GetAppData method. You can remove the data with by calling SetAppData with a NULL argument.


The VxMath Library

VxMath is a useful tool library. It provides containers (see Using X Containers paper), mathematic (vectors, matrices) classes, Intersection routines, colors conversion classes and a blitting engine. All the headers of the VxMath library are shared inside the CK2 headers directory, so to use the VxMath classes and functions, you just have to link with VxMath.lib (only if you are using functions exported. You don't need to link with it if you only use inline functions (like the containers classes)). See the VxMath Reference for more details about VxMath.

Math Classes

A collection of classes and functions are given to help you working 3D space, transformations, screen coordinates, etc.

VxVector

This class is used to represent a point, or a vector in 3 dimensions. There are number of methods and functions to help you to calculate the magnitude of the vector, the cross product and the dot product of two vectors, to do operations between vectors, etc.

VxVector a,b(1.0f,0,0);
a.Set(1.0f,1.0f,0);

// calculation of the length between a and b
VxVector c = a - b;
c.z = 1.0f;
float len = Magnitude(c);

// Normalization of vector a
a.Normalize();

// calculation of the dot product between a and c
float dp = DotProduct(a,c);

// calculation of the cross product
VxVector cp = CrossProduct(a,c);

VxMatrix

This class is used to represent a 4x4 matrix used for transformations and projections. The matrix is stored as a column major. When used for transformations, matrices contains the scale, the position and the orientation of an object.

VxMatrix mat,invmat;

CK3dEntity* ent;

// we get the matrices of the entity
mat = ent->GetWorldMatrix();
invmat = ent->GetInverseWorldMatrix();

// We get the position of the entity
VxVector pos(mat[3]);

VxVector *vx,*vy,*vz;
// we get orientation as 3 base vectors
vx=(VxVector *)&mat[0][0];
vy=(VxVector *)&mat[1][0];
vz=(VxVector *)&mat[2][0];

// we get the scale of the entity
VxVector scale;
scale.x=Magnitude(*vx); // X Scale
scale.y=Magnitude(*vy); // Y Scale
scale.z=Magnitude(*vz); // Z Scale

// we get the orientation of the entity (in euler angles)
float eax,eay,eaz;
Vx3DMatrixToEulerAngles(mat,&eax,&eay,&eaz);

// we get the orientation of the entity (in quaternion) (and the position and the scale)
VxQuaternion quat;
Vx3DDecomposeMatrix(mat,quat,pos,scale);

VxVector local(1.0f,1.0f,1.0f),world;

// We tranform a POINT in the entity referential to the world
Vx3DMultiplyMatrixVector(&world,mat,&local);

world.Set(0,1.0f,0);
// we transform a VECTOR in the world to the entity referential
Vx3DRotateVector(&local,invmat,&world);

// we multiply the two matrices (the result should be identity)
VxMatrix result;
Vx3DMultiplyMatrix(result,mat,invmat);

VxQuaternion

A Quaternion is defined by 4 floats and is used to represents an orientation in space. You can create it from a matrix and create a matrix from it. You can also interpolate smoothly between two orientations with quaternions.

VxQuaternion quatA,quatB,quatC;

VxMatrix mat;
CK3dEntity* entA,*entB,*entC;

// warning this code works only for unitary matrices (no scale)
quatA.FromMatrix(entA->GetWorldMatrix());
quatB.FromMatrix(entB->GetWorldMatrix));

// we interpolate in the middle of the orientation of A and B
quatC = Slerp(0.5f,quatA,quatB);
quatC.ToMatrix(mat);

// we don't care here of the old position of C -> set in 0,0,0
entC->SetWorldMatrix(mat);

Vx2DVector

This class is used to represent either a vector, either a point in 2D space. There are number of functions to help you to calculate the magnitude of the 2D vector, to normalize it, and to do operations between two of them.

Vx2DVector vA(0,1.0f),vB(2.0f,0),vC;

// Distance between a and b

vC = vA - vB;
float dist = Magnitude(vC);

VxRect

This class is used to reprensent a zone in 2D space, like a region of the screen. It contains 4 coordinates : left, top, right and bottom, all in floats. It is mostly used by CK2dEntity. You can clip it to another VxRect, test a Vx2DVector to it, etc.

Vx2DVector vA,vB;
VxRect rect;

// find the rectangle bounding these two points
rect.Bounding(vA,vB);

// creating a rectangle going to (10,10) to (100,100)
// with 3 different methods

// corners
float a,b,c,d;
a = 10;
b = 10;
c = 100;
d = 100;
rect.SetCorners(a,b,c,d);

// dimensions
a = 10;
b = 10;
c = 90;
d = 90;
rect.SetDimension(a,b,c,d);

// center and half sizes
a = 55;
b = 55;
c = 45;
d = 45;
rect.SetCenter(a,b,c,d);

Color Class

VxColor

This class is used to store a color. It contains 4 floats : red, green, blue and alpha, ranging normally from 0 to 1.0f. You can create a VxColor from a DWORD (containing 4 colours, each one of a byte).

// creating a purple color
VxColor col(0xff00ffff);
VxColor col2(0x101010ff);

col *= 0.5f;
col += col2;

// we convert the VxColor into a DWORD
DWORD c = col.GetRGBA();

// or
DWORD c = RGBAFTOCOLOR(&col);

Blitting Functions

// Blitting functions
void VxDoBlit(const VxImageDescEx& src_desc,const VxImageDescEx& dst_desc);
void VxDoBlitUpsideDown(const VxImageDescEx& src_desc,const VxImageDescEx& dst_desc);

Intersection Classes

Several classes for intersection tests are provided. Rays (VxRay), Planes (VxPlane) , frustum (VxFrustum) and Bounding Boxes (VxBbox) can be created and test against each other with the intersection class VxIntersect. This class also provides functions to test triangles against each of the primitives presented before.


Using X Containers

CK2 provides templates containers such as arrays, lists and hashtables. As theses containers are template classes, you can use them with any types, any classes of yours but you need to override operator = and operator!= for non trivial classes (classes containing pointers and/or other classes).

Arrays

XArray and XClassArray

XArray and XClassArray are arrays that double allocated size each time the array is limit is reached, allowing less reallocation when inserting and removing elements. The XArray class is designed to store basic types such as int, float, pointers and simple structures because the memory is copied and moved in blocks. The XClassArray container can support any type of data, but you have to implement the operator = and the operator!= if you want to do search on it.

XSArray

The XSArray is an array designed to receive basic types, like the XArray container but it is tight fitting. That means its allocated size is exactly the number of elements contained in the array. Use this type of array for ones you know to be more or less static in size.

XArray<int> array;

array.PushBack(7);
array.PushBack(5);
array.PushFront(3);

for (int** it = array.Begin(); it != array.End(); ++it) {
    cout << *it << " ";
}

// the user should read 3 7 5

array.Resize(0); // clear the array without freeing allocated memory

Linked Lists : XList

The XList container is a double linked list designed to receive any particulat type of objects. As the list is double linked, you can insert at the front or at the end of the list with the same speed, so you can use this container also as a FIFO, FILO or a stack container.

XList<float> list;

list.PushBack(4.5f);
list.PushBack(5.6f);

XListIt<float> it = list.Find(5.6f);
list.Insert(it,4.8f); // insert 4.8 before 5.6

for (it = list.Begin(); it != list.End(); ++it) {
    cout << *it << " ";
}

// the user should read 4.5 4.8 5.6

list.Clear();
// if the list was used to store pointers, you need
// to iterate and delete each one before clearing the list

HashTables

Hash tables are container that allow you to store an object identified by an unique key. The key is "hashed" by an hash function provided by the user, and the result is used to find the index in an array of "buckets". This type of container allow you to find an element with its key in constant time (compared to O(n) for the lists or the arrays, and O(log(n)) for the binary trees). The hash tables exist in two flavors in CK2:

XHashTable

The XHashTable container maintain a linked list in each bucket that has at least an element. That means each insetion in the hash table requires a memory allocation (and so the deletion requires a memory freeing).

XSHashTable

The XHashTable stores its elements directly in the buckets. This way, no allocation is needed when inserting new ones, except when the buckets are all full. For conflict resolution (two elements fall in the same bucket), it uses linear probing, meaning that the element to insert is put in the next free bucket. Thus, searching can be significantly longer than with a XHashTable when many keys are hashed to the same bucket.

XHashTable<int,char*,XHashFunString> table;

table.Insert("august",8,FALSE);
table.Insert("november",11,FALSE);

cout << table["august"]; // the user should read 8

table.Remove("november");

int value;
if (table.LookUp("August",value))
    cout << "found " << value;
else
    cout << "Not found";

// the user should read not found due to the case mismatch

Binary Trees : XBinaryTree

The binary tree container is a container where elements are inserted sorted, so you have to provide a compare function (one which returns the result of the subtraction of the two elements is provided by default). Once the tree filled, you can iterate on it in ascending and descending order, search an element in O(log(n)).

XBinaryTree<int> tree;

tree.Insert(15);
tree.Insert(6);
tree.Insert(2);
tree.Insert(9);

if (tree.Find(9))
    cout << "found";
else
    cout << "not found";

void DisplayFunc(const int& i,void* arg)
{
    cout << i << " ";
}

tree.Iterate(DisplayFunc);
// the user should read 2 6 9 15

tree.BackIterate(DisplayFunc);
// the user should read 15 9 6 2

tree.Prefixe(DisplayFunc);
// the user should read 15 6 2 9

Bit Array : XBitArray

the XBitArray is simply an array of bits, which can be set or unset. It is stored in an efficient way (the size in memory is really the number of bits used).

XBitArray bitarray;

// we set 3 random bits
bitarray.Set(rand()%64);
bitarray.Set(rand()%64);
bitarray.Set(rand()%64);

// if the bit 48 is set, we unset it
if (bitarray.IsSet(48)) bitarray.Unset(48);
// similar command
bitarray.TestUnset(15);

int bitsset = bitarray.BitSet(); // number of bits set

String Class : XString

The XString class is a conveniance class to replace the old char*. It is similar to the CString class from Microsoft's MFC and is implemented as a XArray<char>.

XString s("hello");
s += " world";
cout << s;
// the user should read hello world


Dynamic Objects

Dynamic objects are volatile objects. They are deleted on a CKContext::Reset() and their CK_ID are freed for future use. They are ideal for objects that must be created dynamically and that have a short life period, like grenades or bullets in a shooter, or puzzle pieces in a Tetris-like game.

Creating a Dynamic Object

The creation of a dynamic object is very simple: It is the same function as usual, but with an additional flag. For example, to create a dynamic 3D Entity:

CK3dEntity* myDynEntity;

myDynEntity = (CK3dEntity*)context->CreateObject(CKCID-3DENTITY,"MyDynEntity",
                CK_OBJECTCREATION_DYNAMIC);

If you want your object to be rendered or to be behaviorally executed, you have to add it to the level.

CKLevel* level = context->GetCurrentLevel();
level->AddObject(myDynEntity);

Note that your object will appear in pink in the level view.

You can delete this dynamic object using CKContext::DestroyObject(), like any other object, or wait for the next CKContext::Reset().

Using Dynamic Objects

You can check if an object is dynamic or not by calling CKObject::IsDynamic()

You can use a dynamic object the same way as every object, except for some points:

  • The dynamic objects cannot be saved.
  • A normal object cannot be to turned to a dynamic one, and vice versa.
  • If you keep reference on dynamic objects, be sure to be warned for CKContext::Reset() and for objects deletion because your reference could not be valid anymore. In a manager, just override the OnObjectToBeDeleted() and test your stored reference by calling CKObject::IsToBeDeleted(). In a behavior, you have to store this object in a parameter of type CKPGUID_OBJECT, or derived : this way the parameter will be cleared automatically.
  • It is wiser to store pointers on dynamic objects than CK_ID because when a dynamic object is deleted, its CK_ID might be reused the frame after, so when accessing the object with the CK_ID, you might have an object, valid, but not the one you expected. By using pointers, it will most probably crash there because the memory pointed isn't an object anymore. So you'll find your bugs more quickly this way.
  • A dynamic object destroying cannot lead to a non dynamic object destroying. For example if a CKMaterial references a non dynamic CKTexture, its destruction, even with Full Dependencies or with the flag CK_DEPENDENCIES_DESTROY_MATERIAL_TEXTURE won't cause the destruction of the CKTexture.


Using Groups

Groups are ordered arrays of CKBeObjects. You can add objects, remove them, reorder them and test quickly if an object is in a particular group.

Creating a Group

First you creeate the object CKGroup:

CKGroup* group = (CKGroup *)context->CreateObject(CKCID_GROUP,"MyGroup");

Then you can add objects in two ways:

CKBeObject* beo;

// Add Object to the end of the group
group->AddObject(beo);

// Add Object to the start of the group
group->AddObjectFront(beo);

Note : The objects won't be added if they are already present in the group.

Accessing a Group

Once the objects added, you can access all the objects inside the group by using the GetObject() function:

for (int i=0; i<group->GetObjectCount(); ++i) {
    CKBeObject* beo = group->GetObject(i);
    // do your stuff here...

}

You can also remove elements from a group by using RemoveObject() or even remove all the elements of a group using Clear().

If you want to know if an object is in a specific group, you have to use the CKBeObject::IsInGroup() function. This function will quickly see if the object is in the group by a using a mask system, so without the cost of a group traversal.

To quickly know the nature of the elements store in the group, use the GetCommonClassID() function. It will give you the lowest common class id of object present in the group. For example, if you have nothing but CK3dObjects and CKCharacters, the function will return you CKCID_3ENTITY. This CK_CLASSID is recomputed on each insertion/removal so it won't take time to ask for it.

Another utility of the group is to quickly show/hide many objects : use the function Show() and all the objects contained in the group will be showed or hidden.


Using Arrays

Arrays allow you to store and retreive data such as floats, integers, objects or any types of Virtools parameters, in a two dimensional way : The array is formed of columns, each one of a unique type, defining the format of the array and of rows, each row containing the values.

Creating an array

Fist you create the object CKDataArray.

CKDataArray* array = (CKDataArray*)context->CreateObject(CKCID_DATAARRAY,"MyArray");

Then you need to define the format of the array. To do so, you add columns, precising the name, the type and eventually the parameter type of each one.

    // Creates an integer column
    array->InsertColumn(-1,CKARRAYTYPE_INT,"Age");

    // Creates an integer column
    array->InsertColumn(-1,CKARRAYTYPE_FLOAT,"Weight");

    // Creates an integer column
    array->InsertColumn(-1,CKARRAYTYPE_Object,"Object");

    // Creates a string column
    array->InsertColumn(-1,CKARRAYTYPE_STRING,"Name");

    // Creates a parameter vector column
    array->InsertColumn(-1,CKARRAYTYPE_PARAMETER,"Position",CKPGUID_VECTOR);

The first parameter in the InsertColumn() function is the position of insertion of the colum. When you want to add the column as the last one, use -1, like in the snippet above.

The second parameter is the type of data you want in the created column : You can choose among 5 primary types : CKARRAYTYPE_INT, CKARRAYTYPE_FLOAT, CKARRAYTYPE_STRING, CKARRAYTYPE_OBJECT (a CK_ID designing a CKObject) and CKARRAYTYPE_PARAMETER (a CKParameterOut* stored in the array). In the case of the last type, you need to provide a parameter GUID too, like CKPGUID_VECTOR in our example.

When you have finished creating the format, you can start actually filling the array.

CKDataRow* newrow = array->InsertRow(-1);

This line of code insert a new row at the end of the array. To insert at a position, give the position index instead of -1.Once the row is added, you have to store values in this row. Here what looks like row filling in the case studied here :

//-----------------------------------
// Brute Force Method

// Integer
(*newrow)[0] = 5;

// Float
float f = 65.3f;
(*newrow)[1] = *(DWORD*)&f;

// Object
CKObject* o = // object we created elsewhere
(*newrow)[2] = o->GetID();

// String
(*newrow)[3] = (DWORD)CKStrdup("test");

// Parameter
CKParameterOut* pout = (CKParameterOut*)((*newrow)[4]);
VxVector v(2,3,4);
pout->SetValue(&v);

-- OR --

//-----------------------------------
// Easy Way (but slower)

int i = 5;
array->SetElementValue(0,0,&i);

float f = 65.3f;
array->SetElementValue(0,1,&f);

CKObject* o;
array->SetElementObject(0,2,o);

char* name = "test";
array->SetElementValue(0,3,name);

VxVector v(2,3,4);
array->SetElementValue(0,4,&v);

Retrieving Rows

Once your array is filled, you usually wants to retreive rows of data. You can do it in two ways.

First by accessing directly the row by its index: The function GetRow() gives you access to the CKDataRow* of the line wanted, or you can access each element by a more convenient way with the functions GetElementValue(), GetElementObject(), each one taking the searched row and column indexes.

The other way to retreive data in an array is by value. You will then use the FindRow() function. Here is an example of use:

// Method 1

CKDataRow* found = array->FindRow(0,CKEQUAL,0);
if (found) (*found)[0] = 1;

// Method 2

int index = array->FindRowIndex(0,CKEQUAL,0);
int i = 1;
if (index >= 0) array->SetElementValue(index,0,&i);

This code search for a 0 in the fist column of the array and if it finds one, it replaces with a 1. You have 6 operators of comparison available (CKEQUAL, CKNOTEQUAL, CKGREATER...) and you can tell the searching functions to start the search from a specific index (like for example the last value found.)

Array Operations

There are many operations you can do on an array:

- Deleting : Fist you can remove a row (with RemoveRow()), a column (with RemoveColumn()), or remove all the rows (Clear()).

- Ordering : You can change the order of the rows, by swapping them (SwapRows()), moving them (MoveRows()), sorting them on a column (not relevant for object and parameters) (Sort()). You can reverse and shuffle the rows too (Reverse() and RandomShuffle()). You can also move columns (Movecolumn()).

- Arithmetic Operations: ColumnsTransform() and ColumnOperate() allows you to apply an operation on each element of a column or to apply an operation between elements of two columns, and store the result in a third column. Sum() and Product() calculate respectively the sum of all the elements of a column and the product of them. Note that all these functions works only on primary types CKARRAYTYPE_INT and CKARRAYTYPE_FLOAT.

- Extremum Search: You can find the highest and lowest value in a colum by using GetHighest() and GetLowest(), and you can find the nearest element in a column of a given value. Once again, it only works with float and int.

Array Reading/Saving

The last thing you can do on an array is saving it to an ASCII file (WriteElements()), and thus, reading it from an ASCII file (LoadElements()). This last function allows you to read an array from a Microsoft Excel© ASCII formatted file, each value on a same row being separated by a tabulation. Elements are read from string value so the loading will also works with parameters (a vector will be read in the format 0,1,2 for example) and objects (an object with the same name will be matched and stored in the array).


Using State Chunks

Using State Chunk

This paper describes how to use the CKStateChunk class. It is used to store informations about an object either to save it in the general Virtools composition file or to store a state of the object (IC, States...). For more information on saving and loading (for parameters, managers...), please refer to the "Load Save documentation".

General Description

A state chunk is a structure used to store informations This structure is used by any class of Virtools SDK to save or load data but they can be use anytime you need to store a consistent block of data.

The following graphic describes the structure of a state chunk from a user point of view. It is only an example, the internal structure entirely depends on what you want to store in it. In this example, we have defined two identifiers that are used to retrieve a start position. The first identifier marks the start of a sequence of datas In this case it is two elements of a structure: 3D Entity, Float, Float, Float. The second identifier marks the start of a new sequence of single objects : Buffer, Float, Integer and Float.

When you create a state chunk, you have to define your own identifier and the sequence inside the state chunk is entirely defined by the way you fill the state chunk. When reading it back , you will have to use the same type sequence.

Create / Delete

You usualy don't need to create your own state chunk. The system gives one that you simply need to fill.. Anyway, two global functions allow you to create a state chunk and one to delete it. The given parameters have the following meaning :

  • id : defines the type of the state chunk. Virtools stores the CK_CLASSID of the object being saved but when you create your own state chunk you can use any value,
  • file : file where the state chunk will be saved. Can be NULL if the chunk is not to be saved inside a file,
  • chunk : state chunk you want to copy or delete.
CKStateChunk*  CreateCKStateChunk(CK_CLASSID id,CKFile* file=NULL);
CKStateChunk*  CreateCKStateChunk(CKStateChunk* chunk);
void           DeleteCKStateChunk(CKStateChunk* chunk);

Open / Close

As for a file, you need to prepare the chunk before writing or reading it. Once your work is over, you need to close it using the following functions.

void  StartRead();
void  StartWrite();
void  CloseChunk();

Identifiers

Each identifier is a unique DWORD stored in the structure of the state chunk that notify the start of a sequence of data. Identifiers only have to be unique inside a same chunk therefore you can safely set your identifiers to be 1,2,3,etc... You can create as many identifiers as you need but an identifier must be used once and only once inside a chunk. To do so, you simply write your identifier through its unique DWORD id :

Note : You must always write an identifier before writing anything else to a buffer !

void WriteIdentifier(CKDWORD id);

When you read, you then simply need to look for the identifiers you've defined to retrieve the starting position of your sequences. Two functions allow you to seek for a given identifier. The first one simply moves the reading pointer after the identifier position, the second one also returns the memory size until the next identifier of the sequence.

CKBOOL  SeekIdentifier(CKDWORD identifier);
int     SeekIdentifierAndReturnSize(CKDWORD identifier);

Write / Read

The reading sequence must be the same than the writing sequence for a given identifier. For each data you want to read or write, you need to use the function corresponding to the type of this data. A state chunk does not store information about

the data types you used when writing.

Simple Types

void  WriteByte(CKCHAR byte);
void  WriteWord(CKWORD data);
void  WriteDword(CKDWORD data);
void  WriteDwordAsWords(CKDWORD data);
void  WriteInt(int data);
void  WriteManagerInt(CKGUID Manager,int val);
void  WriteFloat(float data);
void  WriteString(CKSTRING str);
void  WriteGuid(CKGUID data);
void  WriteVector(const VxVector& v);
void  WriteVector(const VxVector* v);
void  WriteMatrix(VxMatrix mat);

CKBYTE   ReadByte();
CKWORD   ReadWord();
CKDWORD  ReadDword();
CKDWORD  ReadDwordAsWords();
int      ReadInt();
int      ReadManagerInt(CKGUID* guid);
float    ReadFloat();
int      ReadString(CKSTRING* str);
XString  ReadString();
CKGUID   ReadGuid();
void     ReadVector(VxVector& v);
void     ReadVector(VxVector* v);
void     ReadMatrix(VxMatrix mat);

Arrays and Buffers

- char or BYTE buffers :

When writing char or BYTE buffers, no endianness conversion must be performed. The following functions are used for buffer and array with the following parameters :

  • count : number of elements,
  • element_size : size of one element,
  • buffer : the buffer to read or to write,
  • size : total size of the buffer.
  • WriteBuffer / ReadBuffer, ReadAndFillBuffer : when you use this functions, the system first store the size of the buffer and only then the buffer. Therefore, you don't need to give the size of the buffer to read it. In the case where you don't want this size to be stored (if you already know it when loading for example), you should use the following functions. ReadBuffer actually allocates the buffer for you (If it has to be deleted afterwards you must you the CKDeletePointer function) while ReadAndFillBuffer presumes that the buffer is already allocated to the correct size.
  • WriteBufferNoSize / ReadAndFillBuffer : these functions do not store the size of the buffer in the state chunk. you should use them for none variable size buffers.
  • WriteArray wrrites count elements,ReadArray will return the number of elements (not the size)
void WriteArray(int count,int element_size,void *buffer);
int  ReadArray(void** buffer);
void WriteBuffer(int size,void *buffer);

void WriteBufferNoSize(int size,void *buffer);
int  ReadBuffer(void** buffer);

void ReadAndFillBuffer(void* buffer);
void ReadAndFillBuffer(int size,void* buffer);

- WORD or DWORD (int,float) buffers

  • LEndian format : on Macintosh and PC, all datas larger than a BYTE have a different saving format. PC uses the little Endian format where Macintosh uses the big endian one. To ensure the plateform independency of a composition, you need to be aware of this. By using the LEndian writing functions, you force the system to store the data in the litlle endian format whatever is the current plateform. Afterward, by using the LEndian reading functions, you notify the system that it is reading a little endian format, it will then translate it automatically to the current plateform format. The Lendian extension indicates that you are working on 32 bits data (DWORD,int float) and the Lendian16 extension indicates that you are working with 16 bits data (WORD,short int)
void  WriteArray_LEndian(int count,int element_size,void *buffer);
void  WriteArray_LEndian16(int count,int element_size,void *buffer);

void  WriteBuffer_LEndian(int size,void *buffer);
void  WriteBuffer_LEndian16(int size,void *buffer);
void  WriteBufferNoSize_LEndian(int size,void *buffer);
void  WriteBufferNoSize_LEndian16(int size,void *buffer);

int   ReadArray_LEndian(void** buffer);
int   ReadArray_LEndian16(void** buffer);
void  ReadAndFillBuffer_LEndian(void* buffer);
void  ReadAndFillBuffer_LEndian(int size,void* buffer);
void  ReadAndFillBuffer_LEndian16(void* buffer);
void  ReadAndFillBuffer_LEndian16(int size,void* buffer);

WriteDwordAsWords,ReadDwordAsWords : Stores or reads a DWORD value (32 bit unsigned integer)
    as two WORD values (16 bit unsigned integers) with correct endianness.

Bitmaps

void  WriteRawBitmap(const VxImageDescEx& desc);
void  WriteReaderBitmap(const VxImageDescEx& desc,CKBitmapReader* reader,CKBitmapProperties* bp);

BYTE*   ReadRawBitmap(VxImageDescEx & desc);
CKBOOL  ReadReaderBitmap(const VxImageDescEx & desc);

Objects

To store the reference to an object inside a state chunk you need to store its ID. At saving time, every object in Virtools has a unique ID that was generated by the system at the creation of the object, it is this ID that is actually stored in the state chunk. After, at loading time, Virtools regenerates these IDs to simplify its internal management of objects. It then remaps the system to replace all the references to the old ID in the context to the new one.

  • WriteObjectID / ReadObjectID : stores the ID of the object in the context of the saving time and returns the ID of this same object in the context of the loading time,
  • WriteObject / ReadObject : stores the ID of the object in the context of the saving time and returns this same object,
  • WriteObjectArray / ReadObjectArray,XObjectArray::Save/Load : simply store and retrieve an array of objects. The system only stores the number of elements of the array and their IDs.

void  WriteObjectID(CK_ID obj);
void  WriteObject(CKObject *obj);
void  WriteObjectArray(CKObjectArray *array);

CK_ID           ReadObjectID();
CKObject*       ReadObject(CKContext* );

void            ReadObjectArray(CKObjectArray *array);
CKObjectArray*  ReadObjectArray();

XObjectArray::Save(CKStateChunk* chunk);
XObjectArray::Load(CKStateChunk* chunk);

Examples using state chunks

Here, we will describe several loading and saving functions using state chunks. As example, we will see a sample manager.

Sample Manager Saving Fonction

The following commented code is the saving fonction a sample Manager. You can inspire yourself from it for any manager saving functions.

We find here all the needed steps of a saving operation :

In this sample we suppose the manager has a list of structures to save :

struct MyStruct {
    int		MyIdentifier;

    CK_ID		Object;
    CKSTRING	ObjectDescription;
    char*		ObjectBuffer;
    int		ObjectBufferSize;
    DWORD		DwordTab[8];
    WORD		WordTab[8];

  };
  • creation of the state chunk - optionnal if the system gives a state chunk not like here,
  • opening of the state chunk to write,
  • writing in the sate chunk,
  • closing of the state chunk,
  • deletion of the state chunk - optionnal if the system does it afterwards like here.
#define MYCHUNK_ID 1234
#define MYCHUNK_VERSION1 1
#define MYCHUNK_IDENT1 1
#define MYCHUNK_IDENT2 2

CKStateChunk* MyManager::SaveData(CKFile* SavedFile)
{
  if (NothingToSave) return NULL;

    // Creation of the state chunk with a newly defined ID
    CKStateChunk *chunk = CreateCKStateChunk((CK_CLASSID)MYCHUNK_ID,SavedFile);

    // Opening the state chunk for writing
    mychunk->StartWrite();

    // DATA SAVING
    // We start by setting a version to the data stored in the chunk
    // so that we can manage future version
    mychunk->SetDataVersion(MYCHUNK_VERSION1);

    // Create a new identifier marking the beginning of the relevant
    // informations for the font.
    mychunk->WriteIdentifier(MYCHUNK_IDENT1);

    // Write a first integer : number of structure saved
    mychunk->WriteInt(StructureCount);

    // Writes each font information sequencially
    for (int i = 0; i < StructureCount; ++i) {
        MyStruct* mystruct = &m_MyStructures[i];

        // Writes a integer
        mychunk->WriteString(mystruct->MyIdentifier);
        // Writes a string : the current object description
        mychunk->WriteString(mystruct->ObjectDescription);
        //// Writes the ID of the object
        mychunk->WriteObjectID(mystruct->Object);
        // Writes the buffer
        mychunk->WriteBuffer(mystruct->ObjectBufferSize,mystruct->ObjectBuffer);
        // Writes the DwordTab buffer , since it is DWORDs
        // we need to precise it, and we already know the size
        mychunk->WriteBufferNoSize_LEndian(8*sizeof(DWORD),mystruct->DwordTab);
        // Writes the DwordTab buffer , since it is WORDs
        // we use the Lendian16 version of WriteBuffer
        mychunk->WriteBufferNoSize_LEndian16(8*sizeof(WORD),mystruct->WordTab);
    }

    // Close the chunk
    mychunk->CloseChunk();

    // Returns it to the system that will delete it when necessary
    return mychunk;
}

Sample Manager Loading Function

The following commented code is the loading function of our sample Manager. You can inspire yourself from it for any manager loading functions. As you can see it, the retrieve order of the informations is exactly the same than the saving order we've used in the previous function.

We find here all the needed steps of a loading operation :

  • opening of the state chunk to read,
  • reading in the sate chunk,
  • closing of the state chunk,
CKERROR MyManager::LoadData(CKStateChunk *chunk,CKFile* LoadedFile)
{
if (!chunk) return CKERR_INVALIDPARAMETER;

    // Opening the state chunk for reading
    chunk->StartRead();

    ///////////////////////////////////
    // DATA LOADING
int DataVersion = chunk->GetDataVersion();

    // Seek for the identifier we have define in this chunk.
    // It positions the reading position after the identifier.
    if (chunk->SeekIdentifier(MYCHUNK_IDENT1)) {

        // Reads an integer : the number of structures to retrieve
        int sn = chunk->ReadInt();
        if (sn) {
            m_MyStructures = new MyStruct[sn];

            // Reads each structure information sequencially
            for (int i = 0; i<fn; i++) {

                //  ReadInt()
                MyStructures[i].MyIdentifier = chunk->ReadInt();

                //  ReadString() will allocate the buffer : object description
                chunk->ReadString(&MyStructures[i].ObjectDescription);

                //  Read the object ID (automatically remapped)
                MyStructures[i].Object = chunk->ReadObjectID();

                // Reads the char buffer and returns the size of the allocated buffer
                MyStructures[i].ObjectBufferSize =
                        chunk->ReadBuffer(&mystruct->ObjectBuffer);

                // Reads the DwordTab buffer , since it is DWORDs we need to precise it
                // and we already know the size
                chunk->ReadAndFillBuffer_LEndian(8*sizeof(DWORD),MyStructures[i].DwordTab);

                // Reads the WordTab buffer , since it is WORDs we need to precise it
                chunk->ReadAndFillBuffer_LEndian16(8*sizeof(DWORD),MyStructures[i].DwordTab);
            }
        }
        // No Need to close a chunk when reading
    }

    return CK_OK;
}


Creating Building Blocks

Virtools provides a standard behavior set, in the form of Building Blocks. Although this set is quite exhaustive, you may need to create your own behaviors. You can do this using the SDK.

You usualy need to create your own behavior in three cases :

  • when the behavior you need does not exists and cannot be done using Behavior Graphs,
  • when you want a large Behavior Graph that is used very often to be faster, and want to replace it by a Building Block programmed in C++,
  • in order to give access to a custom Manager.

You can have an general overview of Behaviors in the What are Behaviors ? chapter.

The source code of all the standard Virtools Building Blocks is provided with the SDK. This is a good place to start to write your own BBs. See the Available Source Code chapter for details.

The basic concept is to create a DLL that implements a Behavior Plugin. A general discussion on Plugins implementation can be found in the Creating New Plugins chapter. A specific VisualC++ AppWizard is provided to create Behavior Plugins and is explained in the Using the Visual C++ AppWizard to Create a Building Block chapter.

This DLL should be placed in special places ("BuildingBlocks") in the file system in order for Virtools to find it.

The implementation of a custom Building Block can be split in successive steps. An overview of these phases is given in the Main Steps of Building Block Creation chapter. These phases are then detailed in their respective chapter:

  • Declaration of the Building Block
  • Behavior Prototype Creation
  • Writing the Execution Function
  • Writing the Behavior Callback Function
  • Building Block Classes
  • Creating a Custom Building Block Dialog Box


Using the Visual C++ wizard to create a Building Block

The SDK contains a Visual C .NET 2003 wizard to help you set up the initial framework of a Behavior Plugin.

Installation

Copy the two folders vcprojects and wcwizards in your .NET visual C++ directory

\Microsoft Visual Studio .NET 2003\Vc7\

Usage

To trigger the App Wizard, in Visual C++ 7.0, select the File->New->Project menu item, and then, in the "Visual C++ Projects" directory, select the "Virtools Dev BB and Managers" item. Specify your Project Name and your path. Note that the Project Name will also be the name of the C++ source file for the Plugin DLL (.cpp), so spaces are not advised. Hit OK : a custom window appears.

Choose Building Block wizard.

Step 1

Specifying your Building Block structure, name and GUID :

  • A field is provided for the BB name (Mandatory). This is the name that will appear in the Virtools application, as well as the name of the source C++ file (<name>.cpp) corresponding to the BB, so spaces are not advised.
  • A button generates a new random GUID each time you click on it. Select a GUID.
  • A field lets you choose to which Virtools class the BB will be able to be attached
  • Radio buttons let you choose the number of Inputs and Outputs
  • To Add Parameter Inputs and Parameter Outputs :
    • A field lets you choose its type.
    • A field lets you choose its name.
    • A + button allow you to add the parameter.
  • To Remove Parameters press the - button

Step 2

Specifying your Building Block Flags :

A number of check boxes (self explaining labels) let you define your BB flags.

Step 3

Specifying your Building Block Callbacks, Category and Description:

  • A number of check boxes (self explaining labels) let you define your BB Callbacks.
  • Two fields let you define your BB category and description. The category (ex: "Logics/Messages") defines the place where the BB will appear in the Virtools Building Blocks Editor.

Please try to use the existing categories as much as possible. Two level of hierarchy only. The description appears in the Virtools Building Blocks Editor when the user selects it.

Final step

The plugin settings

  • The first two fields let you give information about the plugin.
  • Two other fields let you give information about the author: its name and GUID. Each author should define its own GUID and use it for all the BB that (s)he creates.
  • Two last fields let you define the location of the Virtools SDK and the Virtools application executable in your file system. These information are used to set up the compilation Settings of the project.

Hit Finish, read the summary and accept or cancel to change some information. Accepting creates the project and inserts it into the current workspace. You can then edit the source files to set up your own execution function and implement your callbacks. Please refer to the rest of the documentation for implementation specifics :
  • Main Steps of Building Block Creation
  • Declaration of the Building Block
  • Behavior Prototype Creation
  • Writing the Execution Function
  • Writing the Behavior Callback Function
  • Building Block Classes
  • Creating a Custom Building Block Dialog Box


Main Steps of Building Block Creation

This chapter describes the main steps for the creation of a new Building Block (BB), using as an example the creation of the Building Block : "Get Delta Time". It will not describe the functions used. For more informations about those, you should refer to Declaration of the Building Block, Behavior Prototype Creation, Building Block Classes, Writing the Execution Function, Writing the Behavior Callback Function.

This example is taken from the source code that is part of the SDK. See the Available Source Code chapter for details on the provided source code.

The Registration functions usually belongs to a global file, which registers both the Plugin DLL itself, and all the Building Blocks that the DLL implements. The Declaration function, the Creation function and the Execution function usually belong to a same file that usually gets the name of the Building Block, here GetDeltat.cpp. This is all convention, and you can do what you want as long as the DLL exports the right functions.

Plugin Registration

The Building Block implementation is part of a Building Block Plugin, that is a DLL with a specific protocol. Building Block Plugin, like all the other Plugins, export and implement the CKGetPluginInfo() and CKGetPluginInfoCount() functions. These functions declare the DLL as a BuildingBlock Plugin, that is a plugin that implements Building Blocks.

CKPluginInfo g_PluginInfo;

int CKGetPluginInfoCount()
{
    return 1;
}

CKPluginInfo* CKGetPluginInfo(int Index)
{
    g_PluginInfo.m_Author = "Virtools";
    g_PluginInfo.m_Description = "Logic building blocks for Virtools";
    g_PluginInfo.m_Extension = "";
    g_PluginInfo.m_Type = CKPLUGIN_BEHAVIOR_DLL;
    g_PluginInfo.m_Version = 0x000001;
    g_PluginInfo.m_InitInstanceFct = InitInstance;
    g_PluginInfo.m_ExitInstanceFct = ExitInstance;
    g_PluginInfo.m_GUID = LOGICS_BEHAVIOR;
    g_PluginInfo.m_Summary = "Logics";
    return &g_PluginInfo;
}

For general and thourough information on the meaning of the CKPluginInfo slots and the process of registering Virtools plugins, see the Creating New Plugins chapter.

Building Blocks Registration

For Building Block Plugins, Virtools calls the RegisterBehaviorDeclarations function, which should also be exported by the DLL. This is done at startup, and right after the call to CKGetPluginInfo. The RegisterBehaviorDeclarations function should declare all the Building Blocks that the Plugin implements. Here, the Logics BB Plugin implements a lot of BBs, which are all declared in the BB Regsitration function, in Logics.cpp. Of course, if your behavior needs a new parameter type or a new manager, you must register those as well. For more informations, refer to Creating a New Parameter Type and Creating a New Manager. Here, FillBehaviorGetDeltaTimeDecl is a pointer to the Declaration function of the BB described below.

void RegisterBehaviorDeclarations(XObjectDeclarationArray *reg)
{
    ...
    RegisterBehavior(reg, FillBehaviorGetDeltaTimeDecl);

    ...

}

For more informtaion on the Registration step, see the Creating New Plugins chapter.

BB Declaration function

Right after having called the RegisterBehaviorDeclarations, Virtools calls all the Declaration functions. There is one Declaration function for each BB that the Plugin implements. The declaration function must return a CKObjectDeclaration object (see Declaration of the Building Block) that describes the BB. It creates this object, fills it and finally returns it. Among other informations, this object stores a pointer to the Creation function of the BB that describes the prototype of the BB. By convention, the declaration function takes the following name : Fill + BehaviorName + Decl.

CKObjectDeclaration	*FillBehaviorGetDeltaTimeDecl()
{
  CKObjectDeclaration *od = CreateCKObjectDeclaration("Get Delta Time");
  od->SetDescription("Returns the elapsed time between the previous and the current Behavioral Process.");
  od->SetCategory("Logics/Calculator");
  od->SetType( CKDLL_BEHAVIORPROTOTYPE);
  od->SetGuid(CKGUID(0x47dc3232, 0x64bf203a));
  od->SetAuthorGuid(Virtools_GUID);
  od->SetAuthorName("Virtools");
  od->SetVersion(0x00020000);
  od->SetCreationFunction(CreateGetDeltaTimeProto);
  od->SetCompatibleClassId(CKCID_BEOBJECT);
  return od;
}

For more informtaion on the Declaration step, see the Description of the Building Block Declaration chapter.

BB Creation function

The Creation function creates and fills up a CKBehaviorPrototype object describing the details of the BB.

All the above functions (Registration and Declaration) are called when Virtools parses the Plugin file, and are used to declare the capabilities and GUIDs of the BB Plugin. The Creation function is only called when a BB is actually needed, either in the Virtools application for authoring (the BB is dropped on the Schematic Editor of Virtools), either for execution. After, the returned prototype will be used as a description model for the behaviors. It means that if you change the prototype between the creation of two behaviors, those will be different. By convention, the creation function takes the following name : Create + BehaviorName + Proto. Here is a usual description of the creation function :

  • creates a CKBehaviorPrototype object to store the informations,
  • declares the differents inputs, outputs
  • declares the input and output arameters,
  • defines the flags of the behavior,
  • stores a pointer on the execution function and possibly on a callback function,
  • stores the prototype in the pointer the system gave,
  • returns CK_OK if everything went fine and CKERR_xxx in case of error.
CKERROR CreateGetDeltaTimeProto(CKBehaviorPrototype **pproto)
{
    CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Get Delta Time");
    if(!proto) return CKERR_OUTOFMEMORY;

    proto->DeclareInput("In");
    proto->DeclareOutput("Out");

    proto->DeclareOutParameter("Delta Time", CKPGUID_FLOAT);

    proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
    proto->SetFunction(GetDeltaTime);
    proto->SetBehaviorCallbackFct( GetDeltaTimeCallBack, CKCB_BEHAVIORNOEXECUTE);

    *pproto = proto;
    return CK_OK;
}

For detailed informations about the CKBehaviorPrototype class, see the Behavior Prototype Creation chapter.

BB Execution function

The execution function is called each time the behavior is executed. In it, you define what need to be done. This function takes a CKBehaviorContext object as parameter that provides many information about the current context of Virtools like time, current RenderContext.. For more information on this structure, see the Building Block Execution chapter. It returns an int which is a value of the CK_BEHAVIOR_RETURN enum describing the success or failure of the function. The execution function usually takes the name of the BB. Here is a usual description of the execution function :

  • retrieves the BB you're attached to in order to have access to the inputs, outputs and parameters,
  • gets the target of the BB and also the settings, input, output and local parameters of the BB, but it is not useful in this example,
  • resets the state of your input because Virtools won't do it. Here, we simply deactivate the input that was activated,
  • implements your action. Here, we simply get the delta time,
  • updates the output parameters if necessary. Here, we store the delta time in the output,
  • activates the needed outputs. Here, we have only one output to activate,
  • returns a description of the success or failure of the function. See the CK_BEHAVIOR_RETURN enumeration for the possible values.
int GetDeltaTime(const CKBehaviorContext& behcontext)
{
    CKBehavior* beh = behcontext.Behavior;
    beh->ActivateInput(0,FALSE);
    float deltat = behcontext.DeltaTime;
    beh->SetOutputParameterValue(0, &deltat);
    beh->ActivateOutput(0);
    return CKBR_OK;
}

See the Writing the Execution Function chapter for details on the execution function. To have more informations on accessing the CKBehavior object to retrieve information and more especially settings, inputs, outputs and local parameters, see the Building Block Classes chapter.

BB Callback function

If you need it, you can also declare a callback function during the creation. This function is useful to perform specific actions when an event like "settings edited" occurs. Like the execution function, it takes a CKBehaviorContext object as argument. Like the creation function, it returns a CKERROR. At creation time, using flags, you define the event(s) you are interested in, therefore, in the callback function, you only need to switch between these events. For the available flags and events, see Writing the Behavior Callback Function. Here is an example of callback function that change the execution function of the behavior for a specific version.

CKERROR GetDeltaTimeCallBack(const CKBehaviorContext& behcontext)
{
    CKBehavior* beh = behcontext.Behavior;
    switch( behcontext.CallbackMessage )
    {
        case CKM_BEHAVIORLOAD:
        {
            if( beh->GetVersion()==0x00020000 ){
                beh->SetFunction(GetDeltaTime);
            } else {
                beh->SetFunction(GetDeltaTime_old);
            }
        }
    }
    return CKBR_OK;
}


Declaration of the Building Block

The Declaration of a Building Block is one of the phases of the Registration of the Building Block Plugin. For an overview of these phases, see the Main Steps of Building Block Creation chapter.

As its name infers, the Declaration phase describe each Building Block, on a functional level : what it can be applied to, its GUID, its creation function, etc.. It does not actually declare the Building Block instance, as instance are created and managed by Virtools when needed, but it declares the model on which the instance will be created : the Behavior Prototype (class CKBehaviorPrototype). This is done my creating a CKObjectDeclaration instance, filling it up with information and returning it.

Virtools manages all the object declarations by GUID. These declarations may later be accessed using the global Virtools functions CKGetObjectDeclarationFromGuid, CKGetPrototypeDeclarationCount, CKGetPrototypeDeclaration.

By convention, this Declaration function, declared in the Plugin registration phase, is named Fill + <BBName> + Decl, for example FillBehaviorGetDeltaTimeDecl.

CKObjectDeclaration Class

A CKObjectDeclaration is used by the Virtools engine to store a list of available extensions objects. Only declarations of CKBehaviorPrototype are supported in this version of Virtools. It contains a short description about the behavior prototype, its author and it also contains a pointer to the function that will be used to create the behavior prototype when needed.

To create such an object, you must use the CreateCKObjectDeclaration function and give the name of your object. For a behavior, this string will appear as its name in the Virtools application, both in the "Building Blocks" page and in the Schematic Editor page of the interface. This name is mandatory, and does not have to be unique, though it is recommended for readability...

CKObjectDeclaration* CreateCKObjectDeclaration(CKSTRING Name);

Description

It is the string that will appear in the "Description" column of the "Building Blocks" page of the Virtools application. It is a short description of the BB. It must therefore be explicit and short. This field is optional, but recommended.

void SetDescription(CKSTRING Description);
CKSTRING GetDescription();

Guid

Every behavior must have a GUID in Virtools to uniquely identify it. This filled must be filled. New GUID can be created using CKGUIDGen.exe in the SDK\Utils directory or using the CKContext::GetSecureGUID method.

void SetGuid(CKGUID guid);
CKGUID GetGuid();

Type

This version of Virtools only support the declaration of BB prototypes, so the type is always CKDLL_BEHAVIORPROTOTYPE. This field must be filled up.

void SetType(int type);
int GetType();

Manager

If a specific manager needs to be loaded to have the behavior working properly, you must specify this manager's GUID here.

void NeedManager(CKGUID Manager);

Creation function

In this field, you must give a pointer to the function that will be used to create the behavior. This function will then be called only once, either when the behavior is loaded or dropped for the first time on the "Schematic" page. The creation function must be of type CKDLL_CREATEPROTOFUNCTION described here.

void SetCreationFunction(CKDLL_CREATEPROTOFUNCTION f);
CKDLL_CREATEPROTOFUNCTION GetCreationFunction();
typedef CKERROR (*CKDLL_CREATEPROTOFUNCTION) (CKBehaviorPrototype **);

Author

To define the author of the behavior, you can specify its name and its GUID. Usually, every company defines its own GUID that must be unique. Names are then independent from this GUID and two different names can share the same GUID. The name is displayed on the "Author" column of the "Building Blocks" page of the interface. These fields are optional, but recommended.

void SetAuthorGuid(CKGUID guid);
CKGUID GetAuthorGuid();

void SetAuthorName(CKSTRING Name);
CKSTRING GetAuthorName();

Version

This is the hexadecimal version number of your building block. It appears on the "Version" column of the "Building Blocks" Editor of the Virtools user interface. The version number can be very useful to keep an history of the behavior, but also to specify different creation functions depending on the version of the behavior. This field is optionnal, but recommended.

void SetVersion(CKDWORD verion);
CKDWORD GetVersion();

Class ID

This ID specifies the highest type of object that is compatible with the BB. The BB can be dropped on an instance of any class deriving from the class corresponding to this classID.

This type is necessarily a native CK class identifier of type CK_CLASSID belonging to the following values (child of CKBeObject).

void SetCompatibleClassId(CK_CLASSID id);
CK_CLASSID GetCompatibleClassId();
See also Class Identifiers.
CKCID_SCENE
CKCID_SCENEOBJECT
CKCID_BEOBJECT
CKCID_LEVEL
CKCID_PLACE
CKCID_GROUP
CKCID_SOUND
CKCID_WAVESOUND
CKCID_MIDISOUND
CKCID_2DENTITY
CKCID_SPRITE
CKCID_SPRITETEXT
CKCID_MATERIAL
CKCID_TEXTURE
CKCID_MESH

CKCID_3DENTITY
CKCID_CAMERA
CKCID_TARGETCAMERA
CKCID_CURVEPOINT
CKCID_SPRITE3D
CKCID_LIGHT
CKCID_TARGETLIGHT
CKCID_CHARACTER
CKCID_3DOBJECT
CKCID_BODYPART
CKCID_CURVE
CKCID_RENDEROBJECT
CKCID_GRID
CKCID_DATAARRAY
CKCID_PATCHMESH

Category

This string gives the behavior's path on the tree of the "Building Blocks" Editor in Virtools application. This path is limited to a directory and a subdirectory only (use "/" - slash - as directory separator). If this path do not exists, Virtools creates the corresponding hierarchy. It is highly recommended that you create your own behavior directory to clearly separate the native behaviors and your own. If you don't specify this value, Virtools will create a "No Category" directory for your behavior.

void SetCategory(CKSTRING cat);
CKSTRING GetCategory();

Behavior prototype

These function give access to the Prototype associated with the declaration.

The Plugin DLL should never use the SetProto function, as the prototype is attached to the declaration by Virtools, when needed.

CKBehaviorPrototype* GetProto();
void SetProto(CKBehaviorPrototype* proto);

Other

Two other functions are available in this class. They give access to the name of the object you've specified at creation time and the index of the plugin inside which the behavior is declared.

CKSTRING GetName();
int GetPluginIndex();

Example

CKObjectDeclaration *od = CreateCKObjectDeclaration("Limited Camera Orbit");

od->SetDescription("Makes a Limited Camera Orbit round a 3D Entity.");
od->SetCategory("Cameras/Movement");
od->SetType(CKDLL_BEHAVIORPROTOTYPE);
od->SetGuid(CKGUID(0x7610f4d,0x69747b9d));
od->SetAuthorGuid(Virtools_GUID);
od->SetAuthorName("Virtools");
od->SetVersion(0x00010000);
od->SetCreationFunction(CreateLimitedOrbitProto);
od->SetCompatibleClassId(CKCID_CAMERA);
od->NeedManager(INPUT_MANAGER_GUID);


Behavior Prototype Creation

The Creation of the Behavior Prototype is one of the phases of the creation of a Building Block. For a general view of these phases, see the Main Steps of Building Block Creation chapter.

Building Blocks are not implemented directly by the Plugins DLL. Instead, the DLL provides information on how to create and execute the Building Blocks (instances of CKBehavior), and Virtools actually creates and manages the instances. This BB description is done using Behavior Prototypes (class CKBehaviorPrototype).

The Prototype is created at two moments in the life of the behavior:

  • Once the first time that the Building Block name is dragged and dropped from the Building Block Editor in Virtools to the Schematic Editor. At this moment, Virtools needs the exact description of what to draw (inputs, outputs, etc..). From the GUID it knows the creation function, which it calls. The creation function should create a CKBehaviorPrototype and fill it up with information about the BB, which Virtools will use to draw the BB and potentially create Parameters for it.
  • When a Virtools composition is loaded, for each BB included in the composition, Virtools calls the Prototype Creation function, in order first to check that the Prototype has not changed (structural check), and second to get access to the BB's execution function.

BB Version Checking

When a BB is loaded from a Virtools composition and the corresponding prototype is created (using the Bb's GUID), they are compared. The prototype version is not used for the comparison. Instead, the comparison is done on the structure of the BB and the prototype : name, number and order of the inputs, outputs, pIns, pOuts, Local Parameters, etc.. If Virtools detects a mismatch, and is in authoring mode, it give the user the possibility to let Virtools use the new prototype to create a new behavior and reattach everything. This can fail, or function poorly, if Virtools does not have enough information to match the old and new structure. In this case, the programmer should manually recreate the connections in Virtools.

In case of mismatch, and if the replacement by a new behavior version is not done, either because the user did not ask for it, or because Virtools is in player mode, the old behavior is used, but the new execution and callback functions are called. These functions may detect the version number of the prototype of the behavior to toggle different execution scheme. A simple way to do this is to check the version in the callback function at load time, and change the execution function's pointer at this moment. If this detection is not done, the new execution function may just fail, crash or give unexpected results.

Here is an example of version checking in the callback function :

CKERROR GetDeltaTimeCallBack(const CKBehaviorContext& behcontext)
{
    CKBehavior* beh = behcontext.Behavior;

    switch( behcontext.CallbackMessage )
    {
        case CKM_BEHAVIORLOAD:
        {
            if( beh->GetVersion()==0x00020000 ){
                beh->SetFunction(GetDeltaTime);
              } else {
                beh->SetFunction(GetDeltaTime_old);
              }
        }
    }

    return CKBR_OK;
}

The CKBehaviorPrototype Class

Behavior prototypes describe the Bb's internal structure and relationships with other objects. It is created by using the CreateCKBehaviorPrototype function and specifying the name of the prototype. This name is not used by Virtools, it is provided as a conveniency for displaying and debugging purposes, it can be retrieved by using the GetName() function.

CKBehaviorPrototype* CreateCKBehaviorPrototype(CKSTRING Name);
CKSTRING GetName();

Guid

The SetGuid function should not be called from within a Plugin DLL, but only by Virtools. The GUID of the prototype is set by the Virtools using the GUID declared in the Declaration function. See the Declaration of the Building Block chapter for details. Only prototype with a GUID may be exported to a standalone file.

void SetGuid(CKGUID guid);
CKGUID GetGuid()

Class ID

The SetApplyToClassID function should not be called inside the Plugin DLL. The ClassID of the prototype is set by the Virtools using the ClassID declared in the Declaration function. See the Declaration of the Building Block chapter for details.

void SetApplyToClassID(CK_CLASSID cid);
CK_CLASSID GetApplyToClassID();

Behavior Type

Mostly used for internal purposes to distinguish simple behaviors, scripts and graphs. You usually don't specify this field, the default value will be set for you.

void SetBehaviorType(CK_BEHAVIOR_TYPE flags);
CK_BEHAVIOR_TYPE GetBehaviorType();

Input and Output

You can define as many input and output as you want. You declare them in the prototype by using the DeclareInput() and DeclareOutput() function with their respective names. This name is the one that appears on Virtools's application information bar when the mouse pointer is located on the input or output. When you declare an input (output), Virtools creates a CKBehaviorIO object with an index corresponding to its creation order among inputs (outputs). Afterward, you'll can retrieve any IO through its index number and the CKBehavior::GetInput() and CKBehavior::GetOutput() functions. The use of input and output is described in the Building Block Classes chapter.

int DeclareInput(CKSTRING name);
int DeclareOutput(CKSTRING name);

You can also retrieve information about the inputs and outputs of a prototype at any time by using the following functions. They allow you to retrieve the number of input, the number of outputs, a list of the inputs and a list of the outputs. And you can also find the index of an input or an output by using its name.

int GetInputCount();
int GetOutputCount();
CKBEHAVIORIO_DESC** GetInIOList();
CKBEHAVIORIO_DESC** GetOutIOList();
int GetInIOIndex(CKSTRING name);
int GetOutIOIndex(CKSTRING name);

Parameter Inputs and Outputs

As for inputs and outputs, you can add as many Parameter Inputs and Outputs as you want. To do this, you must call the DeclareInParameter() and DeclareOutParameter() functions with the following attributes : its name, the GUID of its type and its default value that can be provided in two different ways. Either the parameter type knows how to read itself from a string, then the default value can be provided as a string, which will be converted to provide the default value when needed. Either the parameters type cannot initialize itself from a string, and the default value must be provided directly, with a pointer to data, and the length of the data in bytes. When you add an input (output) parameter, Virtools creates a CKParameterIn (CKParameterOut) objects with an index corresponding to the creation order among input (output) parameters. You can then retrieve any Parameter by using the CKBehavior::GetInputParameter() and CKBehavior::GetOutputParameter() functions. The use of Parameters is be described in the Building Block Classes chapter.

int DeclareInParameter(CKSTRING name,CKGUID guid_type,CKSTRING defaultval=NULL);
int DeclareInParameter(CKSTRING name,CKGUID guid_type,void *defaultval,int valsize);
int DeclareOutParameter(CKSTRING name,CKGUID guid_type,CKSTRING defaultval=NULL);
int DeclareOutParameter(CKSTRING name,CKGUID guid_type,void *defaultval,int valsize);

As for the input and outputs, here again some functions are available to get information about the in and out parameters.

int GetInParameterCount();
int GetOutParameterCount();
CKPARAMETER_DESC** GetInParameterList();
CKPARAMETER_DESC** GetOutParameterList();
int GetInParamIndex(CKSTRING name);
int GetOutParamIndex(CKSTRING name);

Local parameters and settings

Local parameters are the memory of a behavior. They can be set or retrieved each time the behavior is called. Once the behavior is over, they are kept in memory and can be set or retrieved when the behavior starts again. To create them, follow the same procedure than parameter Inputs or Outputs with the DeclareLocalParameter() function.

Settings are a special type of local parameters, which the user can edit and modify in the Virtools user interface in authoring mode. Therefore, their creation mechanism is similar with the DeclareSetting() function. So settings are somewhere Parameter Inputs and Local Parameters. The only difference is that Parameter Inputs should be tested at each call of the Execution function, as they can change all the time, while Settings can only be changed by the user, in which case Virtools calls the BehaviorCallback function with the CKM_BEHAVIORSETTINGSEDITED flag.

When you declare a local parameter or a setting parameter, Virtools creates a CKParameterLocal object that you can retrieve by using the CKBehavior::GetLocalParameter() function. The use of local parameters and settings will be described in the Building Block Classes paragraph.

int DeclareLocalParameter(CKSTRING name,CKGUID guid_type,CKSTRING defaultval=NULL);
int DeclareLocalParameter(CKSTRING name,CKGUID guid_type,void *defaultval,int valsize);
int DeclareSetting(CKSTRING name,CKGUID guid_type,CKSTRING defaultval=NULL);
int DeclareSetting(CKSTRING name,CKGUID guid_type,void *defaultval,int valsize);

As for the input and outputs, here again some functions are available to get informations about the local parameters. As settings are a special type of local parameters, it is not possible to distinguish them. The only difference comes from their index or names.

int GetLocalParameterCount();
CKPARAMETER_DESC** GetLocalParameterList();
int GetLocalParamIndex(CKSTRING name);

Flags

Flags describing the prototype as normal, obsolete or hidden. In the Schematic Editor of the Virtools user interface, an obsolete behavior will appear in green, the others in gray. And in the Building Blocks Editor, both the hidden and obsolete behaviors will not appear as it is not recommended to use obsolete behaviors and not allowed to use the hidden ones.

void SetFlags(CK_BEHAVIORPROTOTYPE_FLAGS flags);
CK_BEHAVIORPROTOTYPE_FLAGS GetFlags();

enum CK_BEHAVIORPROTOTYPE_FLAGS {
    CK_BEHAVIORPROTOTYPE_NORMAL,
    CK_BEHAVIORPROTOTYPE_HIDDEN,
    CK_BEHAVIORPROTOTYPE_OBSOLETE,
};

Behavior Flags

The Behavior Flags will be applied to the behavior when it is created from the prototype. Some flags are reserved for internal use. You should always use flags among the following documented ones.

void SetBehaviorFlags(CK_BEHAVIOR_FLAGS flags);
CK_BEHAVIOR_FLAGS GetBehaviorFlags();

CKBEHAVIOR_ACTIVE
// Is active
CKBEHAVIOR_CUSTOMSETTINGSEDITDIALOG
// Has a custom Dialog Box for settings edition
CKBEHAVIOR_WAITSFORMESSAGE
// Is waiting for a message to activate one of its outputs
CKBEHAVIOR_VARIABLEINPUTS
// May have its inputs changed by editing them
CKBEHAVIOR_VARIABLEOUTPUTS
// May have its outputs changed by editing them
CKBEHAVIOR_VARIABLEPARAMETERINPUTS
// May have its number of input parameters changed by editing them
CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS
// May have its number of output parameters changed by editing them
CKBEHAVIOR_MESSAGESENDER
// May send messages during its execution.
CKBEHAVIOR_MESSAGERECEIVER
// May check messages during its execution.
CKBEHAVIOR_TARGETABLE
// May be owned by another object than the script owner.
CKBEHAVIOR_CUSTOMEDITDIALOG
// Has a custom Dialog Box for parameters edition .
CKBEHAVIOR_INTERNALLYCREATEDINPUTS
// Execution may create/delete inputs
CKBEHAVIOR_INTERNALLYCREATEDOUTPUTS
// Execution may create/delete outputs
CKBEHAVIOR_INTERNALLYCREATEDINPUTPARAMS
// Execution may create/delete input parameters or change their type
CKBEHAVIOR_INTERNALLYCREATEDOUTPUTPARAMS
// Execution may create/delete output parameters or change their type

For example, setting the CKBEHAVIOR_ACTIVE flag ensures that the behavior is active when the scene starts, even if it is not a Script.

The CKBEHAVIOR_VARIABLEINPUTS and CKBEHAVIOR_VARIABLEOUTPUTS, allow the user to change the number of inputs or outputs of the BB in authoring mode. Many standard BBs use this functionality.

The CKBEHAVIOR_VARIABLEPARAMETERINPUTS and CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS, allow the user to change the number of Parameter Inputs or Outputs of the BB in authoring mode. Many standard BBs use this functionality.

CKBEHAVIOR_INTERNALLYCREATEDINPUTS (et al.) specify that the behavior may dynamically create new inputs (et al.). This flag is used by Virtools when comparing a Behavior and its prototype at startup. If the CKBEHAVIOR_INTERNALLYCREATEDINPUTS flag (et al.) is set, Virtools will never try to correct any mismatch, because it will suppose that the mismatch is normal.

The CKBEHAVIOR_CUSTOMSETTINGSEDITDIALOG and CKBEHAVIOR_CUSTOMEDITDIALOG mean that the programmer provides its own dialog box for the BB or for the settings. See the Creating a Custom Building Block Dialog Box chapter for details.

Execution Function

It is the function that will be called once per BB using it during each process loop of the behavior engine. This function is the heart of the behavior: it should compute the essence of the behavior, in an incremental way. The minimum amount of computing should be done at each call, to leave time for the other behaviors to run. The function receives a CKBehaviorContext object that provides useful information about the system. The execution function can retrieve values from the owner of the behavior, and from parameters. It can activate and deactivate inputs and outputs of the behavior. This function must return one of the CK_BEHAVIOR_RETURN value depending on its results. See the Writing the Execution Function chapter for details on the execution function and the Building Block Classes chapter for more on the CKBehaviorContext content.

void SetFunction(CKBEHAVIORFCT fct);
CKBEHAVIORFCT GetFunction();

typedef int	(*CKBEHAVIORFCT) (const CKBehaviorContext& context);

enum CK_BEHAVIOR_RETURN
{
    CKBR_OK,					// Everything's ok. Behavior is deactivated unless one of its inputs is active.
    CKBR_ACTIVATENEXTFRAME,		// The behavior will be reactivated next frame
    CKBR_ATTACHFAILED,			// The attach failed
    CKBR_GENERICERROR,			// Something went wrong
    CKBR_BEHAVIORERROR,			// The behavior gave to the code was wrong
    CKBR_OWNERERROR,			// The owner isn't what it should be
    CKBR_PARAMETERERROR,		// Some of the parameters are wrong
    CKBR_GENERICERROR_RETRY,
    CKBR_BEHAVIORERROR_RETRY,
    CKBR_OWNERERROR_RETRY,
    CKBR_PARAMETERERROR_RETRY,

};

BehaviorCallback Function

To handle specific messages, you can define a callback function and attach it to the BB, using the SetBehaviorCallbackFct function. This function must receive a mask defined as an OR-ing of CK_BEHAVIOR_CALLBACKMASK flags, indicating when it should be called. The BehaviorCallback function can be called at all stages of the lifetime of the behavior. It can be used to perform various maintenance operations concerning the behavior.

Event Name | Event Mask | Event Description
CKM_BEHAVIORATTACH | CKCB_BEHAVIORATTACH | when the behavior is attached to an object
CKM_BEHAVIORDETACH | CKCB_BEHAVIORDETACH | when the behavior is detached from an object
CKM_BEHAVIORDELETE | CKCB_BEHAVIORDELETE | when the behavior is deleted ( DETACH CALLBACK is not called )
CKM_BEHAVIORPRESAVE | CKCB_BEHAVIORPRESAVE | at start of a save operation
CKM_BEHAVIORPOSTSAVE | CKCB_BEHAVIORPOSTSAVE | at end of a save operation
CKM_BEHAVIORRESET | CKCB_BEHAVIORRESET | when user reset in Virtools interface or when CKContext::Reset() function is called ( i.e behaviors execution stop)
CKM_BEHAVIORPAUSE | CKCB_BEHAVIORPAUSE | when behaviors execution is paused (e.g. CKContext::Pause())
CKM_BEHAVIORRESUME | CKCB_BEHAVIORRESUME | when behaviors execution start (e.g. CKContext::Play())
CKM_BEHAVIORLOAD | CKCB_BEHAVIORLOAD | when behavior is loaded ( ATTACH CALLBACK is not called )
CKM_BEHAVIOREDITED | CKCB_BEHAVIOREDITED | when behavior is edited in Virtools interface. This callback message may be used to provide a custom dialog box for editing the behavior.
CKM_BEHAVIORSETTINGSEDITED | CKCB_BEHAVIORSETTINGSEDITED | when behavior settings are edited in Virtools interface
CKM_BEHAVIORNEWSCENE | CKCB_BEHAVIORNEWSCENE | when a new scene becomes the active scene
CKM_BEHAVIORACTIVATESCRIPT | CKCB_BEHAVIORACTIVATESCRIPT | when a script has been activated in the interface. This callback message is sent to all sub-behaviors of the script if it has been activated in the current scene.
CKM_BEHAVIORDEACTIVATESCRIPT | CKCB_BEHAVIORDEACTIVATESCRIPT | when a script has been deactivated in the interface. This callback message is sent to all sub-behaviors of the script if it has been deactivated in the current scene.
attach /detach /delete | CKCB_BEHAVIORBASE | Composite mask
play/pause/reset | CKCB_BEHAVIORSAVELOAD | Composite mask
 | CKCB_BEHAVIORPPR | Composite mask
editions of settings or parameters | CKCB_BEHAVIOREDITIONS | Composite mask
All flags | CKCB_BEHAVIORALL | Composite mask

The callback functions receives as argument a CKBehaviorContext, containing various information about the state of the system at that moment.

See the Writing the Behavior Callback Function chapter for details on the BehaviorCallback function and the Building Block Classes chapter for more on the CKBehaviorContext content.

void SetBehaviorCallbackFct(CKBEHAVIORCALLBACKFCT fct,CKDWORD CallbackMask=CKCB_BEHAVIORNOEXECUTE,void *param=NULL);
CKBEHAVIORCALLBACKFCT GetBehaviorCallbackFct();

typedef CKERROR (*CKBEHAVIORCALLBACKFCT) (const CKBehaviorContext& context);

Other possible callbacks

Other callbacks may be added by the BB, but not to the BB. These callbacks are typically added to the owner or the target of the BB, but could be added to any object. These additional callbacks are typically added inside the callback function of the BB, so that they can be later removed (for example, they would be added when the Level starts playing, and removed when the Level is Paused or Resetted).

These additional callbacks deal with rendering, attribute changing, user actions and parameters spying. See the Custom Rendering chapter for information on rendering callbacks. See the Using Attributes chapter for information on attributes callbacks. See the Creating New Parameter Types for details on Parameter callbacks.

// CK2d Entity rendering callbacks
CK2dEntity::AddPreRenderCallBack
CK2dEntity::AddPostRenderCallBack

// CK3dEntity rendering callbacks
CK3dEntity::AddPreRenderCallBack
CK3dEntity::SetRenderCallBack
CK3dEntity::AddPostRenderCallBack

// CKMesh rendering callback
CKMesh::AddPreRenderCallBack
CKMesh::SetRenderCallBack
CKMesh::AddPostRenderCallBack

// CKRenderContext rendering and sorting functions
CKRenderContext::AddPreRenderCallBack
CKRenderContext::AddPostRenderCallBack
CKRenderContext::AddPostSpriteRenderCallBack
CKRenderContext::AddSortFunction

// CKAttributeManager callback on creation and deletion of attribute.
CKAttributeManager::SetAttributeCallbackFunction

// Same callback function than here, but directly set to the behavior object.
CKBehavior::SetCallbackFunction

// CKContext callback. Called when the user loads a file in Virtools's interface.
CKContext::SetUserLoadCallback

// CK_PARAMETER_TYPE callback functions
CK_PARAMETERCREATEDEFAULTFUNCTION   CreateDefaultFunction;
CK_PARAMETERDELETEFUNCTION          DeleteFunction;
CK_PARAMETERSAVELOADFUNCTION        SaveLoadFunction;
CK_PARAMETERCHECKFUNCTION           CheckFunction;
CK_PARAMETERSTRINGFUNCTION          StringFunction;
CK_PARAMETERUICREATORFUNCTION       UICreatorFunction;


Writing the Execution Function

When Virtools plays a Level, the execution function is called for each BB that it is attached to, and at every frame, when the BB it active.

The execution function is supposed to implement the core actions of the BB : act on the target or owner, according to the Parameter Inputs and to the Inputs, setting the values of Parameters Outputs and activating Outputs.

It takes one argument: a CKBehaviorContext structure giving access, among other things, to the behavior that is concerned by this call.

This chapter lists some important or typical actions that the execution function can perform, and its effect on the system or on the future. Some of these issues are addressed elsewhere but here is a summary.

Core Processing

The execution function should do what the user expects it to do. Beware of undocumented or non-obvious side effects.

The execution function is potentially called at every frame. Do not implement in the execution function anything that should only be done at initialization for example. Use the BehaviorCallback function for this. (See Writing the Behavior Callback Function).

The execution function may be called many times in every frame, if it is attached to many behaviors, themselves attached to different objects. Tailor your processing on the CKBehavior instance that is passed in as the argument, and access all your Virtools world through this instance, especially the Inputs, Outputs, Owner, Parameter Inputs, Parameter Outputs :

CK_BEHAVIOR_RETURN MyExecutionFunction(const CKBehaviorContext & behcontext)
{
     CKBehavior* beh = behcontext.Behavior;
    // ...

Iterative execution (time-splitting)

Virtools is a real-time engine : it distributes its CPU to all its behaviors, and expects them to behave gracefully. Do not implement any time consuming operation in your execution function.

If your processing takes time, or should take some time to finish, implement it iteratively, so that many calls to the execution function end up achieving the processing, with a little bit being processed at each call.

One badly written execution function can slow down the whole system !

Return value

The return value of the execution function is interpreted by Virtools. It should be one of the CK_BEHAVIOR_RETURN value. Here are their meaning

typedef enum CK_BEHAVIOR_RETURN {
    CKBR_OK = 0,
    CKBR_ACTIVATENEXTFRAME = 1,
    CKBR_ATTACHFAILED = 2,
    CKBR_DETACHFAILED = 4,
    CKBR_INFINITELOOP = 8,
    CKBR_GENERICERROR = 0xA000,
    CKBR_BEHAVIORERROR = 0xA002,
    CKBR_OWNERERROR = 0xA004,
    CKBR_PARAMETERERROR = 0xA008,
    CKBR_GENERICERROR_RETRY = 0xA001,
    CKBR_BEHAVIORERROR_RETRY = 0xA003,
    CKBR_OWNERERROR_RETRY = 0xA005,
    CKBR_PARAMETERERROR_RETRY =0xA009
} CK_BEHAVIOR_RETURN;

CKBR_OK : Everything's ok. The BB is deactivated unless one of its inputs is active.

CKBR_ACTIVATENEXTFRAME : Forces the BB to be reactivated at the next frame. This is the same as leaving active the BB's Input that activated it, which is the preferred way. Can be useful for BBs that are supposed to never stop working until some other input (like the "off" input) is activated.

CKBR_ATTACHFAILED : Should not be used in the execution function, but only in the BehaviorCallback function. If one condition to attach the behavior to an object is not valid the function can returns this error.

CKBR_DETACHFAILED : Should not be used in the execution function, but only in the BehaviorCallback function. If one condition to detach the behavior from an object is not valid the function can returns this error.

CKBR_INFINITELOOP : Returned by the engine when reaching the maximum number of calls to a single BB in a given frame (default:8000).

CKBR_GENERICERROR : Means that an error occurred. In authoring mode, Virtools displays an error in the console. In player mode, this has no effect. In all cases, if an output was activated the activation flow continues. And if the activation flow comes back to activate one of the inputs, the BB's execution function is called again.

CKBR_BEHAVIORERROR: Should be returned when the behavior being executed looks to be configured incorrectly

CKBR_OWNERERROR : Means that the owner is not there (this should not happen), or, more frequent, that the target is not set (if the BB is targettable). In authoring mode, Virtools displays an error in the console. In additino, for this very specific error, Virtools applies some heuristics in order not to break the activation flow. For example, if the BB has one output, Virtools activates it if it is not, in order not to block the Script.

CKBR_PARAMETERERROR : Means that some Parameter Inputs are not set. Has the same effect than CKBR_GENERICERROR.

CKBR_GENERICERROR_RETRY, CKBR_BEHAVIORERROR_RETRY, CKBR_OWNERERROR_RETRY, CKBR_PARAMETERERROR_RETRY : Has se same effect than the no retry version of these errors, but also force the activation of the BB at the next frame, like CKBR_ACTIVATENEXTFRAME.

Inputs and output activation

If the execution function is called, it means that at least one of the BB's inputs is activated. Also when the execution function is called all the outputs are deactivated (even if they where active at the previous frame, or even in the same frame). If the BB does nothing with its inputs and outputs, everything is left as is by Virtools which means that :

  • the same input will still be active at the next frame, and that the execution function will be called again,
  • no output will be activated, meaning that the activation flow is stopped in the BB

Activating and deactivating inputs and output is how an execution function controls the activation flow. See the Behaviors and Objects Activation chapter for an overview of behavior's activation flow.

There are two main modes of being for behaviors, which are named "internally looped" and "externally looped". Most BBs are externally looped, which means that they do their action once and only once. If the user wants them to do their action many times, they externally create a behavior link from the output of the BB to one of its inputs (potentially passing through other BBs in between). Internally looped behaviors usually have two inputs : "on" and "off". When the "on" input is activated, even once, the BB remains active until the "off" input is activated (even once).

Externally looped BBs typically deactivate all their inputs in their execution function, so that the only way for the BB to be called again is by external looping.

Internally looped BBs, typically do not deactivate their inputs, except if they were called with the "off" input active, in which case they deactivate all the inputs, so that they will not be active at the next frame.

Activation and deactivation of inputs is done using the ActivateInput function of CKBehavior :

beh->ActivateInput(pos, TRUE);	// activation
beh->ActivateInput(pos, FALSE);	// deactivation

On the Output side, the execution function typically just activates the output that reflects the success, failure or choice of the BB.

All other systems are possible, and everything depends on what your behavior semantics is, on what you have documented, and on what seems intuitive to the user of the BB.

See the Building Block Classes chapter for detailed descriptions of the Inputs and Outputs access.

Owner or target modification

The BB is attached to an object, on which the BB is supposed to act. This BB is either the owner of the BB, or if the BB is targettable, the target of the BB. The owner is never undefined if the BB was created using the Virtools application, but the target could well be undefined (NULL) if it has not been linked to anything in the Schematic Editor of Virtools.

// Targettable case
CKBeObject *owner = beh->GetTarget();
if (owner == NULL) return CKBR_OWNERERROR;

// Owner case
CKBeObject *owner = beh->GetOwner();
if (owner == NULL) return CKBR_OWNERERROR;

Getting access to Parameter Inputs (pIns)

The Parameter Inputs (pIns) of the BB contain the values that you typically use as input values for your processing.

You access these values by using the CKBehavior's access functions, using the position of the Parameter Input in the array of Parameter Inputs.

// Getting an simple type : int
int myInt = 1; // default value
beh->GetInputParameterValue(inPos,&myInt);

This retrieves the value of the pIn (by getting to its source, etc..) automatically. If the pIn is not connected, and the function fails, your myInt value still has the default value. You can of course also do some error processing if GetInputParameterValue fails.

// Getting a complex Virtools object
CKObject*	myObj = beh->GetInputParameterObject(inPos);
if (myObj != NULL) { // ...

// Getting access to raw data, for strings for example
char *myString = (char *)(beh->GetInputParameterReadDataPtr(inPos));

// Beware of not changing this string.

See the Building Block Classes chapter for detailed descriptions of the Parameter Inputs.

Parameter Outputs change (pOuts)

If the execution function does not touch the Parameter Outputs, they are just left as they were before the call. The pOuts are supposed to contain values representing the result of the BB's computation.

There are many ways to set the value of an output parameter. Here are the typical ways, all using the position of the Parameter Output in the array of Parameter Outputs.

All automatically propagate the change, except the GetOutputParameterWriteDataPtr, of course, so you should force the propagation.

// Setting a simple type
int myInt = 5;
beh->SetOutputParameterValue(outPos,&myInt);

// Setting a complex type
char myString[1024];
beh->SetOutputParameterValue(outPos,myString, 1024);

// Setting a Virtools object
CKObject*	myObj = ... ;
beh->SetOutputParameterObject(outPos,myObj);

// Setting as raw data
char *myWriteString = (char *)(beh->GetOutputParameterWriteDataPtr(outPos));
strcpy(myWriteString, myString);

// Force the propagation of the change
beh->GetOutputParameter(outPos)->DataChanged();

See the Building Block Classes chapter for detailed descriptions of the Parameter Outputs.

Local Parameter access

Local Parameters are used to store data accross calls of the execution function. They are the memory of the Building Block. They store their value in between calls, and even if the BB is inactive. See the Behavior Prototype Creation chapter on how to declare Local Parameters.

Local Parameters are accessed in a similar manner as the Parameter Inputs and Outputs, using the position of the Local Parameter in the array of Local Parameters.

// Getting and setting an simple type : int
int myInt = 1; // default value
beh->GetLocalParameterValue(localPos,&myInt);
beh->SetLocalParameterValue(localPos,&myInt);

// Getting and setting a complex Virtools object
CKObject*	myObj = beh->GetLocalParameterObject(localPos);
if (myObj != NULL) {
    beh->SetLocalParameterObject(localPos,myObj);
    // ...

// Getting and setting raw data, for strings for example
char *myString = (char *)(beh->GetLocalParameterReadDataPtr(localPos));
char *myWriteString = (char *)(beh->GetLocalParameterWriteDataPtr(localPos));
strcpy(myWriteString, myString);

Settings access

Settings are Local Parameters (CKLocalParameter class) and stored inside the BB in the same array as Local Parameters. They are accessed the same way as LocalParameters (see above). See the Behavior Prototype Creation chapter on how to declare Local Parameters. The only difference is that Settings can be changed by the user in authoring mode, while the Local Parameters can only be changed by the BB itself.

When a Setting has been changed by the user, the Behavior Callback function is called with the corresponding event. See the Writing the Behavior Callback Function chapter for details on how to handle this event.

Sharing data between BBs

Note that it is highly not advised to use static variables either in the execution function or in the callback function, in order to store common data. The reason is threading : The Virtools engine is multithreaded, and multithreading is very likely to be used, for example if Virtools content is played in multiple browser windows, Virtools allocates one thread per window. So your execution and callback functions can be called by different threads. Static variables are thus highly not recommended, first because this data will be shared among all the BB instances, even if in different threads (different CKContext instances) which is usually not what you expect, and also because you may have two threads accessing or modifying the data at the same time, thus leading to unexpected results.

If you want to share data between all the instances of one BuildingBlock in one Virtools composition, you have many other solutions:

  • attach the data to an attribute of some global object, like the Level
  • create a Manager Plugin related to this Building Block
  • have the first BB create a Local Parameter, and have all the subsequent BBs find this BB (using the CKContext objects retrieval functions) and use the same Local Parameter value.


Writing the Behavior Callback Function

The Behavior Callback function is called by Virtools when various events happen in the life of a BuildingBlock. Exactely which events trigger a call to the Behavior Callback function is defined in the Behavior Prototype, along with the declaration of the function pointer (See the Behavior Prototype Creation chapter for details).

In this chapter we explain and gives details on the various events, and their typical use, as well as the potential return values of the function.

Typically, the Behavior Callback is used to do some housekeeping of the BB, things that you would not want to do in the very fast and optimized execution function. The Behavior Callback more or less manipulates the same paradigms that the execution function, but less often. For example, tne thing that the Behavior Callback manipulates a lot are Local Parameters, which are the local memory of the BB. See the Writing the Execution Function for more details on common operations.

A very common usage of the callback function is to prepare some local structures or processes in order to optimize the speed of the execution function, or to connect to some outside process or system, so that everything is ready when the execution function is called. In this case you typically react to the CKM_BEHAVIORRESET, CKM_BEHAVIORPAUSE, CKM_BEHAVIORRESUME, CKM_BEHAVIORNEWSCENE, CKM_BEHAVIORACTIVATESCRIPT or CKM_BEHAVIORDEACTIVATESCRIPT events.

Another very common usage is to set up local structures according to the environment in authoring mode, when the owner, the settings, etc may change (but may not change in play mode). In this case, you typically use the CKM_BEHAVIORLOAD, CKM_BEHAVIORCREATE, CKM_BEHAVIORATTACH, CKM_BEHAVIORDETACH , CKM_BEHAVIORDELETE, CKM_BEHAVIORSETTINGSEDITED, CKM_BEHAVIOREDITED events.

CKBehaviorContext

The Behavior Callback function takes one argument, which is a CKBehaviorContext structure, which the function can use to get various information about the general context in which it is called, including the CKBehavior that it is concerned, and the CallbackMessage, which is the event that is the cause of the callback.See the Building Block Classes for details on these classes and structures.

Basically, the Behavior Callback funcion is a big switch on the CKBehaviorContext's CallbackMessage :

CKERROR MyBBCallback (const CKBehaviorContext & behcontext) {
    CKBehavior* beh = behcontext.Behavior;
    switch (behcontext.CallbackMessage) {
        case CKM_BEHAVIORLOAD:
        case CKM_BEHAVIORCREATE:
        ...
    }
    return CKBR_OK;
}

Return Values

The return value of the callback function should be one of the CK_BEHAVIOR_RETURN values.

The Behavior Callback function typically always returns CKBR_OK, but some return values have a special effect in Virtools :

CKBR_ATTACHFAILED : this return value should be used to tell Virtools (in authoring mode) not to attach the BB to the given owner. This can be returned when the function is called with the CKM_CKM_BEHAVIORATTACH event. This can be used to restrict the type of objects on which the BB can be attached.

CKBR_DETACHFAILED : this return value tell Virtools (in authoring mode) not to detach the BB from its owner. This can be returned when the function is called with the CKM_CKM_BEHAVIORDETACH event. For example if you deliver an object with its behavior and you decide that the object should always have this behavior, you can return this value.

Events

CKM_BEHAVIORCREATE

This event is triggered when the BB is drag and drop, in the Virtools user interface. It is not called when the BB is loaded from file (see the CKM_BEHAVIORLOAD event).

Like the CKM_BEHAVIORLOAD event, this may be a good place to initialize some internal structures, like Local Parameters or Settings.

CKM_BEHAVIORATTACH

This event is triggered when the BB is attached, in the Virtools user interface, to an owner. It is called after CKM_BEHAVIORCREATE or after an undo in the shematic if the BB has been deleted before.

This may be a good place to initialize some internal structures according to the owner or to register a render callback or register the BB with a manager for example.

The callback function can refuse the attachment, by returning the CKBR_ATTACHFAILED return value. See above.

CKM_BEHAVIORDETACH

This event is called when the BB is detached from its owner, in the Virtools user interface (but not when it is deleted, see CKM_BEHAVIORDELETE) or simply deleted from the user interface (we do not call CKM_BEHAVIORDELETE because of the undo).

This is a good place to cleanup local structures, like Local Parameters, which are dependent on the owner or to unregister render callback for example.

The callback function can refuse the detachment, by returning the CKBR_DETACHFAILED return value. See above.

CKM_BEHAVIORDELETE

This event is called when the BB is really deleted. It means the undo stack is full so this BB should be deleted or the BB is deleted beacause you create a new composition in author mode or the BB is attached to an object which is unload in runtime mode.

This is a good place to cleanup local structures, like Local Parameters, which has been create on CKM_BEHAVIORLOAD or CKM_BEHAVIORCREATE event.

CKM_BEHAVIOREDITED

This event is called right after the BB has been edited in the Virtools user interface. It is also called if the user has added new Inputs, Outputs, Parameter Inputs or Outputs. Note that this event is called even if the user opened the dialog but did not really change any value. This event is not called when the Settings are edited (see CKM_BEHAVIORSETTINGSEDITED). Another option is to use this callback to create a custom dialog box (see Creating a Custom Building Block Dialog Box)

This is a good place to reset your local structures according to the new BB's characteristics.

CKM_BEHAVIORSETTINGSEDITED

This event is called right after the BB's settings have been edited by the user in the Virtools user interface. Note that it does not mean that the user has actually changed any settings.

This is a good place to change some local structures that depend on the settings. Another option is to use this callback to create a custom dialog box (see Creating a Custom Building Block Dialog Box)

CKM_BEHAVIORPRESAVE

This event is called before the BB is saved in file.

This is a good place to prepare your BB for the save operation, for example to store some values in a Local Parameter so that they are stored in the file. You could then remove these values from the Local Parameter after the save (see CKM_BEHAVIORPOSTSAVE).

CKM_BEHAVIORPOSTSAVE

This event is called after the BB is saved in file.

This is where you would cleanup anything that you would have set up in the CKM_BEHAVIORPRESAVE event processing.

CKM_BEHAVIORLOAD

This event is called when the BB is loaded in memory from a file. When a BB is drag an drop into the schematic CKM_BEHAVIORCREATE and CKM_BEHAVIORATTACH are called but when a file is loaded only CKM_BEHAVIORLOAD is called.

Like the CKM_BEHAVIORCREATE event, this may be a good place to initialize some internal structures, like Local Parameters or Settings.

CKM_BEHAVIORRESET

This event is called when the CKContext is reset (CKContext::Reset() function) . Remember that Reset stops all execution and sets everything to the initial conditions. This function is also called right after the composition is loaded in players. See the CKContext for details.

This is good place to cleanup your temporary data.

CKM_BEHAVIORPAUSE

This event is called when the CKContext is paused (CKContext::Pause() function)

This is good place to cleanup your temporary data.

CKM_BEHAVIORRESUME

This event is called when the CKContext is resumed or starts playing (CKContext::Play() function).

This is a good place to set up your temporary data. Note however that the composition may play, but the BB may never become active, because it is not in an active Script or object, or because it is not part of the current scene. You can check whether or not your parent script is active in the current scene with:

beh->IsParentScriptActiveInScene(behcontext.CurrentScene);

CKM_BEHAVIORNEWSCENE

This event is called right after the composition has changed scene. The CKBehaviorContext contains pointers to the new current scene and to the previous scene.

This is a good place to check whether or not you are part of the new scene, and set up local structures or processes.

CKM_BEHAVIORACTIVATESCRIPT

This event is called when the script to which belongs the BB has been activated.

This means that you may be called soon (but it may also be never). Another good place to set up local structures.

CKM_BEHAVIORDEACTIVATESCRIPT

This event is called when the Script to which belongs the BB has been deactivated.

This means that you are sure not to be called until it is activated again. Another good place to cleanup your local structures.


Building Block Classes

This is the heart of custom Building Block development, where the actual actions are done.

During execution, when Virtools encounters a building block, it calls the execution function that had previously been attached to it. Also at various stages of the building block, Virtools may call the BehaviorCallback function. See the Behavior Prototype Creation chapter for information on how to define the executino and BehaviorCallback functions.

The building block is actually an instance of CKBehavior, and is managed by Virtools. The functions that do the job are actually C functions, that act on the CKBehavior instance, and on other objects related to it. The execution and BehaviorCallback function accept one argument, an CKBehaviorContext structure, which gives access to various information about the context of execution, including the CKBehavior itself.

This chapter details the CKBehaviorContext structure, the CKBehavior class and the CKBehaviorIO class, which are all useful when writing an execution or BehaviorCallback function.

The tasks of the execution function are detailed in the Writing the Execution Function chapter.

The events of the BehaviorCallback function are detailed in the Writing the Behavior Callback Function chapter.

CKBehaviorContext Structure

This is a structure containing informations about the context of the BB execution and the main managers. Among this information, you can especially find the delay in milliseconds that has elapsed since the last call. A behavior should always rely on this value to manage the amount of effect it has on its computation, if the effect of this computation relies on time. To use a behavior context, simply access its data.

CKBehavior*				Behavior;				// Pointer to the currently executed behavior
float					DeltaTime;				// number of milliseconds since previous frame.
CKContext*				Context;				// The CKContext this behavior belongs to.
CKLevel*				CurrentLevel;			// A Pointer to the current CKLevel
CKScene*				CurrentScene;			// A Pointer to the current CKScene
CKScene*				PreviousScene;			// A Pointer to the previous CKScene if available
CKRenderContext*		CurrentRenderContext;	// A Pointer to the main CKRenderContext
CKParameterManager*		ParameterManager;		// A Pointer to the ParameterManager
CKMessageManager*		MessageManager;			// A Pointer to the MessageManager
CKAttributeManager* 	AttributeManager;		// A Pointer to the AttributeManager
CKTimeManager*			TimeManager;			// A Pointer to the TimeManager

CKBehavior Class

Each time the user drag'n drop a behavior prototype on the "Schematic View" of the Virtools user interface, or when a Virtools composition is loaded, the system creates a CKBehavior object that will live independently from the prototype from here on. If you change the prototype, nothing will happen on your behavior and vice versa. You will need to directly transform your behavior if you need so. For this reason, you will find most of CKBehaviorPrototype functions in CKBehavior. We will describe them rapidly, if you need more informations, refers directly to the Behavior Prototype Creation chapter.

Description

These functions are used to change the description of the behavior, they are usually not used. They have the same meanings and effects than in CKBehaviorPrototype.

CK_BEHAVIOR_TYPE	GetType();
void				SetType(CK_BEHAVIOR_TYPE);

CK_BEHAVIOR_FLAGS	GetFlags();
void				SetFlags(CK_BEHAVIOR_FLAGS );

CK_CLASSID			GetCompatibleClassID();
void				SetCompatibleClassID(CK_CLASSID);

void				SetFunction(CKBEHAVIORFCT fct);
CKBEHAVIORFCT		GetFunction();

void				SetCallbackFunction(CKBEHAVIORCALLBACKFCT fct);

Target

Two functions allows you to know if a BB is targetable, ie : if the BB can apply to a different object than its owner.

CKBOOL IsTargetable(); void SetAsTargetable(CKBOOL target=TRUE);

Then, two functions allow you to actually know if the behavior is currently using a target or not and to force the use of a target which is highly not recommended.

CKBOOL IsUsingTarget();
CKERROR UseTarget(CKBOOL Use=TRUE);

Finally, you can retrieve the target object which is either the owner if no target is used, either the actual target otherwised. If you prefer, you can directly retrieve the target parameter. Also, you can change the value of this parameter or simply remove it.

CKBeObject*		GetTarget();
CKParameterIn*	GetTargetParameter();
CKParameterIn*	ReplaceTargetParameter(CKParameterIn* targetParam);
CKParameterIn*	RemoveTargetParameter();

Owner

As for the target, you can retrieve owner's informations. The owner object is simply the CKBeObject to which the Script containing the current BB applies. This script is the owner script. Their names are displayed on the left of the "Level View" Editor of the interface. The parent is either the parent graph if the behavior is inside a graph, either the owner script.

CKBeObject *GetOwner();
CKBehavior *GetParent();
CKBehavior *GetOwnerScript();

Runtime

A script is said activated when at least one of its inputs is activated. At creation, a behavior is not activated except if it has been created with the CKBEHAVIOR_ACTIVE flag. An activated script is actually executed only if all its ancestors are also activated. This information is mainly used outside the execution function, inside a callback function, for instance. One function tells you if the current behavior is activated, another one tells if the owner script is activated. You can also change the state of a behavior throught the Activate() function.

CKBOOL	IsActive();
CKBOOL	IsParentScriptActiveInScene(CKScene *scn);
void 	Activate(CKBOOL Active = TRUE,CKBOOL breset = FALSE);

You can also ask the behavior to execute itself at run time by using the Execute() function. It simply calls the execution function and returns its result. It the same philosophy, you can call the main callback functions of the behavior with a specific message or as if the parameters or the settings had been changed.

int		Execute(float deltat);
int 	CallCallbackFunction(CKDWORD Message);
void	NotifyEdition();
void	NotifySettingsEdition();

By default, a behavior has a priority of 0. Two functions allow you to access and set this priority. The behavior with the highest priority is executed first and of course, the behavior with the lowest priority is executed last. But, you need to know that this priority is only valuable inside the script containing the behavior. Afterwards, you need to set directly the priority of the scripts and/or of the object itself to control the general execution order.

int GetPriority();
void SetPriority(int priority);

Inputs and Outputs

Activate status

In Virtools's Schematic Editor, everything works with Behavior Links that propagate an activating signal. At each frame every activated behavior whose ancestor are also activated is executed. Then, it is always important to know which entrance was activated to adapt the behavior. IsInputActive() returns the actual state of the i-th input.

Important: As the system does not deactivate inputs alone, you have to do it yourself during your execution by calling ActivateInput(pos, FALSE).

During your execution, you can also activate an output with ActivateOutput(), the system will then propagate the signal from there for the next frame.

CKBOOL	IsInputActive(int pos);
CKBOOL	IsOutputActive(int pos);
void	ActivateInput(int pos,CKBOOL active=TRUE);
void	ActivateOutput(int pos,CKBOOL active=TRUE);

Creating, adding Inputs and Outputs

Once the behavior has been drag'n dropped on the "Schematic Editor", you still can change the description of your behavior (number of inputs, outputs...) dynamically. To do so, you can create, replace, add, remove or delete a IO depending on your needs. If you do so, you should have set the corresponding flag in the BB's prototype (for example CKBEHAVIOR_INTERNALLYCREATEDINPUTS) so that Virtools knows that you may change the number of inputs or outputs, and can act calmly if it notices a difference between the behavior and its prototype at the next load. See the Behavior Prototype Creation chapter for more information.

CKBehaviorIO*	CreateInput(CKSTRING name);
CKBehaviorIO*	CreateOutput(CKSTRING name);
int				AddInput(CKSTRING name);
int				AddOutput(CKSTRING name);
CKBehaviorIO*   ReplaceInput(int pos,CKBehaviorIO *io);
CKBehaviorIO*	ReplaceOutput(int pos,CKBehaviorIO *io);
CKBehaviorIO*	RemoveInput(int pos);
CKBehaviorIO*	RemoveOutput(int pos);
CKERROR			DeleteInput(int pos);
CKERROR			DeleteOutput(int pos);

General informations

CKBehaviorIO*	GetInput(int pos);
CKBehaviorIO*	GetOutput(int pos);
int				GetInputCount();
int				GetOutputCount();
int				GetInputPosition(CKBehaviorIO *pbio);
int				GetOutputPosition(CKBehaviorIO *pbio);

Parameter Inputs and Outputs

Enable status

A parameter is enabled when it is visible on the interface and when the user has access to it. When a parameter is disabled, an empty place will graphically replace it on the interface as it is done for the particule system. Usualy, you disable a parameter when the user has specified in the settings of your behavior that the parameter is not useful.

CKBOOL	IsInputParameterEnabled(int pos);
CKBOOL	IsOutputParameterEnabled(int pos);
void	EnableInputParameter(int pos,CKBOOL enable);
void	EnableOutputParameter(int pos,CKBOOL enable);

Reading and setting values

First, it is important to be able to retrieve the information given by the system or the user in the Parameters IOs. You can access these informations in four different ways. The way to do it usually depend on what type of information you want to retrieve and what you want to do with it. First, in any case, you can simply retrieve the CKParameterIn or CKParameterOut objects with GetInputParameter() and GetOutputParameter() and deal with it. For more information about these types, directly refers on the chapter Using Parameters.

CKParameterIn* GetInputParameter(int pos);
CKParameterOut* GetOutputParameter(int pos);

If you want to retrieve a simple type as int, bool, float... directly use the GetInputParameterValue() and GetOutputParameterValue() functions with the proper index and a pointer on the variable that will receive the information. Be careful, if you use this function with Virtools complex objects, it will return you the ID of the object, if you use it with any other complex object, it will return you exactly what you have set in it before. With this method, the system copies the value of the parameter inside your buffer. Therefore, if during your execution you have changed the value of a parameter, you need to notify the system of this change by setting the new value with SetOutputParameterValue(). For simple types, you do not need to provide the size of the buffer.

CKERROR	GetInputParameterValue(int pos,void *buf);
CKERROR	GetOutputParameterValue(int pos,void *buf);
CKERROR	SetOutputParameterValue(int pos,void *buf,int size=0);

If you want to directly retrieve a Virtools complex object (ie, an object that inherits from CKObject), use GetInputParameterObject() with the proper index. You then directly retrieve the pointer on the object and may freely work with it. If you want to change the object stored by your output parameter, use SetOutputParameterObject().

CKObject*	GetInputParameterObject(int pos);
CKObject*	GetOutputParameterObject(int pos);
CKERROR		SetOutputParameterObject(int pos,CKObject *obj);

Now, if you want to retrieve any other type of object (array...), use GetInputParameterReadDataPtr() and GetOutputParameterWriteDataPtr() with the proper index that will returns a pointer on your object. You can then work on your object as you want.

void*	GetInputParameterReadDataPtr(int pos);
void*	GetOutputParameterWriteDataPtr(int pos);

Creating, adding, deleting...

As for inputs and outputs, you can create, delete or add new parameters dynamically at run time. To do this, you have access to the following functions, they mainly correpond to the functions you can find in CKBehaviorPrototype, therefore refer to the Behavior Prototype Creation chapter for more informations about these functions. If you change the number of Parameter Inputs or Outputs, you should have set the corresponding flag in the BB's prototype (for example CKBEHAVIOR_INTERNALLYCREATEDINPUTPARAMS) so that Virtools knows that you may change the number of Parameter inputs or outputs, and can act calmly if it notices a difference between the behavior and its prototype at the next load.

CKParameterIn*	CreateInputParameter(CKSTRING name,int type);
CKParameterIn*	CreateInputParameter(CKSTRING name,CKGUID guid);
CKParameterOut*	CreateOutputParameter(CKSTRING name,int type);
CKParameterOut*	CreateOutputParameter(CKSTRING name,CKGUID guid);
void			AddInputParameter(CKParameterIn *in);
void			AddOutputParameter(CKParameterOut *out);
CKParameterIn*	InsertInputParameter(int pos,CKSTRING name,int type);
CKParameterOut*	InsertOutputParameter(int pos,CKSTRING name,int type);
CKParameterIn*	ReplaceInputParameter(int pos,CKParameterIn *param);
CKParameterOut*	ReplaceOutputParameter(int pos,CKParameterOut *p);
CKParameterIn*	RemoveInputParameter(int pos);
CKParameterOut*	RemoveOutputParameter(int pos);

General informations

As the following functions have explicit names, we will simply name them.

int GetInputParameterPosition(CKParameterIn *);
int GetOutputParameterPosition(CKParameterOut*);
int GetInputParameterCount();
int	GetOutputParameterCount();

Local Parameters

Settings

Some Local Parameters are actually Settings. Virtools gives you the possibility to know if a local parameter is actually a setting by using IsLocalParameterSetting() with the proper index. For the other functions on local parameters, the explanations are similar than for output parameters. Refers to these explanations for more informations, here we will simply name the useful functions. For more information on Parameters, see the Using Parameters chapter.

CKBOOL IsLocalParameterSetting(int pos);

Reading and setting values

CKParameterLocal*	GetLocalParameter(int pos);
CKERROR				GetLocalParameterValue(int pos,void *buf);
CKObject*			GetLocalParameterObject(int pos);
void*				GetLocalParameterReadDataPtr(int pos);
CKERROR				SetLocalParameterValue(int pos,void *buf,int size=0);
CKERROR				SetLocalParameterObject(int pos,CKObject *obj);
void*				GetLocalParameterWriteDataPtr(int pos);

Creating, adding, deleting...

CKParameterLocal*	CreateLocalParameter(CKSTRING name,int type);
CKParameterLocal*	CreateLocalParameter(CKSTRING name,CKGUID guid);
void				AddLocalParameter(CKParameterLocal *loc);
CKParameterLocal*	RemoveLocalParameter(int pos);

General informations

int GetLocalParameterPosition(CKParameterLocal *loc);
int GetLocalParameterCount();

CKBehaviorIO Class

This class represents the inputs and outputs of a behavior. An input can be activated or deactivated by a behavior link and an output can activate or deactivate a behavior link that will possible itself activate or deactivate other inputs. At execution time, the system won't change the states of the inputs, therefore if you don't change an activated input, for instance, it will stay activated for the next frame. Also, you need to activate the output yourself, otherwise the system will deactivate them before the next frame.

First, you can get or set the type of an IO. Two types, CK_BEHAVIORIO_IN and CK_BEHAVIORIO_OUT, and two functions are available.

void	SetType(int Type);
int		GetType();

As we said at the beginning, at any time, you can check or set the state of your IO with the two following functions.

void	Activate(CKBOOL Active=TRUE);
CKBOOL	IsActive();

Finally, you can also access or set the bahvior that owns the IO with :

CKBehavior *GetOwner();
void SetOwner(CKBehavior *b);


Creating a Custom Building Block Dialog Box

When creating a new building you may want to have a special dialog box to edit your parameters or settings. This is the case for some behaviors such as "DoOp" building block in the logics catagory.

First of all in the prototype creation (see Behavior Prototype Creation) you must add the CKBEHAVIOR_CUSTOMEDITDIALOG and / or CKBEHAVIOR_CUSTOMSETTINGSEDITDIALOG flags to your behavior prototype so the interface is aware that this behavior can have custom dialog boxes. You must also declare in this prototype a callback function that will catch the callback messages.

CKERROR MyBehaviorCallBackFunction(const CKBehaviorContext& behcontext);

//--------------------------------------------
//-- Behavior Prototype creation
CKERROR CreateUnlimitedControllerBehaviorProto(CKBehaviorPrototype **pproto)
{
    CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Unlimited Controller");
    if(!proto) return CKERR_OUTOFMEMORY;

    ...

    proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)(...|CKBEHAVIOR_CUSTOMEDITDIALOG|CKBEHAVIOR_CUSTOMSETTINGSEDITDIALOG));
    proto->SetBehaviorCallbackFct(MyBehaviorCallBackFunction);

    *pproto = proto;
    return CK_OK;
}

Then you must implement a callback function to handle the CKM_BEHAVIOREDITED and/or CKM_BEHAVIORSETTINGSEDITED that will be sent to the behavior when the user edit the behavior in the interface (see the Writing the Behavior Callback Function chapter for details on creating this function). This is upon reception of these messages that you can create your modal dialog box.

CKERROR MyBehaviorCallBackFunction(const CKBehaviorContext& behcontext)
{
  CKBehavior *beh = behcontext.Behavior;
  CKContext *ctx = behcontext.Context;

    switch( behcontext.CallbackMessage )
    {
    ...
    case CKM_BEHAVIORSETTINGSEDITED:
        {
            //-------------------------------------------------
            //  Create Settings Edition Modal Dialog here...
            ...
        }
        break;
    case CKM_BEHAVIOREDITED:
        {
            //-------------------------------------------------
            //  Create Behavior Edition Modal Dialog here...
            ...

        }
        break;
    case CKM_BEHAVIORDELETE:
    case CKM_BEHAVIORDETACH:
    case CKM_BEHAVIORACTIVATESCRIPT:
    case CKM_BEHAVIORRESUME:
    case CKM_BEHAVIORDEACTIVATESCRIPT:
    case CKM_BEHAVIORPAUSE:
    case CKM_BEHAVIORRESET:
    case CKM_BEHAVIORNEWSCENE:
        break;
    }
    return CKBR_OK;
}

When you use a custom dialog box inside a building block you should provide 2 versions of your plugin dll , one for "Author mode" which will be used in Dev and another "runtime" to be used inside player to avoid having useless interface code in players.


Using the Behavior Engine

  1. Behaviors and Objects Activation
  2. Using Parameters
  3. Using Attributes
  4. Using Messages
  5. Time Management


Behaviors and Objects Activation

Activity

Behavioral objects and scripts are always referenced by one or more scene ( The default case is the Level Scene). In these scenes one can specify the behavior of these objects when the composition is played or when a scene is launched.

A behavioral Object (CKBeObject or derivated) must be activated for its scripts to be executed and a script must also be activated to be executed. When a scene becomes active (CKLevel::LaunchScene) it activates, de-activates and/or reset objects according to their flags in this scene :

//-----------------------------------------
// Flags
typedef enum CK_SCENEOBJECT_FLAGS {
            CK_SCENEOBJECT_START_ACTIVATE		= 0x0001,	// The object or script is activated when the scene starts (Default)
            CK_SCENEOBJECT_ACTIVE				= 0x0008,	// The object or script is currently active (behaviors will be executed)
            CK_SCENEOBJECT_START_DEACTIVATE		= 0x0010,	// The object or script is deactivated when the scene starts
            CK_SCENEOBJECT_START_LEAVE			= 0x0020,	// The object or script stay in their current state when the scene starts
            CK_SCENEOBJECT_START_RESET			= 0x0040,	// Objects : Reset their initial conditions if any.
                                                            // Scripts : Re-initialize script.( Default)
} CK_SCENEOBJECT_FLAGS;

//-----------------------------------------
// Flags
void					CKScene::SetObjectFlags		(CKSceneObject *o,CK_SCENEOBJECT_FLAGS flags);
CK_SCENEOBJECT_FLAGS	CKScene::GetObjectFlags		(CKSceneObject *o);
CK_SCENEOBJECT_FLAGS	CKScene::ModifyObjectFlags	(CKSceneObject *o,CKDWORD Add,CKDWORD Remove);

Once a scene is being played objects and script can be activated from the scene with the following methods :

//-----------------------------------------
// Object And Script activation
void CKScene::Activate(CKSceneObject* o,CKBOOL Reset);
void CKScene::DeActivate(CKSceneObject*o);

CKBOOL CKScene::IsObjectActive(CKSceneObject *o);

Checking activity in a behavior callback

When you write a behavior that install render callbacks or other mechanisms that are independant of the behavioral process you need to remove them when your behavior becomes inactive. A behavior can become inactive for many reason :

  • A new scene has been launched and the behavior is inactive in this scene.
  • The script that owns this behavior has been de-activated.
  • The behavioral object that owns this behavior has been de-activated.
  • Upon CKContext::Pause or CKContext::Reset

All the events should be catch in a behavior callback function (See Writing the Behavior Callback Function) if you intent to install a render callback for a while. Some of them are explicit in what happened to the behavior (for example CKM_BEHAVIORDEACTIVATESCRIPT and CKM_BEHAVIORACTIVATESCRIPT) but for others such as CKM_BEHAVIORNEWSCENE which signals that a new scene has just been launched you can use methods such as CKBehavior::IsParentScriptActiveInScene to see if your behavior will still be active in the new scene of if you should clean up things.

Initial Conditions (IC)

The Level and scenes can store an initial condition of an object so that it can be use to later restore the object state (CKReadObjectState) so that it starts the scene in a specific state. A Initial condition is a snapshot of the object in a given state store in a CKStateChunk, this snapshot is created using CKSaveOjbectState.

The following methods can be use to set or retrieve the Initial Condition of an object in a given scene:

CKBOOL			CKScene::SetObjectInitialValue	(CKSceneObject *o,CKStateChunk *chunk);
CKStateChunk*	CKScene::GetObjectInitialValue	(CKSceneObject *o);


Using Parameters

A parameter is a CKObject that gives access to a specific type of data in the schematic of Virtools. This type needs to be registered in the parameter manager of Virtools. It is possible to register new types of parameters, but this will be seen in the paragraph "Registering New Parameter Types". There are two main types of parameters in Virtools :

  • CKParameterIn that simply allows behaviors to receive a value from another behavior, from an operation or from a CKParameter,
  • CKParameter that stores a value in its own memory.

Those parameters are necessarly linked to a behavior. There is 2 types that derive from CKParameter : CKParameterLocal and CKParameterOut.

Basic types

See the Pre-Registred Parameter Types paper for a complete list of the exisiting parameter types

CKParameterIn

In parameter do not store any value, they are simply data inputs for behaviors. They get their value from a source which can be either another CKParameterIn, a CKParameterOut or a CKParameterLocal, ie the output of another behavior, the result of a parameter operation, a local parameter... They appear on the top of the behaviors.

Reading the value

There are two ways to retrieve the value of an input parameter. First, you can use GetValue() that will copy the data of the source in the buffer you give. Be carefull, for Virtools's complex object, this function will copy the ID of the object, then you need to retrieve the object yourself with the CKContext::GetObject() function. You can also directly retrieve the pointer on the data or object id with GetReadDataPtr(). As you are accessing a shared data, you should never change this pointer's value.

CKERROR GetValue(void *buf);
void    *GetReadDataPtr();

// Example --
CKParameterIn *p
CK_ID id=0;

p->GetValue(&id);
CKObject* obj=Context->GetObject(id);

Managing the data source

Usually, you don't need to manage the source of the parameter, but it can happen that you want to directly access or set the source parameter. When an input parameter is linked to another input parameter, we say that it has a shared source. On the contrary, when it is directly linked to an output parameter, we say that it has a direct source. By calling GetShareSource(), you will get the share source if there is one, a null pointer otherwise and with GetDirectSource(), you will get the direct source if there is one, a null pointer otherwise. If you directly want to retrieve the parent source that stores the data, call GetRealSource() that finds the first CKParameter of the parents of the parameter.

CKParameterIn* GetSharedSource();
CKParameter* GetDirectSource();
CKParameter* GetRealSource();

You can also directly set the the source of your input parameter. If you set a direct source with SetDirectSource(), its value will then be the data of the source you've given, if you set a shared source with ShareSourceWith(), it will be the data of the real source of the source you've given.

CKERROR SetDirectSource(CKParameter *param);
CKERROR ShareSourceWith(CKParameterIn *param);

General

You can also retrieve the parameter's GUID with GetGUID(), its type with GetType() and its owner which is the behavior to which it is an input with GetOwner().

int       GetType();
CKGUID    GetGUID();
CKObject* GetOwner();

CKParameter

A CKParameter stores its own data in memory. It is the base class for both CKParameterOut and CKParameterLocal so the following methods are available on both classes.

Reading and setting the value

As for input parameters, you can access the data through a copy of this data or directly by retrieveing a pointer on the data. To get a copy of the data, call GetValue() with a buffer that will receive the copy of the data and a boolean that tell if you want to update the value before to retrieve it. This boolean is only useful when your parameter is the output of a parameter operation. Then, you can change it, but you need to give it back to the system with SetValue().

CKERROR		GetValue(void *buf, CKBOOL update = TRUE);
CKERROR		SetValue(void *buf,int size = 0);

If you prefer to work with pointer, respectively use GetWriteDataPtr() and GetReadDataPtr() if you want to change or not the value. But if you change the value, you then need to call DataChanged() to update the destinations of your parameter too. GetDataSize() gives the size of the data in bytes. These methods returns the pointer used internally so do not delete it.

int			GetDataSize();
void *		GetReadDataPtr(CKBOOL update = TRUE);
void *		GetWriteDataPtr();
void		DataChanged();

You can also copy the value from another output parameter. First, you need to check that they have compatible types with IsCompatibleWith(). Then, you can copy the value with CopyValue(). But this is rarely done.

CKERROR		CopyValue(CKParameterOut *param,CKBOOL UpdateParam=TRUE);
CKBOOL		IsCompatibleWith(CKParameterOut *param);

As for the input parameter, when an output parameter has the type of a Virtools object, it only stores the ID of this object. Therefore, if you want to get the object itself, you need to retrieve it through its ID.

// Example Get -- CKParameterOut *p
CK_ID id=0;
p->GetValue(&id);
return CKGetObject(id);

// Example Set -- CKObject *obj
CK_ID id=CKOBJID(obj);
return p->SetValue(&id);

General

You can also retrieve the parameter's GUID with GetGUID(), its type with GetType() and its owner which is the behavior to which it is an input with GetOwner().

CKParameterType	GetType();

CKGUID		GetGUID();
CKObject*	GetOwner();

You can also change them, but it is not recommended as other parameters may have been linked to this one and their types may be incompatible.

void SetType(int type);
void SetGUID(CKGUID guid);
void SetOwner(CKObject *o);

CKParameterOut

An output parameter stores its own data in memory. As an input parameter has a source, an output parameter can have one or more destinations that are updates as soon as the value of the parameter has changed. They appear at the bottom of the behavior. They are also used to indirectly store object in a DataArray and for the attribute of objects in Virtools.

Managing destinations

Usually, you won't need to manage the destinations of a parameter, but Virtools allows you to do so. Each time you call DataChanged(), the system copies the parameter data to all the destinations which wre CKParameterOut themselves. Therefore, you can add, remove or get destinations at any time with the following functions.

int				GetDestinationCount();
CKParameterOut*	GetDestination(int pos);
CKERROR			AddDestination(CKParameterOut *param,CKBOOL CheckType=TRUE);
void			RemoveDestination(CKParameterOut *param);
void			RemoveAllDestinations();

Enable, disable

You can decide to hide an output parameter from a behavior. It uselly happens when the user can select or not outputs in the setting of a behavior, as for the particle systems.

void	Enable(CKBOOL act=TRUE);
CKBOOL	IsEnabled();

CKParameterLocal

CKParameterLocal inherits from CKParameter and do not provides additionnal methods. It is simply a parameter that is not necesseraly attached to a behavior. They can be either creating in memory in the behavior or directly in the schematic :

"This" parameter

Any local parameter can be define as a "this" parameter by calling SetAsMyselfParameter(true). It is equivalent in the schematic of Virtools of the right click menu "Add <This> Parameter". It simply means that the data is the CKObject owner of the script at any time and cannot be changed by you.

void	SetAsMyselfParameter(CKBOOL act);
CKBOOL	IsMyselfParameter();


Using Attributes

Attributes are typed informations you can add to a CKBeObject, with possibly a value attached to them, in the form of a CKParameterOut. One other real power of the attributes is the possibility to retrieve instantly the list of objects with a specific attribute, in the current scene, or in every scene.

Registering a new Attribute

The creation of an attribute type is done through the function CKAttributeManager::RegisterNewAttributeType. Suppose we want to create a new attribute type that will represent Health points using a a float value and that can only be applied to a character:

CKAttributeManager* attman = context->GetAttributeManager();
CKParameterType HPattrib 	= attman->RegisterNewAttributeType("HP",CKPGUID_INT,CKCID_CHARACTER);

The first parameter of the function is the attribute name, the second is the GUID of the parameter type attached (use CKPGUID_NONE if no parameter is needed) and the last is the lowest class id (strictly deriving from CKBeObject though) of the object to which you can apply this attributes. Here "HP" can only be applied to a CKCharacter.

You can store your attribute in a category. It's useful to sort your attributes in the user interface only. For example, let's categorize our HP attribute in the category RPG Attributes:

// we create the category
attman->AddCategory("RPG Attributes");
attman->SetAttributeCategory(HPattrib,"RPG Attributes");

You can also set a default value for the attribute parameter:

// This attribute can have a default value of 100 HP for example
attman->SetAttributeDefaultValue(HPattrib,"100");

Adding or Removing an attribute

Attributes can be added to or removed from an instance of CKBeObject using their names or their types:

// Faster
MyBeObject->SetAttribute(HPAttrib);

// - or -

// Slower
MyBeObject->SetAttribute("HP");

Accessing the attribute

To see if an object has a specific attribute, use the CKBeObject::HasAttribute(). You can then read or write into the parameter attached, if any:

// We Retrieve the parameter attached to this attribute
CKParameterOut* pout = MyBeObject->GetAttributeParameter(HPAttrib);

// then we set the value we need
int myhp = 50;
pout->SetValue(&myhp);

As said before, you can have a list of all objects, by scene or by level, possessing a specific attribute. This is how it works:

// list of objects in the current scene
const XObjectPointerArray& array = attman->GetAttributeListPtr(HPAttrib);

// - or -

// list of objects in the level
const XObjectPointerArray& array = attman->GetGlobalAttributeListPtr(HPAttrib);

// to iterate on this list
for (CKObject** it = array.Begin(); it != array.End(); ++it) {
    CKBeObject* beo = (CKBeObject*)*it;
    // Your code goes here...
}

If you want the list of objects of several attributes, use CKAttributeManager::FillListByAttributes() and CKAttributeManager::FillListByGlobalAttributes().

Using Attributes Callback

Callback on attribute assignment or removal. A callback function can be called each time a specific attributed is applied to or removed from an object. In this example we create a new attribute type specific to materials. We want that each time a material has this attribute set it becomes transparent and each time the attribute is removed it becomes opaque:

// Attribute registration
CKAttributeType TransparentAttrib=attman->RegisterNewAttributeType("Transparent",CKGUID§(0,0),CKCID_MATERIAL);

// Setting the callback
attman->SetAttributeCallbackFunction(TransparentAttrib,MyAttributeCallback,NULL);

// ...

// Callback function
void MyAttributeCallback(CKParameterType AttribType,CKBOOL Set,CKBeObject *obj,void *arg)
{
    VxColor MatColor;
    if (CKMaterial§ *mat=(CKMaterial§ *)obj) {
        mat->GetDiffuse(&MatColor);
        if (Set) // The attribute is being set
            MatColor.a = 0.5f; // Alpha to semi-transparent
        else   // The attribute is being removed
            MatColor.a = 1.0f; // Alpha to opaque
        mat->SetDiffuse(&MatColor);
    }
}


Using Messages

Messages can be sent by objects to a single CKBeObject, to a group of objects (CKGroup or CKCharacter) or to every objects in the scene. Behavioral Outputs (CKBehaviorIO) can also be activated when messages are dispatched. You can also attach data in the form of CKParameterOut parameters to the message.

Creating Message types

Message types are only defined by a unique string, the message name. when adding a new message type, an int, the message type is returned. All message operations will now be proceed with this integer type.

// we get the message manager
CKMessageManager* mm = m_Context->GetMessageManager();

// we register our new type of message
CKMessageType msgtype = mm->AddMessageType("MyMessage");

If a message type with the same name was already registered, its old index will be returned.

You can rename a message already created by using CKMessageManager::RenameMessageType().

Sending Messages

Here is the code to send a message to a single recipient "destination" from "sender":

CKBeObject* destination;
CKBeObject* sender;

// The message sending
CKMessage* msg = mm->SendMessageSingle(msgtype,destination,sender);

Now suppose that the destination is a CKGroup and you want the message to be dispatched to all the group components, use:

// The message sending
CKMessage* msg = mm->SendMessageGroup(msgtype,destination,sender);

Now if you want the message to be sent to every objects deriving from a CK3dEntity waiting for a message in the scene, use:

// The message sending
CKMessage* msg = mm->SendMessageBroadcast(msgtype,CKCID_3DENTITY,sender);

As said before, you can attach data with the messages. Here is the way to do it:

CKParameterOut* pout = context->CreateCKParameterOut(NULL,CKPGUID_INT);
int a = 99;

pout->SetValue(&a);
msg->AddParameter(pout,TRUE);

The second parameter of CKMessage::AddParameter() is a boolean specifying if the parameter attached must be deleted once the message is received and discarded. Use TRUE only if YOU have created the parameter attached.

You can attach as many parameters as you wish.

Receiving Messages

There are several ways to receive a message, dependeing on what you want to do.

Fist if you want a single object to receive a message, you need to register it as waiting for messages. This is done by calling the function CKBeObject::SetAsWaitingForMessages(). Then you'll have to poll the object each frame to see if it has received a message. Here is an example of achieving that, and retreiving possibly attached parameters:

for (int i=0; i<beo->GetLastFrameMessageCount(); ++i) {
    CKMessage* msg = beo->GetLastFrameMessage(i);
    // msg->GetType() to see the type of message

    for (int j=0; j<msg->GetParametercount(); j++) {
        CKParameterOut* pout = msg->getParameter(j);
        // your code goes here...
    }
}

The second method of waiting for a message is by registering a CKBehaviorIO in the message manager. The message manager will activate the behavioral output when the owner object will receive the waited message. Here is the execution function of the WaitMessage building block:

int WaitMessage(const CKBehaviorContext& behcontext)
{
    CKBehavior* beh = behcontext.Behavior;
    CKMessageManager* mm = behcontext.MessageManager;

    CKBeObject* beo=(CKBeObject*)beh->GetTarget();
    if( !beo ) return CKBR_OWNERERROR;

    CKMessageType Msg = -1;
    beh->GetInputParameterValue(0,&Msg);
    if( Msg<0 )="" return="" ckbr_ok;="">	// Enter by on, we register
    if(beh->IsInputActive(0)) {
        beh->ActivateInput(0,FALSE);

        // We register the output of the behavior to wait for a specific message
        mm->RegisterWait(Msg,beh,0,beo);
    }

    // Enter by off, we unregister
    if(beh->IsInputActive(1)) {
        beh->ActivateInput(1,FALSE);

        // We unregister the output of the behavior to wait for a specific message
        mm->UnRegisterWait(Msg,beh,0);
    }

    return CKBR_OK;
}
To retreive attached parameters, you'll have to poll the beobject given here as destination, but in the same frame that the CKBehaviorIO has been activated. The code to do this is in Logics/GetDataMessage.cpp and this behavior is to be used just after a WaitMessage, with a link delay of 0.


Time Management

Using The Time

The time is very important for the behaviors, because it is with this scale that you can provides contents frame rate independant, running at the same visual speed on very different processors. The class responsible of controlling the time in CK2 is the CKTimeManager.

The time manager maintains several data containing elapsed time:

  • CKTimeManager::GetLastDeltaTime gives you the elapsed time since the last frame. This is the time given to the building blocks by default, in the CKBehaviorContext structure but is not always the real time as it can be :
    • Multiplied by current scale factor : SetTimeScaleFactor,GetTimeScaleFactor
    • Clamped between a minimum and maximum values : SetMinimumDeltaTime and SetMaximumDeltaTime. Using these methods one can force the delta time to be same each frame

  • CKTimeManager::GetAbsoluteTime provides the time elapsed in ms since the last CKContext::Reset event. The time is paused when the content is paused and resumed when it is resumed. It is affected in the same manner (scale,clamping).

  • CKTimeManager::GetTime returns the time elapsed in ms since the current context was created but this is hte real time.

Normally, in a building block, you just have to use the CKBehaviorContext::DeltaTime. This way, one can simulates a constant speed by fixing it at a constant time.

For example, suppose you want to rotate an object at the speed of PI/second. The code will looks like:

CK3dEntity* entity;

VxVector axis(0,1.0f,0);
float angle = PI;

entity->Rotate(&axis, angle * behcontext.DeltaTime * 0.001f);


Using the Render Engine

Plan of Part 2.6 - Using the Render Engine

  1. Understanding the Render Loop
  2. Using 2D Entities
  3. Using 3D Entities
  4. Using Materials
  5. Using Textures
  6. Using Meshes
  7. Using Render Contexts
  8. Using Portals
  9. Custom Rendering


Understanding the Render Loop

The rendering loop is divide as follow:

  • Back and depth buffer clearing (CKRenderContext::Clear).
  • Drawing of the scene (CKRenderContext::DrawScene).
    • Call of the sprites sorts functions
    • Managers PreSpriteRender
    • Rendering of the background CK2dEntity (rendered hierarchically, and sorted by ZOrder for the siblings)
      • CK2dEntity PreRenderCallback
      • CK2dEntity Render (CKSprite drawing for example)
      • CK2dEntity rendering of the children, sorted by Zorder
      • CK2dEntity PostRenderCallback
    • Managers PreRender
    • RenderContext PreRenderCallbacks
    • Rendering of all CK3dEntity: In the hierarchical order (parent to children) siblings being sorted according to their Z-order (CKRenderObject::SetZOrder) . The exception being transparent entities (or those with the moveable flag VX_MOVEABLE_RENDERLAST) that are rendered at the end (sorted according to: ZOrder, Bounding Box, and distance from the barycenter to the viewpoint). Also note that plane objects (like the CKSprite3D) will be classified using the front plane/back plane information if other tests have failed to come up with a final order. Here is an explantory schema :

      • CK3dEntity PreRenderCallbacks
      • CK3dEntity default or custom RenderCallback
      • CK3dEntity PostRenderCallbacks
    • RenderContext PostRenderCallbacks
    • Managers PostRender
    • Rendering of the foreground CK2dEntity (rendered hierarchically, and sorted by ZOrder for the siblings) (same decomposition than for the background CK2dEntity).
    • Managers PostSpriteRender
    • RenderContext PostSpritesRenderCallbacks
  • Copy/swap of the back buffer to the screen (CKRenderContext::BackToFront).


Using 2D Entities

CK2dEntity (and the derived class CKSprite) derives from CKRenderObject, which means that they are objects to be rendered by the CKRenderContext they belong to.

Hierarchy

2D Entities can be part of a hierarchy, a scene graph. That means a CK2dEntity can have a parent (and one only) and it can have children, as many as it wants to. Here is an example of creating a hierarchy:

// the object available
CK2dEntity* entity,parent,child1,child2,child3;

// Parenting
entity->SetParent(parent);

// Children
child1->SetParent(entity);
child2->SetParent(entity);
child3->SetParent(entity);

// Children Removing
child2->SetParent(NULL);

Once the hierarchy is created, you can parse it:

CK2dEntity* entity;

// Method 1
for (int i=0; i<entity->GetChildrenCount(); ++i) {
    CK2dEntity* child = entity->GetChild(i);
    // ...
}

When an entity is parented to another, you may change some options. First, you can choose if the entity must be clipped to its parent with the function CK2dEntity::SetClipToParent.

You can also choose how the entity will stick to its parent when this parent will be resized.You can choose to stick to the left, to the right, to the top and to the bottom (flags CK_2DENTITY_STICKLEFT, CK_2DENTITY_STICKRIGHT, CK_2DENTITY_STICKTOP and CK_2DENTITY_STICKBOTTOM used with CK2dEntity::SetFlags.) All these flags are cumulable : you can stick top/left, but you can also stick left/right, which means be centered.

The stick flags are also usefull to constraint a 2D Entity to the screen, when changing screen resolution. Another interesting function to support screen resolution changes is to set the 2D entities as homogeneous with CK2DEntity::SetHomogenousCoordinates. The percentage of screen used by the sprite will remain the same when resolution changes. You can then combine this two functions (entity child stuck to an homogeneous parent) to achieve almost any effect.

Rendering

A CKSprite is rendered by drawing its sprite in the destination rectangle (CK2dEntity::SetRect) and a CK2dEntity is rendering two triangles forming a rectangle of the same size as above, using the CKMaterial given by CK2dEntity::SetMaterial. If no material is given, the CK2dEntity renders nothing in itself.

The 2d Entities are rendered hierarchically, in parent->children order, the sorted by the ZOrder for the siblings. You can also set pre and post render callbacks. Here is the pseudo code of the rendering of a CK2dEntity.

Render()
{
    if hierarchically hidden then exit

    if visible then call prerendercallbacks

    // if one of the prerendercallbcak returns FALSE then the rendering
    // is skipped, and the children rendering as well
    if all prerendercallbacks have returned ok to render then
    {
        if visible then draw // drawing of the CKSprite or the CKMaterial of the CK2dEntity

        for all the children sorted in their growing ZOrder do {
            if parent offscreen and child is clip to parent continue

            child->Render() // child rendering
        }
    }

    if visible then call postrendercallbacks

}

The surface of the texture or the sprite actually drawn is determined by the source rectangle (CK2dEntity::SetSourceRectangle). The source rectangle is given in pixel for the CKSprite and in UV coordinates for the CK2dEntity. The destination rectangle is the screen zone which will be actually covered with pixels.


Using 3D Entities

CK3dEntity (and all derived classes : CK3dObject, CKBodyPart, CKCharacter, CKCurve, CKLight and CKTargetLight, CKCamera and CKTargetCamera, and CKSprite3D) derives from CKRenderObject, which means that they are objects to be rendered by the CKRenderContext they belong to.

Hierarchy

3D Entities can be part of a hierarchy, a scene graph. That means a CK3dEntity can have a parent (and one only) and it can have children, as many as it wants to. Here is an example of creating a hierarchy:

// the object available

CK3dEntity* entity,parent,child1,child2,child3;

// Parenting
entity->SetParent(parent);

// Children
entity->AddChild(child1);
entity->AddChild(child2);
entity->AddChild(child3);

// Children Removing
entity->RemoveChild(child2);

Once the hierarchy is created, you can parse it in two ways:

CK3dEntity* entity;

// Method 1
for (int i=0; i<entity->GetChildrenCount(); ++i) {
    CK3dEntity* child = entity->GetChild(i);
    // ...
}

// Method 2
XObjectPointerArray children;
entity->GetChildren(children);

for (CKObject** it = children.Begin(); it != children.End(); ++it) {
    CK3dEntity* child = (CK3dEntity*)*it;
}

Meshes

3D Entities can contains an unlimited numbers of meshes but only one is the current mesh, the rendered mesh. Adding several meshes on a 3D Entity can be used for example for level of detail purpose : the 3D Entity contains meshes of different resolution, and in function of the distance to the viewer, it selects the optimal resolution mesh.

Here is a sample of adding meshes to a 3D entity and selecting one as the current.

CK3dEntity* entity;
CKMesh* mesh1,mesh2,mesh3;

entity->AddMesh(mesh1);
entity->AddMesh(mesh2);
entity->AddMesh(mesh3);

entity->RemoveMesh(mesh2);

entity->SetCurrentMesh(mesh2); // If the mesh is not present, it adds it

Transformations

Many transformations can be done on a 3D entity. But they all come to modifying the world matrix of the entity, and the local matrix if the object has a parent. Matrices contains the position, orientation and scale of an object. World matrix is the matrix defining the object itself, Local Matrix is the matrix defining the object regarding its parent. If you transform an object, its children's world matrices will be modified, but not its children's local matrices.

Here is a sample of some transformation you can do on a CK3dEntity:

CK3dEntity* entA,entB;

// translation of A of 1 on the Z axis of the world
VxVector v(0,0,1.0f);
entA->Translate(&v);

// rotation of A of 1 radian on the Y axis of B
v.Set(0,1.0f,0);
entA->Rotate(&v,entB);

// Non-Uniform Scale (half on X, same on Y, double on Z) of A
v.Set(0.5f,1.0f,2.0f);
entA->SetScale(&v);

// set the position of A to the one of B
v.Set(0,0,0);
entA->SetPosition(&v,entB);

// sets the orientation of A to the one of B

VxQuaternion q;

entB->GetQuaternion(&q);
entA->SetQuaternion(&q,NULL,FALSE,TRUE); // keeps the scale

// sets the position, orientation and scale of a to the ones of B

VxMatrix mat;
entB->GetWorldMatrix(mat);
entA->SetWorldMatrix(mat);

Geometric Data

Bounding Boxes

The bounding box of a Ck3dEntity can be retreive with the function CK3dEntity::GetBoundingBox. It can be the local bounding box (which is the bounding box of the CKMesh, unless the user has set one with the CK3dEntity::SetBoundingBox function) or the world bounding box (also known as the axis aligned bounding box (AABB)) which is the bounding box of the local box transformed in the world referential. A box is given by a VxBbox, with contains the two extreme vertices of the box.

Another bounding box you can get from a CK3dEntity is the hierarchical bounding box. The hierarchical box is the concatenation of all the boxes of the children. The local hierarchical bounding box is only the world transformed back to the referential of the entity, so only the world is really relevant, and more tight fitting.

The bounding box of a CK3dEntity is used for rendering purpose : the object is rendered only if the bounding box is in the viewing frustrum. So if you render an object with no mesh and a custom render callback, you should set a tight fitting world bounding box. If not, the bounding box won't be initialized and the object will be rendered no matter where the camera is (that can be a volunteer effect though...).

Others

With the function CK3dEntity::GetBaryCenter, you can quickly have the geomtric bary center of an object in the world, which is in fact the bary center of the current mesh transformed in the world.

You can also have the estimated radius in world coordinates of the object in the world, for quick proximity test purposes with the function CK3dEntity::GetRadius.

You can also quickly know if the enity is inside the viewing frustrum with CK3dEntity::IsInViewFrustrum and CK3dEntity::IsInViewFrustrumHierarchic or more quickly, if it was all inside or all outside the frustrum at the last frame (no calculus involved) CK3dEntity::IsAllInsideFrustrum and CK3dEntity::IsAllOutsideFrustrum.

Rendering

The rendering of a basic 3D Entity (namely a CK3dEntity, CK3dObject and CKBodyPart) consists in rendering the current mesh of the entity in the referentiel given by the current world matrix of the entity. A CKSprite3D won't render its current mesh but a planar mesh consisting of 2 triangles forming the sprite. Characters, Lights and Camera have generally no meshes, but if they do, they will render them.

The rendering of a 3D Entity can be altered in several ways by the user:

  • He can changes the render callbacks of the mesh attached (see Using Meshes).
  • He can add PreRenderCallbacks on the CK3dEntity.
  • He can replace the standard render callback of the CK3dEntity.
  • He can add PostRenderCallbacks on the CK3dEntity.

A void* can be given as user data on any callback presented here.

Here is an example of adding a PostRenderCallback to a CK3dEntity. For more detailed information on how to handle the rendering in the callback, see Custom Rendering paper.

int MyRender(CKRenderContext *rc,CK3dEntity *ent,void *arg)
{
    void* MyData = arg;

    // Do the custom render here

    return 1; // 1 if the object can be picked
}

CK3dEntity* entity;
void* MyData;

// callback adding
entity->AddPostRenderCallback(MyPostRender,MyData);

You can also add one or many CKObjectAnimation on a CK3dEntity. See the paper Using Animation for more details.

Fnally you can choose if you want your object to be pickable with CK3dEntity::SetPickable. By default, every 3D entity is pickable.


Using Materials

The material is the representation of the surface of an object. Each face of a mesh can have its own material. It represents colors (diffuse color, specular color, etc.), blending properties, render modes (solid, gouraud, etc.) and possible a texture, combined with its filter modes.

Setting Material Properties

Colors

There are four colors to defines on a CKMaterial:

  1. The diffuse color (CKMaterial::SetDiffuse) : It describes how a material reflects the diffuse light in a scene. Because most scenes contain much more diffuse light (CKLight::SetColor) than ambient light, diffuse reflection plays the largest part in determining color. Additionally, because diffuse light is directional, the angle of incidence of the light affects the overall intensity of the reflection. The alpha value is used for alpha transparency (see below).
  2. The specular color (CKMaterial::SetSpecular) : this is the color of specular highlighting of the material, appearing when lighted with specular lights, and when seen from a certain point of view. This works with the specular power (CKMaterial::SetPower), a float between 0 and +infinite. The greater the power, the thinner the specular highlight.
  3. The ambient color (CKMaterial::SetAmbient) : It describes how a material reflects the ambient light in a scene. Ambient reflection is nondirectional. Because ambient light (CKRendercontext::SetAmbientLight) is usually low in the scene, ambient reflection has a lesser impact on the apparent color of a rendered object, but it does affect the overall color, and is most noticeable when little or no diffuse light reflects off the material.
  4. The emissive color (CKMaterial::SetAmbient) : Materials can be used to make a rendered object appear to be self-luminous. You can use a material's emissive property to add the illusion that an object is emitting light, without incurring the computational overhead of adding a light to the scene.

Material Colors

Here is a sample code to create the material shown in the picture above :

CKMaterial* mat = (CKMaterial*)context->CreateObject(CKCID_MATERIAL,"Material");

// A hot red diffuse color
mat->SetDiffuse(VxColor(1.0f,0.3f,0.3f,1.0f));
// A light blue ambient reflection
mat->SetAmbient(VxColor(0.0f,0.0f,0.5f,1.0f));
// No emissive color at all
mat->SetEmissive(VxColor(0.0f,0.0f,0.0f,1.0f));
// A small white specular highlighting
mat->SetSpecular(VxColor(1.0f,1.0f,1.0f,1.0f));
mat->SetPower(100.0f);

Blending Modes

You can achieve transparent, additive or negative effetcs by changing the blending modes of a material. When blending is enabled, you can set the source blending factor (CKMaterial::SetSourceBlend) describing how the pixels you're writing will be actually written and the destination blending factor (CKMaterial::SetDestinationBlend) describing how the pixels you're overwriting will affect the final result. For a describtion of the available blending factors, see VXBLEND_MODE.

Here is a sample of setting a material as half transparent, with alpha transparency :

// we enable alpha blending for the material
mat->EnableAlphaBlend();
// we set the source blend factor to use the alpha of the source
mat->setSourceBlend(VXBLEND_SRCALPHA);
// we set the destination blend factor to use the inverse alpha of the source
mat->setDestinationBlend(VXBLEND_INVSRCALPHA);
// now we set the alpha transparency of the material by changing the alpha of the
// diffuse color
VxColor col = mat->GetDiffuse();
col.a = 0.5f;
mat->SetDiffuse(col);

Render Modes

Fill Mode and Shade Mode

You can change the rendering mode of the material in several ways. For example, you can set the material to be both sided or not (CKMaterial::SetTwoSided), how the material will test the ZBuffer (CKMaterial::SetZFunc), wether it will write in the ZBuffer or not (CKMaterial::ZWriteEnabled). You can also change the fill mode of the primitives rendered with this material (CKMaterial::SetFillMode) and the shading method used (CKMaterial::SetShadeMode).

Texture

Texture Address Mode

A material can have a texture attached (CKMaterial::SetTexture). You can choose how the texture will be blended with the material itself (CKMaterial::SetTextureBlendMode). The texture can be modulated with the color of the material, or purely decaled (see VXTEXTURE_BLENDMODE for more details).

You can also choose how the texture will be filtered when magnified or minified (CKMaterial::SetTextureMagMode,CKMaterial::SetTextureMinMode) and how the texture will be mapped (wrapped, clamped, etc.) (CKMaterial::SetTextureAddressMode). Warning : to achieve mip-mapping, you must set the minification mode to one Mip Mode (VXTEXTUREFILTER_LINEARMIPLINEAR for example) and tell the texture to use mipmaps (CKTexture::UseMipMap).

Texture Min Filtering

Texture Mag Filtering

Here is a sample to set a texture on a material :

CKTexture* tex = (CKTexture*)context->CreateObject(CKCID_TEXTURE,"MyTexture");

// we set the texture on the material
mat->SetTexture(tex);
// no filtering asked for minification
mat->SetTextureMinMode(VXTEXTUREFILTER_NEAREST);
// bifiltering for magnification
mat->SetTextureMagMode(VXTEXTUREFILTER_LINEAR);
// the texture will be wrapped around
mat->SetTextureAddressMode(VXTEXTURE_ADDRESSWRAP);
// the texture will be modualted with the color of the material, using
// also its alpha transparency
mat->SetTextureBlendMode(VXTEXTUREBLEND_MODULATEALPHA);


Using Textures

The class CKTexture is used to describe textures. They can be loaded from a variety of formats, depending on the readers installed. The standard readers provided so far support JPG, BMP, PNG, TGA, PCX and TIFF but you can create your own image readers to support other formats (see "Creating Readers" paper). The texture can also be animated, using a system of slots. To do so, you can load a bitmap in each slot, or use a movie reader. Currently only the AVI reader is provided.

Creating Textures

You can either load existing files or create procedurally the texture:

// Texture Object Creation
CKTexture* tex = (CKTexture*)context->CreateObject(CKCID_TEXTURE,"MyTexture");

// now the texture filling : 2 methods

// File Loading (in slot 0, the current and only one for this texture)
tex->LoadImage("picture.jpg",0);
// The file is searched in your open data resources and
// in the paths registered as bitmap path (see "Using Paths")

// Creating the texture and filling it procedurally

tex->Create(256,256); // warning only power of 2

// locking the system memory (to write into)

CKDWORD* data = (CKDWORD*)tex->LockSurfacePtr();

// Filling in purple

for (int y=0; y<256; ++y) {
    for (int x=0; x<256; ++x) {
        data[x+y*256] = RGBAFTOCOLOR(1.0f,0,1.0f,1.0f);

    }
}
// if the texture was already in video memory
// you need to warn that the texture has been modified for the video memory
// to be loaded back from system memory
tex->ReleaseSurfacePtr();

// Loading a movie
tex->LoadMovie("movie.avi");

Configuring Textures

Once the texture is created, you can set a transparent color (for color keying purpose) with CKTexture::SetTransparentColor. You can generate mipmaps on the texture too with CKTexture::UseMipmap. (Warning : don't forget too set the right filtering (CKMaterial::SetTextureMinMode) mode in the material associated with texture to really use the mipmaps).

Video Formats

To draw textures the video card often needs to have the texture surface in video memory. In the current implementation texture system memory format is 32 bits ARGB but the available video memory formats depend on the driver used to create the render context. The VX_PIXELFORMAT enumeration holds the most common formats. To use a specific format in video memory you can ask for the texture to try to use a desired pixel format with CKTexture::SetDesiredVideoFormat.

// Detecting if texture is in video memory
CKBOOL IsInvideo = tex->IsInVideoMemory();

// or  file is searched in your open data resources and
// in the paths registered as bitmap path (see "Using Paths")
VX_PIXELFORMAT VideoFormat = GetVideoPixelFormat();
if (VideoFormat == UNKNOWN_PF)  {
    ...// Not in video memory
}

// Unloading/reloading from video memory
tex->FreeVideoMemory();
tex->SystemToVideoMemory(Rendercontext);


Using Meshes

The mesh is the representation of the geometry of an object. There is three types of meshes:

Triangular Meshes

Creating the Mesh

Theses meshes (CKMesh) are compound of n vertices and m faces, with each faces build from 3 vertices. The mesh can be prelit or not. If it is prelit, each vertex have diffuse and specular color (specular color is simply added to the diffuse color) information attached. If not, each vertex has a normal attached, to calculate light contribution. Vertices nomals can be given when constructing the mesh or they can be calculated after with the CKMesh::BuildNormals function, based on the topology of the mesh (not always accurate though).

Here is a sample of a tetrahedron mesh creation:

// Mesh creation
CKMesh *mesh = (CKMesh *)context->CreateObject(CKCID_MESH,"MyMesh");

// Vertices
mesh->SetVertexCount(4); // we set the vertices count

VxVector v;

v.Set(0,0.0,0);
mesh->SetVertexPosition(0,&v);
v.Set(1.0,0.0,0);
mesh->SetVertexPosition(1,&v);
v.Set(1.0,0.0,1.0);
mesh->SetVertexPosition(2,&v);
v.Set(0.5,1.0,0.5);
mesh->SetVertexPosition(3,&v);

// if you want your mesh to be prelit white
for (int i=0; i<4; ++i) {
    mesh->SetVertexColor(i,RGBAFTOCOLOR(1.0f,1.0f,1.0f,1.0f));
    mesh->SetVertexSpecularColor(i,0); // No specular color needed
}

/// Faces

mesh->SetFacesCount(4);

mesh->SetFaceVertexIndex(0,0,1,2); // bottom face
mesh->SetFaceVertexIndex(1,3,2,1); // front face
mesh->SetFaceVertexIndex(2,3,0,2); // right face
mesh->SetFaceVertexIndex(3,3,1,0); // left face

// sets the same material to all the faces
CKMaterial* mat;
mesh->ApplyGlobalMaterial(mat);

// If you your mesh to be lit, we need to calulate vertices normals
mesh->BuildNormals();

Accessing mesh datas

Once the mesh created, you can feel the need to access some of its data, such as vertices positions or normals, to calulate collision response or to modify the mesh itself. You can access the data each vertex a time with the counter part of the functions saw for the mesh creation (CKMesh::GetVertexPosition, CKMesh::GetVertexNormal... ) or you can use the functions that gives you access to the insides of the mesh directly. See this example of use, snippets of the Environment Mapping building block:

DWORD nStride, uvStride; // the strides are the distance in BYTES between each normals, each positions, etc.

VxVector *normal = (VxVector*) ckmesh->GetNormalsPtr(&nStride);
Vx2DVector *uv = (Vx2DVector*) ckmesh->GetTextureCoordinatesPtr(&uvStride, channel);

if (!uv) return CKBR_OK;

VxVector normal_tmp;

int i = ckmesh->GetVertexCount();
while( i ){
    i--;
    normal_tmp = *normal;

    // Texture Coordinates calcul based on normals
    uv->x = 0.5f + normal_tmp.x*projU.x + normal_tmp.y*projU.y + normal_tmp.z*projU.z;
    uv->y = 0.5f + normal_tmp.x*projV.x + normal_tmp.y*projV.y + normal_tmp.z*projV.z;

    normal = (VxVector*)( (BYTE*)normal + nStride ); // next normal
    uv = (Vx2DVector*)( (BYTE*)uv + uvStride ); // next texture coordinates
}

Channels

One other thing to know about meshes is that you can add channels on them. Channels allows you to do multi pass rendering. Each channel is associated with one material for the faces, and one set of textre coordinates. You can for example have your meshes with its standard materials (up to one byface), then a channel of environment mapping, then a channel of shadows, etc. The order the channels are added, the order they will be rendered.

When adding a channel with CKMesh::AddChannel, you can choose to copy the texture coordinates of the mesh or not.

You can also choose if the channel must be lit or not, and you can choose the blend modes that will be used for the rendering of the channel.

Line Meshes

Meshes can have both triangles and lines.

// we assume vertices have been set (position and colors) the same way
// that for the tetrahedron above

/// Lines
mesh->SetLineCount(6);

// base
mesh->SetLine(0,0,1);
mesh->SetLine(1,0,2);
mesh->SetLine(2,2,1);

// 3 lines to the top
mesh->SetLine(3,0,3);
mesh->SetLine(4,1,3);
mesh->SetLine(5,2,3);

Patch Meshes

Patch meshes are special type of mesh build up from patches (rectangular or triangular) than can be tesselated. A CKPatchMesh derives from a CKMesh and automatically build the face data of its sub-class according to the patch information and current tesselation level. The patch mesh allow for very detailled meshes for a lesser storage on disk.


Using Render Contexts

Render Context

The render context is a class which is the gateway between CK2 and the rendering engine, most of the Vx3D. It contains all the CKRenderObjects (2D and 3D entities to be rendered) and it calls the render callbacks the user has set. Objects not in the render context won't be rendered.

Environment Settings

In the current render context, you can customize the environment of your current scene.

  • You can change the background color and texture by chnaging them in the background material. You can get it with CKRenderContext::GetBackgroundMaterial().
  • You can change the fog settings by using CKRenderContext::SetFogMode, CKRenderContext::SetFogColor, CKRenderContext::SetFogStart, CKRenderContext::SetFogEnd and CKRenderContext::SetFogDensity.
  • And finally you can change the ambient light used in the light calculation with the ambient colors of the materials by using CKRenderContext::SetAmbientLight.

Rendering Options

With the current render context, you may change some rendering options:

  • You can choose to clear the back bufer or not before each rendering, with CKRenderContext::SetClearBackground.
  • You can choose to clear the ZBufer or not before each rendering, with CKRenderContext::SetClearZBuffer.
  • You can choose if you want to render the background and/or the foreground sprites with the flags CK_RENDER_BACKGROUNDSPRITES and CK_RENDER_FOREGROUNDSPRITES with the function CKRenderContext::SetCurrentRenderOptions
  • Finally you can choose if you want to use the camera ratio for the rendering with the flag CK_RENDER_USECAMERARATIO in the same function as above.

Miscellaneous

The CKRenderContext class also provides all the tools you need to do your own rendering, using only the rasterizers. See Custom Rendering for more information.

It provides also with a set of functions to copy from and to the back buffer (CKRenderContext::CopyFromBuffer and CKRenderContext::CopyToBuffer) . This allows you to put in a texture the last rendered frame for example, or to modify with convolution matrix for example the rendered frame. Warning: the writing (CopyFromBuffer) is reasonnably fast but the reading from video memory (CopyToBuffer) is very, very slow, so be sure you absolutly need to do such a thing. DumpTo is a conveniance function which gets the content of the back buffer and save it into a bitmap file.

You can also change the size of the window with CKRenderContext::SetWindowRect and the size of the CKRenderContext::SetViewRect.

The last thing you can do with the CKRenderContext is a 2DPicking, with the function CKRenderContext::Pick or CKRenderContext::Pick2D, if you want to pick only 2D Entities.


Using Portals

Portals are connectors between two places (CKPlace), containbing several 3D Objects, used by the portal manager (in 3DTransformation) to perform Portal Culling. Portals are just 3D Entities with a special flags, CK_3DENTITY_PORTAL.

Setting Up Portals

This is a sample code where you set up a portal between two places:

// Portal creation
CK3dEntity* portal = (CK3dEntity*)context->CreateObject(CKCID_3DENTITY,"MyPortal");
// Flag this entity as a portal
portal->SetFlags(portal->GetFlags() | CK_3DENTITY_PORTAL);

// two existing places, containing objects
CKPlace* placeA,*placeB,*placeC;

// place setting up

placeA->AddPortal(placeB,portal);
// this means you can see placeB from placeA thru portal
// this is symetrical (you can see placeA from placeB too)

// full vision
placeA->AddPortal(placeC);
// this means that when you see placeA, you see placeC too (and symetrical)

// if you want to deactivate a portal (door closed for example)
currentscene->DeActivate(portal); // warning don't put scripts on the portal
// or they won't be executing either

Starting The Portal Culling

// Getting the Portal Manager

PortalsManager* pm = (PortalsManager*)behcontext.Context->GetManagerByGuid(PORTALS_MANAGER_GUID);

// Activating Portal Culling system
pm->Activate(TRUE);

// Places unvisible are hidden

// Deactivating the Portal Culling system
pm->Activate(FALSE); // All the places are then shown


Custom Rendering

There are several ways in CK2 to do yourself rendering. You can set render callbacks on the CK3dEntity, the CK2dEntity, the CKRenderContext and use the render functions of the managers you create. In any case, the code inside the callback remains sensibly the same.

The rendering is done by calling a member function of the current CKRenderContext (which is always given as the first callback argument), CKRenderContext::DrawPrimitive. Let's explain the arguments of this function:

  • VXPRIMITIVETYPE pType: It is the type and the format of the primitive you want to draw. The different type will be explained in detail later.
  • CKWORD* indices: This is the list of indices of vertices to use for the primitives to draw.
  • int indexcount: number of indices in the list given above.
  • VxDrawPrimitiveData* data: The topological information of the primitives to draw. This structure contains vertices (in the form of VxVector4, for homogeneous informations, if already projected) , UVs (VxUV), colors (CKDWORD for diffuse and CKDWORD for speculars), normals (VxVector) and rendering flags (CKRST_DPFLAGS). All the informations in the data structure are not stricly necessarily, depending on the flags: If you render lit primitives, you will need to provide diffuse colors but not vertives normals. If you have no texture, you need to provide UVs either.

Instead of creating your own VxDrawPrimitveData structure and filling and allocating its relevant members, you can use CKRenderContext::GetDrawPrimitiveStructure and CKRenderContext::GetDrawPrimitiveIndices. These two functions will allocate (reusing memory already allocated by previous calls if it fits) the necessary members for you. Look the sample below to see an example of use.

Before calling CKRenderContext::DrawPrimitive, if you want the render engine to project your vertices, you have to provide up to three matrices. One world transformation matrix (CKRenderContext::SetWorldTransformationMatrix) which is the referential in which your vertices will be given. If you work in the world, just set an identity matrix. The other two are the matrixes of the camera (one is the view matrix, the other is the projection matrix). Most of the time you don't have to touch them, unless you want to provides special effects (render an object with a different field of view as the others in the scene, for example).

Primitive types

Here is the list of available primitives types:

  • VX_POINTLIST: to draw a set of points. The indices are of no use.
  • VX_LINELIST: to draw a list of lines. The indices are given by group of two. So if you want to draw n lines, you have to provide 2*n indices. Here is the drawing of a line list, with the indices {0,1,1,2,2,3,4,5} given.

  • VX_LINESTRIP: draw a sequence of lines. If you provide indices, the first index given is the start vertex of the sequence, then each subsequent index is the next vertex of the line. If you provide no indices, a strip of (n-1) lines, starting at vertex 0 and ending at vertex (n-1) will be created. Here is a drawing of a line strip, with no indices given:

  • VX_TRIANGLELIST: draw a list of triangles, with no connexity information provided. It is the general case of drawing primitives. The indices are given by group of three. To draw n triangles, you have to give 3*n indices.

  • VX_TRIANGLESTRIP: draw a sequence of connected triangles, which share two vertices with the last traingle drawn. If you provide indices, the first 3 indices given are the first triangle drawn, then, each index given draw a new triangle. If you provide no indices, a strip of (n-2) triangles is drawn. Here is the drawing of a triangle strip with the indices {0,1,2,3,4,5,5,6,3,7,1,8} given (two null triangles ({4,5,5} and {5,5,6}) are given to allow a swap):

  • VX_TRIANGLEFAN: draw a sequence of connected triangles sharing the same center vertex and a vretex from the last triangle drawn. If you provide indices, the first index given is the center vertex. If you provide no indices, a fan of (n-2) triangles is drawn. Here is the drawing of a fan with no indices given.

Render States

One other important things to know about the custom rendering is setting the render states. It's the render state that will allow you to draw transparent triangles, change the culling from clockwise to inverse clockwise, change the texture stages, change the fill mode, change the fog, the stencil modes, use clipping planes... Everything you can set in a CKMaterial, and even more is editable with render states. For a complete list of render states, and their effects, see VXRENDERSTATETYPE.

Sample

Here is a sample of code drawing a semi-transparent textured 2D rectangle, on top of all the screen. This code is derived from the code in Visuals/FX/PlanarFilter.

    VxDrawPrimitiveData* data = rc->GetDrawPrimitiveStructure(CKRST_DP_VCT,4);

    // Set Render States
    rc->SetTexture(tex); // the texture
    rc->SetState(VXRENDERSTATE_ALPHABLENDENABLE, TRUE); // allow transparency
    rc->SetState(VXRENDERSTATE_ZWRITEENABLE , FALSE); // do not write in the ZBuffer
    rc->SetTextureStageState(CKRST_TSS_TEXTUREMAPBLEND,VXTEXTUREBLEND_MODULATEALPHA); //modulate the color with the texture

    // Positions
    VxRect rect;
    rc->GetViewRect(rect);

    ((VxVector4*)data->PositionPtr)[0].x = rect.left;
    ((VxVector4*)data->PositionPtr)[0].y = rect.top;
    ((VxVector4*)data->PositionPtr)[0].z = 0.0f;
    ((VxVector4*)data->PositionPtr)[0].w = 1.0f;
    ((VxVector4*)data->PositionPtr)[1].x = rect.right;
    ((VxVector4*)data->PositionPtr)[1].y = rect.top;
    ((VxVector4*)data->PositionPtr)[1].z = 0.0f;
    ((VxVector4*)data->PositionPtr)[1].w = 1.0f;
    ((VxVector4*)data->PositionPtr)[2].x = rect.right;
    ((VxVector4*)data->PositionPtr)[2].y = rect.bottom;
    ((VxVector4*)data->PositionPtr)[2].z = 0.0f;
    ((VxVector4*)data->PositionPtr)[2].w = 1.0f;
    ((VxVector4*)data->PositionPtr)[3].x = rect.left;
    ((VxVector4*)data->PositionPtr)[3].y = rect.bottom;
    ((VxVector4*)data->PositionPtr)[3].z = 0.0f;
    ((VxVector4*)data->PositionPtr)[3].w = 1.0f;

    // Colors
    DWORD* colors = (DWORD*)data->ColorPtr;
    DWORD col = RGBAFTOCOLOR(1.0f,1.0f,1.0f,0.5f);
    VxFillStructure(4,colors,data->ColorStride,4,&col);

    // UVs
    VxUV* uvs = (VxUV*)data->TexCoordPtr;
    uvs->u = 0.0f;uvs->v = 0.0f;uvs = (VxUV*)((BYTE*)uvs + data->TexCoordStride);
    uvs->u = 1.0f;uvs->v = 0.0f;uvs = (VxUV*)((BYTE*)uvs + data->TexCoordStride);
    uvs->u = 1.0f;uvs->v = 1.0f;uvs = (VxUV*)((BYTE*)uvs + data->TexCoordStride);
    uvs->u = 0.0f;uvs->v = 1.0f;uvs = (VxUV*)((BYTE*)uvs + data->TexCoordStride);

    // indices
    CKWORD* indices = rc->GetDrawPrimitiveIndices(4);
    indices[0] = 0;
    indices[1] = 1;
    indices[2] = 2;
    indices[3] = 3;

    // the drawing itself
    rc->DrawPrimitive( VX_TRIANGLEFAN, indices, 4, data );


Using Sounds

With Virtools SDK, you can use two sort of sounds : the 2D sounds, or background sounds, which can only be changed in volume and pan, and the 3D sounds, which can be placed anywhere in space, and can have effects like doppler added.

Creating Sounds

To create a sound, you first have to create a CKWaveSound object:

CKWaveSound* ws = (CKWaveSound*)context->CreateObject(CKCID_WAVESOUND,"MySound");

Then, you have to really create the sound source, either by giving a filename or giving a wave format and a size (corresponding to the length of the sound):

// From a sound file
ws->Create(TRUE,"sound.wav"); // True for file streaming

// OR
// Allocate memory
// we create a wave format for a PCM sound in 11Khz, 16 bits, Mono

CKWaveFormat wf;
wf.wFormatTag 		= CKWAVE_FORMAT_PCM; // Only format supported for the moment
wf.nChannels		= 1; // Mono (stereo = 2)
wf.nSamplesPerSec 	= 11025; // 11 Khz (could also be 8000, 22050, 44100)
wf.nAvgBytesPerSec	= 22050; //  = blockalign*samplespersec
wf.nBlockAlign		= 2; // Bytes per sample = channels*bitspersample/8
wf.wBitsPerSample	= 16; // 16 bits (could be 8 bits)
wf.cbSize			= 0; // useless member

// Allocating a sound of 3 seconds
ws->Create(CK_WAVESOUND_BACKGROUND,&wf,22050*3);

// You can then fill your buffer with sound data you get from...
void* sounddata;
int size;

ws->WriteData(sounddata,size);

// OR

// You can lock the sound buffer and write in it
void* buf1,*buf2;
int buf1size,buf2size;

ws->Lock(0,0,&buf1,&buf1size,&buf2,&buf2size,CK_WAVESOUND_LOCKENTIREBUFFER);
// we now have to write buf1size data in buf1 and possibly buf2size data in buf2
// buf2size is non null only if we pass thru the end of the buffer, and it cycles
// back to start.

Once you've created the sound, you can still change its type, from 3D to 2D or from 2D to 3D:

ws->SetType(CK_WAVESOUND_POINT);

Warning: dependeing on the implementation, changing the type of a sound can lead to a buffer deletion and reallocation, so you may have to refill it with your custom data. If the sound was linked to a sound file, it will be reloaded automatically.

Playing and Modifying Sounds

To play the sound, simply trigger it with CKWaveSound::Play (you can use a fade in). You can then stop it with CKWaveSound::Stop (you can use a fade out) or simply pause it (CKWaveSound::Pause, CKWaveSound::Resume). You can set it looping with CKWaveSound::SetLoopMode.

There are many ways to modify sounds: In 2D, you can change the volume (CKWaveSound::SetGain), the panning (CKWaveSound::SetPan) and the pitch (CKWaveSound::SetPitch). In 3D, you can change the pitch too, plus you can change the distance factor (CKWaveSound::SetDistanceFactor), the doppler factor (CKWaveSound::SetDopplerFactor) and spatial information (CKWaveSound::PositionSound, CKWaveSound::SetVelocity, CKWaveSound::SetMinMaxDistance, etc.). You can also set the sound to be head relative, meaning it will follow the current viewpoint (usefull for background sounds in 3D).

Using Sound Instances

The last thing you can do with sounds is triggering a sound event, temporarily. This is called a Sound Minion, and it is triggered with the CKWaveSound::PlayMinion function. You can trigger a minion either in 2D or in 3D (then you can attach it to an entity, it will follow it alone). The minion kills itself when it has finished playing, so you can't do minions looping.

// 3D
CKWaveSound* explosion;

// suppose an explosion occurs at the position pos
VxVector pos;

explosion->PlayMinion(FALSE,NULL,&pos); // 3D
CKWaveSound* bonus;

// suppose your score goes beyond 1000 : let's play a sound
bonus->PlayMinion(TRUE); // In 2D


Creating New Plugins

Virtools allows you to create your own Plugin to add customized elements like Building Blocks, Managers, Parameters, etc... For an overview of Virtools Plugin System, see the Virtools Plugins Overview chapter.

To create your own Plugin, you first need to create a new DLL project that you will link with CK2.lib and VxMath.lib.This DLL may contain several Plugins of different types. Below, we describe the main file of this project as well as the exported functions.

For specific creation procedure (Behavior Plugin, parameters, Media Plugins, Manager Plugins,...), see the correponding documentation : Creating Building Blocks, Creation of Media Plugins, Creating Extensions Plugins, Creation of a New Manager.

Main File

This file usually takes the name of the DLL, and contains all the exported functions that Virtools will access, at least CKGetPluginInfo() and CKGetPluginInfoCount(). Note that the CKGetPluginInfoCount function can be omitted. If so, the Plugin Manager will consider that there is only one (1) Plugin inside the DLL.

CKPluginInfo

A CKPluginInfo is a descriptor of a Virtools plugin. It gives the following informations.

  • m_GUID : Identity number of the plugin,
  • m_Extension : This field is only usefull for the Media Plugins. It gives the extension of the files it reads,
  • m_Description : descriptive name,
  • m_Author : author's name,
  • m_Summary : descriptive summary,
  • m_Version : version number,
  • m_InitInstanceFct : pointer on the InitInstance() function if needed, ie if there are some initialisation or registration to do. This function is described below,
  • m_Type : type of plugin : behaviors, managers, parameters...
  • m_ExitInstanceFct : pointer on the ExitInstance() function if needed, ie if there are some deletion or unregistration to do. This function is described below,

You need to create one descriptor for each Plugin that you want to create. For Behavior and Extensions Plugins, only one descriptor is useful in each DLL that you create, except if you explicitely want to define several Behavior Plugins in the same dll, but is is usually not advised.

Your GUID should be unique, new CKGUID can be generated using the CKGuidGen application (located in the Dev/Sdk/Utils directory). If two Plugins having the same GUID are found, only the Plugin with the highest version number is taken into account.

struct CKPluginInfo {
    CKGUID				m_GUID;
    CKFileExtension		m_Extension;
    XString				m_Description;
    XString				m_Author;
    XString				m_Summary;
    DWORD				m_Version;
    CK_INITINSTANCEFCT		m_InitInstanceFct;
    CK_PLUGIN_TYPE			m_Type;
    CK_EXITINSTANCEFCT		m_ExitInstanceFct;
}

enum CK_PLUGIN_TYPE {
    CKPLUGIN_BITMAP_READER,		// Bitmap Media Plugin
    CKPLUGIN_SOUND_READER,		// Sound Media Plugin
    CKPLUGIN_MODEL_READER,		// 3D Model Media Plugin
    CKPLUGIN_MANAGER_DLL,		// The plugin implements a Manager
    CKPLUGIN_BEHAVIOR_DLL,		// The plugin implements one or more behaviors
    CKPLUGIN_RENDERENGINE_DLL,	// Render Engine
    CKPLUGIN_MOVIE_READER,		// Movie Media Plugin
    CKPLUGIN_EXTENSION_DLL,		// Generic extension (definition of new parameter types or operations for ex.)
};

CKGetPluginInfo()

This function takes an index and returns a corresponding plugin desciptor. For instance, here, we define a manager and several behaviors.

CKPluginInfo* CKGetPluginInfo(int Index)
{
    CKPluginInfo g_PluginInfo;

    switch (Index)
    {
        case (0) :
            {
                g_PluginInfo.m_Author		= "Virtools";
                g_PluginInfo.m_Description	= "Interface Behaviors for Virtools";
                g_PluginInfo.m_Extension	= "";
                g_PluginInfo.m_Type			= CKPLUGIN_BEHAVIOR_DLL;
                g_PluginInfo.m_Version			= 0x000001;
                g_PluginInfo.m_InitInstanceFct	= NULL;
                g_PluginInfo.m_ExitInstanceFct	= NULL;
                g_PluginInfo.m_GUID			= INTERFACE_BEHAVIOR;
                g_PluginInfo.m_Summary		= "Interface Behaviors";
            }
            break;

        case (1) :
            {
                g_PluginInfo.m_Author		= "Virtools";
                g_PluginInfo.m_Description	= "Interface Behaviors Manager for Virtools";
                g_PluginInfo.m_Extension	= "";
                g_PluginInfo.m_Type			= CKPLUGIN_MANAGER_DLL;
                g_PluginInfo.m_Version		= 0x000001;
                g_PluginInfo.m_InitInstanceFct	= InitInstance;
                g_PluginInfo.m_ExitInstanceFct	= ExitInstance;
                g_PluginInfo.m_GUID			= FONT_MANAGER_GUID;
                g_PluginInfo.m_Summary		= "Interface Behaviors Manager";
            }
            break;

        default:
            break;
    }

    return &g_PluginInfo;
}

CKGetPluginInfoCount()

This function simply returns the number of plugins info present in the file. In our example, two.

int CKGetPluginInfoCount() { return 2; }

InitInstance()

This function is useful only when you have some initialisation or registration to do. Each plugin that needs this function to be called must store a pointer on it in the m_InitInstanceFct atttribute of its description. In particular, you will create your Manager Plugin instance and register new parameter types or new Parameters Operations in this function.

CKERROR InitInstance(CKContext* context)
{
    // Create the Font Manager
    new CKFontManager(context);

    // Register new parameter types
    CKParameterManager* pm = context->GetParameterManager();
    pm->RegisterNewEnum(CKPGUID_ALIGNMENT,"Alignment","Top-Left=5,Top=4,Top-Right=6,Left=1,Center=0,Right=2,Bottom-Left=9,Bottom=8,Bottom-Right=10");
    pm->RegisterNewFlags(CKPGUID_FONTPROPERTIES,"","Gradient=1,Shadow=2,EnableLighting=4,DisableFilter=8");
    pm->RegisterNewFlags(CKPGUID_TEXTPROPERTIES,"","Screen Proportionnal=1,Background=2,Clip To Dimension=4,Resize Verticaly=8,Resize Horizontaly=16,WordWrap=32,Justified=64,Compiled=128");

    return CK_OK;
}

For information on the creation of Parameter Operations or Parameter Types, see the Creating Extensions Plugins chapter. For more information how to define a manager class, see the Creation of a New Manager chapter.

ExitInstance()

This function is usefull only when you have some deletion or unregistration to do. Each plugin that need this function to be called must store a pointer on it in the m_ExitInstanceFct attribute of its description. In particular, if you have created a manager or registered new parameter types, you need to delete and unregister them here to free the system memory.

CKERROR ExitInstance(CKContext* context)
{
    // Delete the font Manager
    CKFontManager* man=(CKFontManager*)context->GetManagerByGuid(FONT_MANAGER_GUID);
    if (man) delete man;

    // Unregistering the user defined parameter types
    CKParameterManager* pm = context->GetParameterManager();
    pm->UnRegisterParameterType(CKPGUID_ALIGNMENT);
    pm->UnRegisterParameterType(CKPGUID_FONTPROPERTIES);
    pm->UnRegisterParameterType(CKPGUID_TEXTPROPERTIES);

    return CK_OK;
}

RegisterBehaviorDeclarations()

If you give a plugin descriptor concerning a Behavior Plugin, Virtools will automatically look for this function. In it, you must store all your new behaviors in a XObjectDeclarationArray list that will be handle by the system. For more informations on the creation procedure of new behaviors, see Creating Building Blocks.

void RegisterBehaviorDeclarations(XObjectDeclarationArray *reg)
{
    // Register MyBehavior
    RegisterBehavior(reg,FillMyBehaviorDecl);
}

CKGetReader()

If you give a plugin descriptor concerning a Media Plugin, Virtools will automatically look for this function. Therefore, you need to define it and to export it from the dll. It must return an instance of a Media Plugin class corresponding to the pos-th plugin description. More clearly, if you have defined a Media Plugin description at the fourth position only, this function will send a non void result only for pos=4. However, you should define specific dll for your Media Plugins. It is not recommented to melt Media Plugins, behaviors...

For more informations about the creation procedure of Media Plugins, see the Creation of Media Plugins documentation.

CKDataReader* CKGetReader(int pos)
{
    return new Mp3Reader;
}

Exporting Functions

Virtools needs to have access to some of the functions described previously. Therefore, they have to be exported from the DLL. To do so, simply create a Module Definition File (.DEF) called DLLName.def, as shown below. This one will automatically be recognized by LINK that will export the given functions as entry points of the DLL, ie they will be able to be called by other executables after having loaded the DLL.

Your DLL must export at least CKGetPluginInfo() and CKGetPluginInfoCount(). Then, if it contains a Behavior Plugin, it must also export RegisterVirtoolsExtensions() and finally, if it contains a Media Plugin description, it must export CKGetReader(). Example for interface behaviors : interface.def.

; Interface.def : Declares the module parameters for the DLL.

LIBRARY      "Interface"
DESCRIPTION  'Interface Windows Dynamic Link Library'

EXPORTS
    ; Explicit exports can go here
    RegisterBehaviorDeclarations
    CKGetPluginInfo
    CKGetPluginInfoCount

See Also

Virtools Plugins Overview, Creating Building Blocks, Creation of Media Plugins, Creating Extensions Plugins, Creation of a New Manager


Creating Extensions Plugins

Extensions Plugins are Plugins that are not of any other type (Manager, Behavior, etc..). These Plugins are used to define Parameter Types and Parameter Operations, even though Parameters Types and Parameters Operations can be declared in any other type of Plugin.

Extensions Plugin Registration

The Extensions Plugins, like the other Plugins, live in a DLL, register with the CKGetPluginInfo function, by returning a CKPluginInfo structure describing the Plugin. The CKPluginInfo should have a Type equal to CKPLUGIN_EXTENSION_DLL. See the Creating New Plugins chapter for information on generic Plugin creation information.

In the case of Extensions Plugin, Virtools only calls the functions declared in the m_InitInstanceFct and m_ExitInstanceFct slots of the CKPluginInfo structure.

Note that in other types of Plugins, these 2 functions are also called, if defined.

Whether or not you write an Extensions Plugin or another kind of Plugin, these functions are the place where you should register and unregister new Parameter Operations and new Parameter Types.

See also

Creating New Plugins, Creation of new Parameter Operations, Creating New Parameter Types


Creating New Parameter Types

A parameter is a CKObject that gives access to a specific type of data in Virtools. A deeper description of the way to use parameters is done in the Using Parameters documentation. Many predefined Parameter Types are provided by Virtools, but you may want to define your own type of parameter, for instance a custom structure or a 5x5 matrix. This chapter will describe how to create a new parameter type step by step by using examples and how to customize them (specific editing dialog, hierarchy...).

CKParameterTypeDesc

Every parameter type, even the Virtools natives one are described by a CKParameterTypeDesc structure. We will describe here only the attributes you may use for your systems. After, we will see more precisely the type of function used.

  • GUID : identity number (set by the registering function) :use CKGUIDGen.exe or CKContext::GetSecureGUID to generate one
  • DeriveFrom : identity number of the parent type parameter. You may inherit from a simple type as int, float... for compatibility purposes and so that operation available on the parent type are also available on your parameters
  • TypeName : name of the type (set by the registering function),
  • DefaultSize : size that will be allocated to a parameter of this type. This attribut is important only when you want to create your own type of parameter and not a flag, enum or structure. Then, the system reserve this memory amount for every parameter created with this type to store its data, for example an integer has
  • CreateDefaultFunction : pointer on a function called each a new parameter is created. You can define your own function to insure specific actions at creation time,
  • DeleteFunction : pointer on a function called each time a parameter is deleted. You can define your own function to insure specific actions at deletion time,
  • CheckFunction : pointer on a function called by the system each time it needs to check the validity of the parameter. For instance, on an array, such a function should check the validity of every element,
  • SaveLoadFunction : pointer on a function called each time the composition is loaded and saved,
  • StringFunction : pointer on a function called each time a parameter value is given through a string. If you define this function, you may after initialize or directly set the value of your parameter through a string as for Vectors, Colors...
  • UICreatorFunction : pointer on a function that returns the WIN_HANDLE on a dialog used for editing the parameter. By setting a pointer on your own function here, your can use your own dialog box for your parameters. This pointer needs be set if you want ot be able to edit your customized type parameter in the interface.
  • dwFlags : flag giving some informations about your parameter (hidden or variable size parameter).
struct CKParameterTypeDesc{
        CKGUID Guid;
        CKGUID DerivedFrom;
        XString	TypeName;
        int DefaultSize;
        CK_PARAMETERCREATEDEFAULTFUNCTION	CreateDefaultFunction;
        CK_PARAMETERDELETEFUNCTION			DeleteFunction;
        CK_PARAMETERCHECKFUNCTION			CheckFunction;
        CK_PARAMETERSAVELOADFUNCTION		SaveLoadFunction;
        CK_PARAMETERCOPYFUNCTION			CopyFunction;
        CK_PARAMETERSTRINGFUNCTION			StringFunction;
        CK_PARAMETERUICREATORFUNCTION		UICreatorFunction;
        CKDWORD dwFlags;
}

CreateDefaultFunction

In all the following functions, you will see it gets a CKParameter as parameter. It is the basic type of parameter. Indeed, a CKParameterIn takes its value from its data source which is a CKParameter (CKParameterOut and a CKParameterLocal inherits from it) (cf "Using Parameters"). Therefore, the data of any parameter is in fact stored in a CKParameter and you will be able to access your parameter value through it. The default creation function is called each time the user create a parameter of your type. For instance, you may use it to initialize some variables. As example, you will find the code for the creation the Virtools natives matrix and object array parameters.

CKERROR (*CK_PARAMETERCREATEDEFAULTFUNCTION) (CKParameter *param);

// Matrix creator : Initialize to the identity matrix
CKERROR CKMatrixCreator(CKParameter *param)
{
    if (!param) return CKERR_INVALIDPARAMETER;
    VxMatrix Mat = VxMatrix::Identity();
    param->SetValue(Mat);
    return CK_OK;
}

// Object array creator : create the array pointer
CKERROR CKObjectArrayCreator(CKParameter *param)
{
    XObjectArray *array = new XObjectArray;
    if(!array) return CKERR_OUTOFMEMORY;
    param->SetValue((void *)&array);
    return CK_OK;
}

DeleteFunction

This function is called each time a parameter of the type is deleted. As the creation function, it receives a CKParameter containing your data. In this function, you must do all the deletion needed by your structure to avoid memory leaks. As example, the code of the deletion function of the the Virtools native object array parameter is given here.

void (*CK_PARAMETERDELETEFUNCTION) (CKParameter *param);

// Object array desctructor
void CKObjectArrayDestructor(CKParameter *param)
{
    XObjectArray *array=NULL;
    param->GetValue((void *)&array);
    delete array;
    array = NULL;
    param->SetValue(&array);
}

CheckFunction

Each time an object is deleted in Virtools, this function is called for every parameter. You then need to check that all the variables used in your parameter are still valid, if one is none, you must remove it to avoid a system error. It receives a CKParameter containing your data. As example, the code of the deletion function of the the Virtools native object array parameter is given here.

void (*CK_PARAMETERCHECKFUNCTION) (CKParameter *param);

void CKObjectArrayCheck(CKParameter *param)
{
    XObjectArray *array=NULL;
    param->GetValue((void *)&array);
    array->Check(param->m_Context);
}

SaveLoadFunction

This function is called each time the user load or save a composition. It gets a CKParameterOut containing your data, a CKStateChunk saving format (see the "Saving and Loading" documentation for more informations on this format) and a flag set as true if the user is loading a composition and at false if the user is saving it. If the user is loading a composition, you must transfer you data from the chuck to the parameter and reverse if the user is saving the composition.

void (*CK_PARAMETERSAVELOADFUNCTION) (CKParameter *param,CKStateChunk **chunk,CKBOOL load);

// Object array load/save function
void CKObjectArraySaver(CKParameter *param,CKStateChunk **chunk,CKBOOL load)
{
    XObjectArray *array=NULL;
    param->GetValue((void *)&array);
    if (load)
    {
        CKStateChunk *mychunk=*chunk;
        if (mychunk && mychunk->SeekIdentifier(CKCID_OBJECTARRAY)) {
            array->Load(mychunk);
        }
    } else	{
        if (array) {
            CKStateChunk *mychunk=new CKStateChunk(CKCID_OBJECTARRAY,NULL);
            mychunk->StartWrite();
            mychunk->WriteIdentifier(CKCID_OBJECTARRAY);
            array->Save(mychunk);
            mychunk->CloseChunk();
            *chunk=mychunk;
        } else *chunk = NULL;
    }
}

StringFunction

The StringFunction allows you to set the value of a parameter through a string. For instance, when you create a parameter of type Matrix, you may give its default value as "[1,0,0,0][0,1,0,0][0,0,1,0][0,0,0,1]" and you don't need to create explicitely a default matrix. Each time the value of a parameter is set or retrieve through a string, this function is called. It gets a CKParameterOut containing your data, a CKSTRING representing the parameter value as a string and a flag set as true if we setting the string value and at false if we are retrieving the string value. If we are reading the string value, you must update the parameter value according to the string and return 0, otherwise, you must copy the corresponding string in ValueString and return the length of the string + 1 for the "\0" character.

This function is also very important for the ActiveX communication. Indeed, to communicate with other programs with ActiveX, you may give a value to an attribut which is a parameter, but you can give it only with a string. Therefore, if no StringFunction is defined, the system won't be able to retrieve this attribute. Therefore, you have to implement this function for your types if you know you will send them to other programs through ActiveX.

int	(*CK_PARAMETERSTRINGFUNCTION) (CKParameter *param,CKSTRING ValueString,CKBOOL ReadFromString);

// Matrix string conversion function
int CKMatrixStringFunc (CKParameter *p,CKSTRING value,CKBOOL ReadFrom)
{
    if (!p) return 0;
    VxMatrix mat;
    if (ReadFrom) {
        if (value) {
            sscanf(value,"[%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]",
                &mat[0][0],&mat[0][1],&mat[0][2],&mat[0][3],
                &mat[1][0],&mat[1][1],&mat[1][2],&mat[1][3],
                &mat[2][0],&mat[2][1],&mat[2][2],&mat[2][3],
                &mat[3][0],&mat[3][1],&mat[3][2],&mat[3][3]);
            p->SetValue(mat);
            return 0;
        }
    } else {
        CKCHAR temp[256];
        p->GetValue(mat,FALSE);
        sprintf(temp,"[%g,%g,%g,%g][%g,%g,%g,%g][%g,%g,%g,%g][%g,%g,%g,%g]",
            mat[0][0],mat[0][1],mat[0][2],mat[0][3],
            mat[1][0],mat[1][1],mat[1][2],mat[1][3],
            mat[2][0],mat[2][1],mat[2][2],mat[2][3],
            mat[3][0],mat[3][1],mat[3][2],mat[3][3]);
        if (value) strcpy(value,temp);
        return strlen(temp)+1;
    }
    return 0;
}

UICreatorFunction

This function is called each time the editing dialog of the parameter is open to ask the user to give its value. It gets a CKParameter containing your data, the WIN_HANDLE of the parent window of the dialog and a CKRECT which is usualy not used. The function must create the dialog, design it, set the current value of the parameter in it and return its WIN_HANDLE. As the dialog you will create are usual windows dialog, they won't follow Virtools's design. See also the Adding a Dialog Box for Edition chapter. No example function is given here, for more informations on the way to create a new dialog on Windows, refer directly to the MSDN documentation.

WIN_HANDLE (*CK_PARAMETERUICREATORFUNCTION) (CKParameter *param,WIN_HANDLE ParentWindow,CKRECT *rect);

Registering a Customized Type

The creation of Parameter Types, like the creation of Parameter Operations, is typically done in Extensions Plugins, but it can be done in any kind of Plugin. It is a usual practice to define new Parameter Types and Operations along with Managers and associated behaviors. See the Creating Extensions Plugins chapter for details on Extensions Plugin registration.

In all cases, the functions m_InitInstanceFct and m_ExitInstanceFct of the CKPluginInfo are used to register and unregister the new Parameter Operations. Let's suppose, for the rest of this chapter that these functions are called InitInstance and ExitInstance.

When your plugin dll is loaded, it calls the InitInstance() function where you need to get the parameter manager and to register all the new parameters in this manager. They are then stored in the system and available. To register or unregister a new customized parameter type, you must use the following functions.

CKERROR RegisterParameterType(CKParameterTypeDesc *param_type);
The following example shows how to create, define and register the matrix, the object array and the vector parameter types. The undescribed field of CKParameterTypeDesc should always have their default values.

CKERROR InitInstance(CKContext* context)
{
    CKParameterManager* pm = context->GetParameterManager();

    CKParameterTypeDesc poa;
    poa.Guid=CKPGUID_OBJECTARRAY;
    poa.DerivedFrom=CKGUID(0,0);
    poa.TypeName="Collection";
    poa.DefaultSize=4;
    poa.CreateDefaultFunction	= CKObjectArrayCreator;
    poa.DeleteFunction			= CKObjectArrayDestructor;
    poa.SaveLoadFunction		= CKObjectArraySaver;
    poa.CheckFunction			= CKObjectArrayCheck;
    poa.StringFunction=NULL;
    poa.UICreatorFunction=NULL;

    CKParameterTypeDesc pmatrix;
    pmatrix.Guid=CKPGUID_MATRIX;
    pmatrix.DerivedFrom=CKGUID(0,0);
    pmatrix.TypeName="Matrix";
    pmatrix.DefaultSize=64;
    pmatrix.CreateDefaultFunction	= CKMatrixCreator;
    pmatrix.StringFunction			= CKMatrixStringFunc;
    pmatrix.UICreatorFunction		= CKMatrixUIFunc;

    pm->RegisterParameterType(&poa);
    pm->RegisterParameterType(&pmatrix);

     return CK_OK;
}

Registering Flags, Enums and Structures

You frequently use parameters like enumerations or structure : in the the following example shows how to register the three special types of parameter. A better description on the functions used will be given with each type explanation below.

CKERROR InitInstance(CKContext* context)
{
    CKParameterManager* pm = context->GetParameterManager();

    #define GUID_EXAMPLEENUM CKGUID(0x6e165eb5,0x398a5e99)
    #define GUID_EXAMPLEFLAGS CKGUID(0x6b037719,0x53e0802)
    #define GUID_EXAMPLESTRUCT CKGUID(0x30001cf9,0x573c53a4)

    pm->RegisterNewFlags(GUID_EXAMPLEFLAGS,"Example Flags","NoUse=1,ReallyNoUse=2,AbsolutelyNoUse=4");
    pm->RegisterNewEnum	(GUID_EXAMPLEENUM,"Example Enumeration","Use level 1=1,Use level 2=2,Use level 3=3");
    // Equivalent to
    // enum ExampleEnum {
    // 		UseLevel1 = 1,
    //		UseLevel2 = 2,
    //		UseLevel3 = 3,
    // };
    pm->RegisterNewStructure(GUID_EXAMPLESTRUCT,"ExampleStructure","Point,Direction",CKPGUID_VECTOR,CKPGUID_VECTOR);
    // Equivalent to
    // struct ExampleStructure {
    // 		VxVector Point;
    //		VxVector Direction;
    // };

     return CK_OK;
}

Unregistering a Parameter Type

When your plugin dll is unloaded, it calls ExitInstance() where you need to unregister the new types you've registered in the parameter manager to free the system memory and especially if you had given function pointers that will become invalid. Afterwards, these types are no more available. Every type of parameter is unloaded with the UnRegisterParameterType() function.

CKERROR ExitInstance(CKContext* context)
{
    CKParameterManager* pm = context->GetParameterManager();

    pm->UnRegisterParameterType(CKPGUID_OBJECTARRAY);
    pm->UnRegisterParameterType(CKPGUID_MATRIX);
    pm->UnRegisterParameterType(GUID_EXAMPLEENUM);
    pm->UnRegisterParameterType(GUID_EXAMPLEFLAGS);
    pm->UnRegisterParameterType(GUID_EXAMPLESTRUCT);

    return CK_OK;
}

Hiding Types

Every flag, enumeration or structure you create is visible in Virtools. This means that each time the interface of Virtools asks for the type of a parameter, the new created types are given among the native ones. It is not always suitable. To avoid this, you can decide to hide some or all the parameters you've created by adding a flag to your type. All behavior are hidden with the following method :

  • Retrieve the pointer to your type description through the parameter manager,
  • Add the CKPARAMETERTYPE_HIDDEN flag to it.

Lets create and hide three parameters :

CKERROR InitInstance(CKContext* context)
{
    CKParameterManager* pm = context->GetParameterManager();

    // Registration
    #define GUID_EXAMPLEENUM CKGUID(0x6e165eb5,0x398a5e99)
    #define GUID_EXAMPLEFLAGS CKGUID(0x6b037719,0x53e0802)
    #define GUID_EXAMPLESTRUCT CKGUID(0x30001cf9,0x573c53a4)

    pm->RegisterNewFlags(GUID_EXAMPLEFLAGS,"Example Flags","NoUse=1,ReallyNoUse=2,AbsolutelyNoUse=4");
    pm->RegisterNewEnum(GUID_EXAMPLEENUM,"Example Enumeration","Use level 1=1,Use level 2=75,Use level 3=421");
    pm->RegisterNewStructure(GUID_EXAMPLESTRUCT,"ExampleStructure","Point,Direction",CKPGUID_VECTOR,CKPGUID_VECTOR);

    // Hiding
    CKParameterTypeDesc* param_type;
    param_type = pm->GetParameterTypeDescription(GUID_EXAMPLEENUM);
    if (param_type) param_type->dwFlags|=CKPARAMETERTYPE_HIDDEN;
    param_type = pm->GetParameterTypeDescription(GUID_EXAMPLEFLAGS);
    if (param_type) param_type->dwFlags|=CKPARAMETERTYPE_HIDDEN;
    param_type = pm->GetParameterTypeDescription(GUID_EXAMPLESTRUCT);
    if (param_type) param_type->dwFlags|=CKPARAMETERTYPE_HIDDEN;

    return CK_OK;
}

Several flags are available for the parameters. Most of them simply define the type of the parameter and are set by default through the registration function. But you can also precise that the parameter is of variable size when the size of the buffer stored by the parameter may change. we'll give here only the more usual flags.

CKPARAMETERTYPE_VARIABLESIZE
CKPARAMETERTYPE_HIDDEN

Defining New Parameters with New Types

Once you've registered new type, you probably want to use them in your behaviors to define parameters. To do so, in the creation function of your behavior, you simply need to define your in, out or local parameter with the GUID you've given to your type with the following method :

  • recall the guid DWORD you've given to your type with the CKDEFINEGUID function,
  • create your in, local, out parameters and settings with their default value. This one must be given throught the field value for a new enumeration, through the fields'names for a new flags, you can define several fields as true by default for a flag.
#define GUID_EXAMPLEFLAGS CKDEFINEGUID(0x6b037719,0x53e0802)
#define GUID_EXAMPLESTRUCT CKDEFINEGUID(0x30001cf9,0x573c53a4)
#define GUID_EXAMPLEENUM CKDEFINEGUID(0x6e165eb5,0x398a5e99)

// CKBehaviorPrototype **pproto
proto->DeclareInParameter("Use Level", GUID_EXAMPLEENUM,"75");
proto->DeclareInParameter("Line", GUID_EXAMPLESTRUCT);
proto->DeclareSetting("Use Flags:", GUID_EXAMPLEFLAGS, "NoUse,ReallyNoUse");

Creating and Using Flags, Enums and Structures Types

Flags

A flag is a set of boolean fields that is usually used in the settings of a behavior to define its current options. It can, for instance, tell which input or output parameters are useful as it is done for the "Particles System" or the "Collision Detection".

You register a new flag by using the RegisterNewFlags() function and giving the following parameters :

  • the flag's GUID that you can generate by using the "CKGUID Generator" given with Virtools,
  • the flag's name that will be displayed on the interface,
  • the field's names that will also be displayed in the interface and their values that must be the successive power of 2. As the flag is stored as a DWORD (32-bit unsigned integer), you can't have more than 32 fields in your flag.

You can change the definition of your flag's fields after its creation by calling ChangeFlagsDeclaration() and giving the new flag's fields'names and values.

CKERROR RegisterNewFlags(CKGUID FlagsGuid,CKSTRING FlagsName,CKSTRING FlagsData);
CKERROR ChangeFlagsDeclaration(CKGUID FlagsGuid,CKSTRING FlagsData);

A good example for using flags is the implementation of the "Statistics" behavior of "Visuals". In our previous examples, we have created a setting with flag called "Example Falgs" with three fields. Here is a good method to test the different values returned by the flag using bit to bit AND operation.

#define EF_NU		0x00000001
#define EF_RNU		0x00000002
#define EF_ANU		0x00000004

DWORD Flag;

beh->GetLocalParameterValue(1,&Flag);
if (Flag & EF_NU)
    {...};
if (Flag & EF_RNU)
    {...};
if (Flag & EF_ANU)
    {...};

Enums

An enumeration is a set of possible choices for a variable. It is usually used to give a choice to the user.

To register a new enumeration, you must use the RegisterNewEnum() function and give the following parameters as for the flags :

  • the enumeration's GUID,
  • the enumeration's name,
  • the possible choices names and their values that can be any integer value. But each name must have a unique identity value.

As for the flags, you can change your enumeration afterward by calling ChangeEnumDeclaration() and giving the new choices and values.

CKERROR RegisterNewEnum(CKGUID EnumGuid,CKSTRING EnumName,char *EnumData);
CKERROR ChangeEnumDeclaration(CKGUID EnumGuid,CKSTRING EnumData);

An enumeration simply returns a an integer value you will use to check the user's choice. In our previous examples, we have created an input parameter with the "Example Enum" type. Here is a method to test the user's choice using a switch operation.

//CKBehavior *beh
int level;
beh->GetInputParameterValue(0,&level);
switch (level)
{
    case (15) :
        {...};
    case (75) :
        {...};
    case (421):
        {...};
    break;
}

Structures

The Virtools structures are equivalent to C structures. They are usually used to integrate new parameters types in Virtools. You can for example define a type line which would be composed of two vectors, one for a point of the line and one for a direction vector. Then, you can add your own behaviors or parameter operations for this line type.

Structures are as simple to register as flags or enumerations, but they are more delicate to retrieve. To register a new structure, call RegisterNewStructure() with the following parameters:

  • the structure's GUID,
  • the structure's name,
  • the structure's field's names,
  • the structure's field's types.
CKERROR RegisterNewStructure(CKGUID StructGuid,CKSTRING StructName,CKSTRING Structdata,...);
CKERROR RegisterNewStructure(CKGUID StructGuid,CKSTRING StructName,char *StructData,XArray& ListGuid);

Structures are more delicate to use. To retrieve the fields of your structure, you'll need first to get the pointer on the parameter that has this structure type. It can be either an input, output or local parameter. In our example, it has been defined as an input parameter. Once you have the parameter, you must get the pointer on it. Then, you manually get the object through the context of each field which are CKParameterOut of type VxVector in the case the fields where created as vectors. Having this output parameters, you can read or write their values by using GetValue or SetValue.

CKParameterIn* MyParameter = beh->GetInputParameter(1);

CK_ID* IDArray = (CK_ID *) MyParameter->GetReadDataPtr();
VxVector A,B;

if (IDArray)
{
    CKParameterOut * TA = (CKParameterOut *)ckcontext->GetObject(IDArray[0]);
    CKParameterOut * TB = (CKParameterOut *)ckcontext->GetObject(IDArray[1]);
    TA->GetValue(&A);
    TB->GetValue(&B);
}


Creation of new Parameter Operations

Parameter operations are little behavioral blocks, containing one CKParameterOut and up to two CKParameterIn, which are evaluated only when another parameter operation or a building block asks for its output parameter value. The evaluation consist in the call of a function, which fills out the output parameter, using the input parameters, if any.

This is how a parameter operations is represented in the Schematic Editor of the Virtools application :

Creating a Parameter Operation

The creation of Parameter Operations, like the creation of Parameter Types, is typically done in Extensions Plugins, but it can be done in any kind of Plugin. It is a usual practice to define new Parameter Types and Operations along with Managers and associated behaviors. See the Creating Extensions Plugins chapter for details on Extensions Plugin registration.

In all cases, the functions m_InitInstanceFct and m_ExitInstanceFct of the CKPluginInfo are used to register and unregister the new Parameter Operations. Let's suppose, for the rest of this chapter that these functions are called InitInstance and ExitInstance.

Registering

The InitInstance function is where you register your Parameter Operation:

First you need to register the operation name with a unique GUID. You can reuse one of the many already registered names (see ParameterOperations.cpp) or create a new one. In our case, let's create a new one:

#define CKOGUID_MODULO	CKDEFINEGUID(0x2a3f4ab6,0x753a4a20)

CKERROR InitInstance(CKContext* context)
{
    CKParameterManager* ParameterManager = context->GetParameterManager();
    ParameterManager->RegisterOperationType(CKOGUID_MODULO,"Modulo");
    // ...

Then you need to register the operation itself:

    ParameterManager->RegisterOperationFunction(CKOGUID_MODULO,CKPGUID_INT,CKPGUID_INT,CKPGUID_INT,CKIntModuloIntInt);

The first parameter is the GUID of the operation name, next is the type of the parameter out, next the types of the two parameter in, then the function itself. If you want to use only one CKParameterIn, or even no CKParameterIn at all, use the CKPGUID_NONE as parameter GUID for the unwanted CKParameterIn.

Note : The order the CKParameterIn will be given to your function is the same that when you've registered it. If the parameter operation is constructed with its CKParameterIn swapped (CKPGUID_OBJECT-CKPGUID_STRING instead of CKPGUID_STRING-CKPGUID_OBJECT for example), the CKParameterIn will be automatically swapped before being given to your function, so you have nothing to do.

The InitiInstance function always return CK_OK.

Unregistering

Unregistration is done in the ExistInstance() function, using the CKParameterManager unregistration functions :

CKERROR ExitInstance(CKContext* context)
{
    CKParameterManager* ParameterManager = context->GetParameterManager();
    ParameterManager->UnRegisterOperationFunction(CKOGUID_MODULO,CKPGUID_INT,CKPGUID_INT,CKPGUID_INT);
// ...

Defining the C++ function implementing the Parameter Operation

The Parameter Operation mainly consists in a C++ function. It is called when needed by Virtools, and must have been registered using the above method. The function must be of the form:

void MyParamOp(CKContext *ctx, CKParameterOut *res, CKParameterIn *p1, CKParameterIn *p2);

The first parameter is the context, the second parameter is a pointer on the CKParameterOut of the parameter operation, the two last are the two CKParameterIn of the parameter operations. If your function is only interested by one input, just use p1.

Here is a sample of a parameter operation function, the modulo parameter operation:

void CKIntModuloIntInt	(CKContext* context,CKParameterOut *res,CKParameterIn *p1,CKParameterIn *p2)
{
    // first input parameter : dividend
    int i1 = 0;
    p1->GetValue(&i1);
    // second input parameter : divisor
    int i2 = 0;
    p2->GetValue(&i2);
    if (i2) {
        // The operation itself !
        int m = i1 % i2;
        // output parameter : modulo (remainder of the division)
        res->SetValue(&m);
    }
}


Creation of Media Plugins

Overview

Media Plugins software components used by CK2 to import and export external media. For a general description of Plugins in Virtools, see the Virtools Plugins Overview chapter.

The Virtools SDK contains the sources of all the Virtools Media Plugins. It is a good idea, if you want to write your own custom Media Plugin, to start from a standard Virtools Plugin and modify it in order to meet your needs. (Do not forget to change the GUID). See the Available Source Code chapter for more details.

As all Virtools Plugins, the Media Plugins live in a DLL that implement a specific protocol. For more information on how to set up your compiler in order to compile your Plugin DLL, see the Compilation Settings chapter.

In order for Virtools executables (applications, Standalone Player, Web Player, Xtra,...) to take your plugin into account, it should be placed in one of the directories that the executable takes into account for Plugins. For the Media Plugins, the usual place is the Plugins directory located besides the Virtools executable, even though any other directory parsed at startup would work also. The Virtools executable parses and registers the Plugins at startup, so if you debug your Plugin, you should restart the Virtools executable in order for your changes to be taken into account.

Plugin Registration

The Media Plugin registration follows the usual rules of CKGetPluginInfo and CKGetPluginInfoCount. See the Creating New Plugins chapter for details on these functions. The Plugin Type of a Media Plugin is one of:

  • CKPLUGIN_BITMAP_READER, for Bitmaps
  • CKPLUGIN_SOUND_READER, for Sound
  • CKPLUGIN_MODEL_READER, for 3D models
  • CKPLUGIN_MOVIE_READER, for Movies

The extension of the CKPluginInfo is especially important for Media Plugins. The choice of which Media Plugin is used for which kind of data is done on the extension. If two Media Plugins declare managing the same extension, the first plugin found will be used. If you want your Plugin to manage more than one extension, it should declare as many CKPluginInfo structures as there are extensions. Then the CKGetReader function can return instances of the same Plugin class to process all the extension types.

Here is an example, for one Media Plugin :

#define MEDIA_PLUGINS_COUNT 1

// a specific version number for your plugin

#define MY_MEDIA_VERSION		0x0000001

// a specific GUID for your Plugin
#define MY_MEDIA_GUID		CKGUID(0x01234567,0x01234567)

CKPluginInfo g_piInfo[READER_COUNT]={CKPluginInfo(
    MY_MEDIA_GUID,				// GUID: your Plugin GUID
    "Tif",						// extension : file extension for dialogs
    "My Special Media Format",	// description: human-readable
    "My Company",				// author
    "TIFF",						// summary: for UI
    MY_MEDIA_VERSION,			// version : lastest version always used
    NULL,						// InitInstanceFct : called on context initialization
    NULL,						// ExitInstanceFct : called on context closing
    CKPLUGIN_BITMAP_READER)		// Type : of the Plugin (here, an Image Media Plugin)
};

int CKGetPluginInfoCount()
{
    return MEDIA_PLUGINS_COUNT;
}
CKPluginInfo* CKGetPluginInfo(int index)
{
    return &g_piInfo[0];
}

CKDataReader derivation

Providing a Plugin Instance

When the Virtools executable needs to call the Media Plugin, for example when importing a file media type that the plugin knows about, it asks the DLL for a instance of a class derived from the CKDataReader class. All data conversion will be done by this instance. When the data has been processed, the instance is deleted. There is one instance if the CKDataReader per data buffer or file.

The Media Plugin thus should implement one special function, called CKGetReader. It takes one argument, which is the index of the Plugin, corresponding to the index in the array returned by the CKGetPluginInfo function. Here is the CKGetReady function corresponding to our example :

CKDataReader *CKGetReader(int pos) {
    switch(pos){
        case 0:
            return new MyMediaPlugin();	// where MyMediaPlugin is a class derived from CKDataReader (see below)
            break;
    }
    return NULL;
}

Dont forget to export the CKGetReader function from your DLL. See the Creating New Plugins chapter for details on how to export functions.

Defining your CKDataReader class derivation

The CKDataReader defines a set of virtual functions that should be defined in derived classes. There are four predefined classes deriveated from CKDataReader in CK2, one for each Media Plugin type, which all define other virtual functions. These classes and their functions are described in the corresponding chapters.

  • For Bitmaps (type CKPLUGIN_BITMAP_READER), the class is CKBitmapReader. See the Creation of Bitmap Media Plugins chapter for details.
  • For Movies (type CKPLUGIN_MOVIE_READER), the class is CKMovieReader. See the Creation of Movie Media Plugins chapter for details.
  • For Sounds (type CKPLUGIN_SOUND_READER), the class is CKSoundReader. See the Creation of Sound Media Plugins chapter for details.
  • For Models (type CKPLUGIN_MODEL_READER), the class is CKModelReader. See the Creation of Model Media Plugins chapter for details.

Your specific Media Plugin class should derive from one of these four classes. For the example above, we would have:

class MyMediaPlugin : public CKBitmapReader
{ ...
}

As the four specialized classes derive from CKDataReader, your class should implement or override the CKDataReader classes. Here we examine the CKDataReader virtual functions and their meaning.

  • CKDataReader::Release()

    The Release function should delete the Reader instance itself. The Plugin Manager does not delete the Plugin instance itself, as it did not create it. It only calls Release on the instance itself, leaving to it the responsability of deleting itself. In our example, we would have:
void MyMediaPlugin::Release() {
    delete this;
}

  • CKPluginInfo* CKDataReader::GetReaderInfo()

    The GetReaderInfo function should return the CKPluginInfo structure corresponding to the Plugin. It is the same structure that was returned by CKGetPluginInfo.

  • int GetOptionsCount()

    The GetOptionsCount function should return the (potentially zero) number of format options that this Media type accepts. This is only implemented for the CKBitmapReader class. See the Creation of Bitmap Media Plugins chapter for details.

  • CKSTRING GetOptionDescription(int i)

    The GetOptionDescription function returns the format option of the given index (corresponding to the GetOptionsCount function). This is only implemented for the CKBitmapReader class. See the Creation of Bitmap Media Plugins chapter for details.

  • CK_DATAREADER_FLAGS GetFlags()

    The GetFlags function should return a bitfield flag corresponding to all the capabilities of the Plugin relatively to loading, saving, memory storage, streaming, etc... The return flags should be an OR-ed combination of the CK_DATAREADER_FLAGS flags:
typedef enum CK_DATAREADER_FLAGS {
    CK_DATAREADER_FILELOAD = 0x00000001, 		// This Plugin can load data from file
    CK_DATAREADER_FILESAVE = 0x00000002, 		// This Plugin can save data to file
    CK_DATAREADER_MEMORYLOAD = 0x00000004, 		// This Plugin can load data from memory
    CK_DATAREADER_MEMORYSAVE = 0x00000008,	   	// This Plugin can save data to memory
    CK_DATAREADER_STREAMFILE = 0x00000010,	   	// This Plugin can stream data from file
    CK_DATAREADER_STREAMURL = 0x00000020,	   	// This Plugin can stream data from URL
} CK_DATAREADER_FLAGS;


Creation of Bitmap Media Plugins

A Bitmap Media Plugin is a subtype of the Media Plugins, for importing and exporting image data to and from Virtools. For general information on Media Plugins, see the Creation of Media Plugins chapter. It contains important information that should be mastered to read this curent chapter.

The SDK contains the source code of a few Bitmap Media Plugins. This is a good start if you want to start the development of your own Bitmap Media Plugin. See the Available Source Code chapter for more details.

Basically, a Movie Media Plugin fills up its CKPluginInfo structure with a Type equal to CKPLUGIN_BITMAP_READER and an extension corresponding to the type of file extension that it manages.

A Bitmap Media Plugin should be an instance of a class derived from the CKBitmapReader class. So, it should override the CKBitmapReader virtual functions, in addition to the CKDataReader virtual functions. These bitmap-specific functions relate to format options, file reading and writing, memory management, etc..

The CKBitmapProperties structure

All these functions rely on a data structure that describes the image data that is being processed. The Virtools library relies on this description to display the image and to manage its data inside the Virtools files. This description is centered around a VxImageDescEx, which describes the image bits organization. The VxImageDescEx allows for many different image bits organizations, but not all. If your data cannot conform to a VxImageDescEx, for example if it is compressed, you should transform it (using the ReadFile and ReadMemory functions - see below) so that you can create a VxImageDescEx that describes it.

Here is the standard CKBitmapProperties structure :

struct CKBitmapProperties {
    // Ctor
    CKBitmapProperties() {
        m_Size = sizeof(CKBitmapProperties);
        m_Data = NULL;
    };
// Size of this structure
    int m_Size;

// Reader Data
    CKGUID m_ReaderGuid;
    CKFileExtension	   m_Ext;

// Image Format
    VxImageDescEx m_Format;

// Image Data
    void* m_Data;
};

The m_Size should contain the size of the structure, which is sizeof(CKBitmapProperties) by default, but could be bigger if you define your own members in your own property description structure deriving from CKBitmapProperties (see below).

The m_ReaderGuid and m_Ext members should contain information on the Plugin instance itself.

The two other members describe the image data itself. The m_Format describes the format of the data, and is used by Virtools to know how to access the bitmap bits (number of planes, bits per pixel, etc...) See the VxImageDescEx structure definition for details. The m_Data points to the image data itself.

Deriving from CKBitmapProperties

If the standard CKBitmapProperties is not sufficient for fully describing your bitmap data, like, for example if you want to store some options, you can create your own structure, but it should derive from the CKBitmapProperties structure. For example:

struct MyBitmapProperties : public CKBitmapProperties {
    // Ctor
    MyBitmapProperties()
    {
        m_Size = sizeof(MyBitmapProperties);
        m_Compression = 1;
    }
    // One Additional Member
    int m_Compression;
};

In this structure, we define our additional property, which defines the compression that is used. The semantics of this member is internal to the Media Plugin, and can potentially be displayed in the user interface through the Media Options functions (see below).

We see that the Constructor initializes the m_Size slot so that it reflects the size of the new structure.

Deriving from the CKBitmapReader class

As we have seen in the Creation of Media Plugins chapter, a Bitmap Media Plugin is a derivation of the CKBitmapReader class. In addition to the functions of the CKDataReader, there are a certain number of functions that this derived class should override, in order to do their job.

Reading Data

  • int ReadFile(char* name,CKBitmapProperties**ppBitmapProperties)

    Should read a file and fill up the ppBitmapProperties with a pointer to the properties of the read image. Should return an error code, 0 (zero) if no error. The name argument is the full path of the file, and can be an URL. Called only if the GetFlags returns the CK_DATAREADER_FILELOAD flag.

  • int ReadMemory(void* memory,int size,CKBitmapProperties**ppBitmapProperties)

    Should read data from memory, and fill up the ppBitmapProperties with a pointer to the properties of the read image. Should return an error code, 0 (zero) if no error. The memory argument is the pointer to the memory from which to start reading, and size is the size of the buffer. Called only if the GetFlags returns the CK_DATAREADER_MEMORYLOAD flag.

  • int ReadASynchronousFile(char* name,CKBitmapProperties**ppBitmapProperties)

    Not Yet Supported.

Writing Data

  • int SaveFile(char* name,CKBitmapProperties*pBitmapProperties)

    Should save the image described by pBitmapProperties to the file whose path is name. Should create the file if needed. Should return the number of written bytes if success. Is called only if the CK_DATAREADER_FILESAVE flag is returned by the GetFalgs function.

  • int SaveMemory(void** pMemory,CKBitmapProperties*pBitmapProperties)

    Should allocate memory and write the image corresponding to the pBitmapProperties argument into this memory, and fill the pMemory pointer with a pointer to the newly created memory. Should return the number of written bytes if success. This is typically called by Virtools when storing an image inside a cmo file. The data should be stored in the external format, and the Media Plugin is called to do the conversion (for example to compress the data). Is called only if the CK_DATAREADER_MEMORYSAVE flag is returned by the GetFalgs function. When the caller is done with this memory, it calls the ReleaseMemory function, so that the Plugin releases the memory.

Misc Access

  • void ReleaseMemory(void* memory)

    Should release the given memory, that was previously returned by the SaveMemory function.

  • CKBOOL IsAlphaSaved(CKBitmapProperties*)

    Should return TRUE if the Plugin has the capacity to save the alpha channel in the file (or in memory) if SaveFile (or SaveMemory) is called. If not, the alpha information will be stored by the system in another way.

  • void GetBitmapDefaultProperties(CKBitmapProperties**ppBitmapProperties)

    Should fill up the ppBitmapProperties with a pointer to the default bitmap properties. This can be used to initialize the user interface with default values for example.

  • void SetBitmapDefaultProperties(CKBitmapProperties*pBitmapProperties)

    Should remember that the given properties will be the default properties for this plugin.

The Media Options

As we have see in the Creation of Media Plugins chapter, there are two functions that define the optional Options that can be presented to the user, in the user interface, in order for him to choose variations of the Bitmap format. For example, these Options appear in the Preference panel when choosing which compression level should be used for jpeg compression.

The Plugin declares the options that it can handle by overriding the following functions, and having them returns the desired values :

  • int GetOptionsCount()

    The GetOptionsCount function should return the (potentially zero) number of format options that this Bitmap type accepts. All these options will be presented to the user in the user interface.

  • CKSTRING GetOptionDescription(int i)

    The GetOptionDescription function returns the format option description of the given index (corresponding to the GetOptionsCount function). This format description is a string, which should give information to Virtools on how to present the Option to the user, and on how to interpret the chosen option to fill the Bitmap Properties. When the user chooses one of the option possibilities, a value is stored in the corresponding Bitmap Properties slot : Option 0 (zero) fills the slot just following the CKBitmapProperties size, Option 1 fills the next slot, etc.. All slots are the same size as a DWORD.

Example :

int MyMediaPlugin::GetOptionsCount() {return 1; }

CKSTRING MyMediaPlugin::GetOptionDescription(int i)
{
    switch(i) {
        case 0:
            return "Enum:Compression:None=1,High=2";
            break;
    }
    return "";
}

Option Description Format

The format of one option description is the following : "<TypeOfValue>:<TextToDisplay>" or "<TypeOfValue>:<TextToDisplay>:<PotentialValues>", where:

  • <TypeOfValue> is a string corresponding to a Virtools Parameter Type description, for example, "Percentage", "Integer","Float", etc.. ( "Enum", "Flag" are special settings documented below).
  • <TextToDisplay> is the text that will be displayed in the user interface, for example "What format subtype do you want ?"
  • the <PotentialValues> part is only present if the type of value is Flags or Enum, and it depends on the type of value. It defines both what will be displayed in the UI, and when the user chooses some option, what value will be stored in the Properties.
    • Flags : PotentialValues is of the form "CheckBox1=Value1,CheckBox2=Value2,...,CheckBoxN=ValueN". The Flags option displays a checkboxes group (any number of checkbox can be checked by the user). CheckBoxI is the string that is displayed in front of checkbox number I. ValueI is the value that is OR-ed in order to obtain the final value that is used to fill up the Property slot corresponding to this Option. Example : "Flags:Options:Optimize=1,Grayscale=2,BaseLine=4". The "Options" string will be displayed, followed by three checkboxes, "Optimize", "Grayscale" and "Baseline". If Optimize and Baseline are checked by the user, the value 1^4 = 5 will be used as a property value.
    • Enum : PotentialValues is of the form "RadioButton1=Value1,RadioButton2=Value2,...,RadioButtonN=ValueN". The Enum options displays a radiobuttons group (only one radiobutton in the group may be checked by the user). RadioButtonI is the string that will be displayed in front of the Ith radio button. ValueI is the value that will be stored in the Properties structure if the corresponding RadioButton is checked. Example : "Enum:Compression Method:None=1,Macintosh RLE=32773". The string "Compression Method" is displayed, with two radio buttons, "None" and "Macintosh RLE". If the user chooses the "None" radiobutton, the integer value 1 is stored in the property slot.
    • In the case where the type of value is "Percentage" or "Integer", it is the integer value specified by the user that is stored in the properties.

Examples of option description formats :

  • "Integer:Compression Level(1-100)"
  • "Flags:Options:Optimize=1,Grayscale=4,Baseline=8"
  • "Enum:Compression Method:None=1,Macintosh RLE=32773"
  • "Enum:Bit Depth:16 bit=16,24 bit=24,32 bit=32,Greyscale=64"
  • "Boolean:Run Length Encoding"


Creation of Model Media Plugins

A Model Media Plugin is a subtype of the Media Plugins, for importing and exporting 3D models to and from Virtools. For general information on Media Plugins, see the Creation of Media Plugins chapter. It contains important information that should be mastered to read this current chapter.

The SDK contains the source code of the 3DS Max Model Media Plugin. This is a good start if you want to start the development of your own Model Media Plugin. See the Available Source Code chapter for more details.

Basically, a Model Media Plugin fills up its CKPluginInfo structure with a Type equal to CKPLUGIN_MODEL_READER and an extension corresponding to the type of file extension that it manages.

A Model Media Plugin should be an instance of a class derived from the CKModelReader class. So, it should override the CKModelReader virtual functions, in addition to the CKDataReader virtual functions.

These model-specific functions manage the transformation of model data into Virtools objects, and vice versa. A model file is supposed to contain geometry data and/or animations data. The idea is that, when loading a model file, Model Media Plugins creates Virtools objects corresponding to this data, like CKAnimation, CKMesh, CKCharacter, etc... Also when saving a set of Virtools objects, the Model Media Plugin is supposed to save into the file its own objects corresponding to the Virtools objects that are passed to it.

The Model Loader may implement only loading or saving. In all cases, it should declare its capacities using the GetFlags function. See the Creation of Media Plugins chapter for details.

CKERROR Load(CKContext* Context,CKSTRING FileName,CKObjectArray *ReadObjects,CKDWORD LoadFlags,CKCharacter *Character=NULL)

The Load function should load the model data from the specified file, which path is the argument Filename, and create Virtools objects. The Filename argument may be an url, in which case the Plugin should manage the downloading of the url. See the VxURLDownloadToCacheFile helper function.

The Virtools objects should be created in the given context, using the context object creation function CreateObject. All the created objects should also be added to the given ReadObjects array.

The LoadFlags defines various important options on how to create the objects. The LoadFlags is a bitfield resulting of the OR-ing of CK_LOAD_FLAGS flags:

typedef enum CK_LOAD_FLAGS {
    CK_LOAD_DEFAULT =3,				// Load animations and geometry
    CK_LOAD_ANIMATION =1, 			// Load animations
    CK_LOAD_GEOMETRY =2, 			// Load geometry
    CK_LOAD_ASCHARACTER =4, 		// Load all the objects as being part of a character that should be created
    CK_LOAD_DODIALOG =8, 			// Check object name unicity and warm the user with a dialog box
    CK_LOAD_AS_DYNAMIC_OBJECT =16, 	// Objects loaded from this file may be deleted at run-time or are temporary
    // The other Flags are never used.

} CK_LOAD_FLAGS;

The CK_LOAD_ANIMATION flag means that the Plugin should create Virtools objects for the animations contained in the file (CKAnimation). The CK_LOAD_GEOMETRY flag means that the Plugin should create Virtools objects for the geometry data contained in the file (CKMesh, etc..). If both flags are set (equivalent to the CK_LOAD_DEFAULT flag), both animations and geometry data should be taken into account.

In the case when the CK_LOAD_ANIMATION flag is set, the Character argument has a meaning : if it is set, all the CKAnimation instances created by the Load function should be added to this character, using the CKCharacter::AddAnimation function. If the Character is NULL (default value), the CKAnimation instances should not be attached to any character, and Virtools will do it itself, using the following heuristic: each animation will be attached to the character that has the same name as the animation. If no such character is found, the animation is discarded.

The CK_LOAD_ASCHARACTER flag means that the Plugin should create one character (CKCharacter instance) and attach all the loaded objects (geometry and/or animations) to this character. The created character should be added to the ReadObjects array.

The CK_LOAD_DODIALOG flag means that the Plugin should check object name unicity, and ask the user for a choice when a conflict is found. The Plugin does not have to manage the user interface itself, as it can just set the CKContext::CreateObject argument Options to CK_OBJECTCREATION_ASK when creating the objects.

The CK_LOAD_AS_DYNAMIC_OBJECT flag means that all the objects crated should be set a dynamic objects. This is done easily by setting the CKContext::CreateObject argument Options to CK_OBJECTCREATION_DYNAMIC.

CKERROR Save(CKContext* Context,CKSTRING Filename,CKObjectArray *ToSaveObjects,CKDWORD SaveFlags)

The Save function should write a file containing model data corresponding to the given Virtools objects. The file full path is specified by the Filename argument. If the file does not exist, it should be created. If the file exists, it should be replaced.

The ToSaveObjects array contains the Virtools objects that should be saved in the file. All these objects belong to the give context.

The SaveFlags specify options on what and how to save. It is a bitfield Or-ing of CK_LOAD_FLAGS flags. (See above). Only the three first values (CK_LOAD_ANIMATION, CK_LOAD_GEOMETRY, or CK_LOAD_DEFAULT) are possible, and are self-explanatory.


Creation of Movie Media Plugins

A Movie Media Plugin is a subtype of the Media Plugins, for importing movie data to Virtools. For general information on Media Plugins, see the Creation of Media Plugins chapter. It contains important information that should be mastered to read this current chapter.

The SDK contains the source code of the AVI Movie Media Plugin. This is a good start if you want to start the development of your own Movie Media Plugin. See the Available Source Code chapter for more details.

Basically, a Movie Media Plugin fills up its CKPluginInfo structure with a Type equal to CKPLUGIN_MOVIE_READER and an extension corresponding to the type of file extension that it manages.

A Movie Media Plugin should be an instance of a class derived from the CKMovieReader class. So, this class should override the CKMovieReader virtual functions, in addition to the CKDataReader virtual functions. These movie-specific functions relate to file streaming, movie length, etc..

The CKMovieProperties structure

All these functions rely on a data structure that describes the movie data that is being processed. The Virtools library relies on this description to display the movie. This description is centered around a VxImageDescEx, which describes the image bits organization of one movie frame. The VxImageDescEx allows for many different image bits organizations, but not all. If your image data cannot conform to a VxImageDescEx, for example if it is compressed, you should transform it (when implementing the ReadFrame function - see below) so that you can create a VxImageDescEx that describes it.

Here is the standard CKMovieProperties structure :

struct CKMovieProperties {
    // Ctor
    CKMovieProperties() {
        m_Size = sizeof(CKMovieProperties);
        m_Data = NULL;
    };
    int m_Size;

    // Reader Data
    CKGUID m_ReaderGuid;
    CKFileExtension	   m_Ext;

    // Image Format
    VxImageDescEx m_Format;

    // Image Data
    void* m_Data;
};

The structure is very similar to the CKBitmapProperties structure, in form and in semantics. Please refer to the Creation of Bitmap Media Plugins chapter for details on this structure and how to derive from it.

Deriving from the CKMovieReader class

As we have seen in the Creation of Media Plugins chapter, a Movie Media Plugin is a derivation of the CKMovieReader class. In addition to the functions of the CKDataReader, the new Movie Media Plugin class should override the CKMovieReader class, which are :

  • CKERROR OpenFile(char* name)

    Should open the file which path is the name argument. Should return 0 (zero) if no error.

  • CKERROR OpenMemory(char* name)

    Not yet supported.

  • CKERROR OpenAsynchronousFile(char* name)

    Not yet supported.

  • int GetMovieFrameCount()

    Should returns the number of frames that the movie contains. Should return 0 (zero) if no movie was loaded.

  • int GetMovieLength()

    Should returns the number of milliseconds that the movie lasts. Should return 0 (zero) if no movie was loaded.

  • CKERROR ReadFrame(int frameNum, CKMovieProperties**ppMovieProperties)

    Should fill up ppMovieProperties with a pointer to a description of an image, which should corresponds to the frame number frameNum of the movie. Returns 0 (zero) if no error. Frame 0 (zero) is the first frame.


Creation of Sound Media Plugins

A Sound Media Plugin is a subtype of the Media Plugins, for importing sound data streams into Virtools. For general information on Media Plugins, see the Creation of Media Plugins chapter. It contains important information that should be mastered to read this current chapter.

The SDK contains the source code of a Sound Media Plugin. This is a good start if you want to start the development of your own Sound Media Plugin. See the Available Source Code chapter for more details.

Basically, a Sound Media Plugin fills up its CKPluginInfo structure with a Type equal to CKPLUGIN_SOUND_READER and an extension corresponding to the type of file extension that it manages.

A Sound Media Plugin should be an instance of a class derived from the CKSoundReader class. So this class should override the CKSoundReader virtual functions in addition to the CKDataReader virtual functions. These sound-specific functions relate to file and url streaming, sound format, etc..

The basic idea is that Virtools expects a Sound Media Plugin to manage its own internal buffer(s) in order to read and decode data from the sound source. The sound source is either a local file or an url. In both cases, the sound is supposed to be streamed by the Sound Media Plugin, and decoded in memory, chunk by chunk in order to provide a usable sound bytes stream.

Virtools initializes one Sound Media Plugin instance per sound. It does so by creating an instance and immediately calling the OpenFile function:

CKERROR OpenFile(char *path)

The path argument is the full path to a sound file or url. The OpenFile function should open the corresponding file or stream on the url, and be ready to analyze the sound format, and respond to the GetWaveFormat, GetDuration, and GetDataSize functions. The Sound Plugin instance should close its file, if necessary, in its Destructor function. No "CloseFile" function exists, and the instance will not be called with another file : one sound file, one Sound Plugin instance.

If the given path is an url and that the Sound Media Plugin does not support urls, it should return an error code (like CKSOUND_READER_GENERICERR). If this function returns an error, the Sound Plugin instance will not be called any more and will be deleted.

Specific error code are defined for Sound Media Plugins, which are :

typedef enum CK_SOUNDREADER_ERROR {
    CKSOUND_READER_OK = 0,
    CKSOUND_READER_GENERICERR = -1,
    CKSOUND_READER_EOF = -2,
    CKSOUND_READER_NO_DATA_READY = -3
} CK_SOUNDREADER_ERROR;

CKERROR GetWaveFormat(CKWaveFormat *wfe)

The wfe argument points to an allocated CKWaveFormat structure, which the GetWaveFormat function should fill up with a description of the sound format

that the Sound Media Plugin provides. The CKWaveFormat structure is inspired from the standard Windows WAVEFORMATEX structure:

struct CKWaveFormat {
    WORD wFormatTag;
    WORD nChannels;
    DWORD nSamplesPerSec;
    DWORD nAvgBytesPerSec;
    WORD nBlockAlign;
    WORD wBitsPerSample;
    WORD cbSize;
};

This structure defines the type of sound format, the number of channels of the sound (mono = 1, stereo = 2, etc..), the number of samples per second, the average bytes per second, the number of bytes per samples, the number of bits per sample, the size of extra information data. See the WAVEFORMATEX Windows documentation for details on the CKWaveFormat structure.

int GetDuration()

int GetDataSize()

The GetDuration should return the total duration of the sound in milliseconds. The GetDataSize should returns the size of the decoded bytes stream, in bytes. This is not the size of the file, but the number of bytes that the decoded data will occupy. If this data size is smaller than a certain size, managed by Virtools, Virtools may decide to load all the sound data in memory at once, using repetitively the Decode and GetDataBuffer functions until the end of the file. Other wise, Virtools will call the Decode and GetDataBuffer when needed, while the sound is playing.

CKERROR Decode()

CKERROR GetDataBuffer(BYTE **ppBuf, int *size)

The Sound Media Plugin is supposed to manage its own cache buffer(s) for decoded sound data. The Sound is supposed to be potentially compressed in the originating stream, and Virtools is not interested in compressed sound data. The Decode function is called just before the GetDataBuffer function. The Decode function is supposed to fill up some Sound Plugin internal cache buffer with the next decoded sound data. The GetDataBuffer is then called to get access to the buffer filled up by Decode and use the data. Later on, when some more data is needed, Decode is called again, filling up some buffer (potentially overwriting the previous data), and GetDataBuffer is called to get access to newly decoded buffer. If Decode is called, the Sound Plugin should assume that the previous buffer data has been read by Virtools and can be overwritten.

In some cases, for example, if the decoded data size is too big for Virtools's buffer, the GetDataBuffer may be called many times on the same data. The buffer should remain unchanged between these calls. Only a call to the Decode function invalidates the previous buffer content.

Note that the Virtools buffers contain approximately 2 seconds of sound, so the Sound Plugin should have a size of about 1/10th of this size, so as not to provide too much data at a time to Virtools, which could yield unpredictable results. A good size is about 2/10th of seconds of sound data in the Sound Plugin cache buffer.

The GetDataBuffer, of course should fill up the *ppBuf pointer with a pointer to the internal cache buffer that was filled up by the previous Decode call, and fill up the *size integer with the length of the buffer. Note that this buffer and size may not always be the same, depending on how much data has been decoded by the previous Decode call, and depending on how many buffers the Plugin manages.

The Decode function's return values are important as they inform Virtools of the stream state. If the Decode function has reached the end of the incoming stream or file and has no more sound bytes to decode, it should return the CKSOUND_READER_EOF error code. In this case, Virtools will not call the GetDataBuffer function, and will either stop playing the sound, or restart the Sound Plugin at the beginning, if the sound is supposed to be looped. If not enough data is available for decoding, in case of streamed sound, the Decode function should return the CKSOUND_READER_NO_DATA_READY, thus informing Virtools that it may be ready in the future. Virtools tries to handle this problem gracefully, by playing silence in the meantime.

The Decode function is supposed to decode the "next" portion of incoming sound. This may be changed by the Seek function, which tells the Sound Plugin to reset its file reading cursor to an arbitrary position.

CKERROR Seek(int pos)

This function should set the Sound Plugin internal cursor to the specified position in the incoming stream. Typically, this is used to reset the position at the start of the stream. If the Sound Plugin cannot satisfy the Seek function it should return the CKSOUND_READER_GENERICERR error. Virtools will manage this error as gracefully as possible.

Finally, some functions are called by Virtools on the Sound Plugin to inform it of some events that might affect its internal functioning. The Sound Plugin is not supposed to perform any specific action in response to these calls, they are just warnings, for internal Sound Plugin optimization (like thread halting and restarting, etc...)

CKERROR Play()

Warns the Plugin that Decode is going to be called soon. Play is always called before any Decode is called.

CKERROR Stop()

Warns the Plugin that Decode is not going to be called any more (until the Play function is called again, at least). After Stop is called, only Play may be called.

CKERROR Pause()

Warns the Plugin that Decode is not going to be called any more (until the Resume function is called, at least). Pause is always followed by Resume or Stop.

CKERROR Resume()

Warns the Plugin that Decode is going to be called soon. Resume can follow only Pause, and can be followed by Decode or Stop.


Creation of a new Manager

A Manager Plugin is the other important entry point in the SDK besides Building Blocks. With it, you can obtain control when the process starts, stops, when objects are added to scene, when objects are deleted. Most of all, you can have a set of behaviors inter-communicating through a Manager.

Like all Plugins, a Manager Plugin lives in a DLL, and must declare itself. For a general information on writing Plugins, see the Creating New Plugins chapter.

Creating a Manager class

See the Using the Visual C++ AppWizard to Create a Manager chapter for more information

To create a manager, you need to derive from CKBaseManager. Then you must override the functions you're interested in, and complete the function masks for them. Here is an example of a manager:

///////////////// MyManager.h
// Example of a manager which counts the frames

#define MY_MANAGER_GUID	CKGUID(0x5da66c30,0x7a8c87c3)

class MyManager : public CKBaseManager
{
public:
    MyManager(CKContext* ctx);
    ~MyManager() {}

    // User Functions
    int GetFrameCount() {return m_FrameCount;}

    // Virtual overrides
    CKERROR OnCKReset();
    CKERROR PostProcess();

    // Valid functions mask
    CKDWORD	GetValidFunctionsMask()	{ return CKMANAGER_FUNC_OnCKReset|
                                             CKMANAGER_FUNC_PostProcess;}

protected:
    int m_FrameCount;
};

/////////////////
// MyManager.cpp

MyManager::MyManager(CKContext* ctx):CKBaseManager(ctx,MY_MANAGER_GUID,"My Manager")
{
    // Register the manager
    ctx->RegisterNewManager(this);

    m_FrameCount = 0;
}

CKERROR MyManager::OnCKReset()
{
    m_FrameCount = 0;
    return CK_OK;
}

CKERROR MyManager::PostProcess()
{
    ++m_FrameCount;
    return CK_OK;
}

If we want to be sure that our CKBaseManager::PostProcess will be called after all the CKBaseManager::PostProcess of the other managers, we have to overrides this function too:

int	GetFunctionPriority(CKMANAGER_FUNCTIONS Function)
{
    if (Function == CKMANAGER_FUNC_PostProcess) return 10000; // high priority
    return 0;
}

Once your manager is registered, you can retreive it using CKContext::GetManagerByGuid() or CKContext::GetManagerByName.

The GUID of your manager must be unique. If you use a GUID of a manager already registered, you provide in fact an alternative manager, which won't be called until being chosen as the main manager for that corresponding GUID. The name unicity is not important.

Overridable Functions

Let's parse all the functions you can override in your manager:

  • CKStateChunk* SaveData(CKFile* SavedFile)

    Allows you to save data specific to your manager. The CKFile given contains references to all objects being saved so you can create a chunk with only relevant information. If no objects interesting to your manager are saved, just return NULL.

  • CKERROR LoadData(CKStateChunk *chunk,CKFile* LoadedFile)

    This is the counterpart of the function above. If your manager has saved data in a file, the chunk it had created will be given to it when loading back this file. Once again the CKFile contains the really loaded file.

  • CKERROR PreClearAll() and CKERROR PostClearAll()

    Called at the beginning and at the end of a CKClearAll operation.

  • CKERROR PreProcess() and CKERROR PostProcess()

    Called just before and just after the behavioral execution.

  • CKERROR SequenceAddedToScene(CKScene *scn,CK_ID *objid,int count)

    CKERROR SequenceRemovedFromScene(CKScene *scn,CK_ID *objid,int count)

    Called when objects are added to or removed from a specific scene. Allow you for example to remove an object from your manager processing if it is removed from the current scene (without being actually deleted.)

  • CKERROR PreLaunchScene(CKScene* OldScene,CKScene* NewScene)

    CKERROR PostLaunchScene(CKScene* OldScene,CKScene* NewScene)

    Called before and after a new scene is launched, with the information of the old scene.

  • CKERROR OnCKInit()

    This function will be called once for a newly created manager instance. Normally called on the CKInit() call, but if your manager is registered after this call, it will be called just after registration.

  • CKERROR OnCKEnd()

    Called at the end of the session. Usefull to clean up things.

  • CKERROR OnCKReset() and CKERROR OnCKPostReset()

    Called just before and just after a CKContext::Reset().

  • CKERROR OnCKPause() and CKERROR OnCKPlay()

    Called on at the beginning of the CKContext::Pause() function and at the beginning of the CKContext::Play() function.

  • CKERROR SequenceToBeDeleted(CK_ID *objids,int count)

    Called before objects deletion. You can parse the provided list of CK_ID to check if you're interested by some objects in it, or more efficiently, you can check the objects pointers you have referenced by calling CKObject::IsToBeDeleted(), and so cut the reference if necessary.

  • CKERROR SequenceDeleted(CK_ID *objids,int count)

    Called after objects deletion. You can parse the provided list of CK_ID to see if you're interested by some objects in it, or more efficiently, you can check the objects ID you have referenced by calling CKContext::GetObject(id). If the pointer returned is NULL, the object has been deleted, so you have to remove the id reference. Warning : if you store pointers on objects, the pointers will already be invalid when this function is called : use CKBaseManager::SequenceToBeDeleted instead.

  • CKERROR PreLoad() and CKERROR PostLoad()

    Called before and after a file loading

  • CKERROR PreSave() and CKERROR PostSave()

    Called before and after a file saving. You can there remove temporary objects you have created and put in the level, but that you do not want to be saved.

  • CKERROR OnPreCopy(CKDependenciesContext& context)

    CKERROR OnPostCopy(CKDependenciesContext& context)

    Called just before and just after an object copy. In the two cases, the dependencies have already been prepared so you have access via the CKDependenciesContext to the hashtable of objects being copied. see the document Using Copy.

  • CKERROR OnPreRender(CKRenderContext* dev)

    CKERROR OnPostRender(CKRenderContext* dev)

    CKERROR OnPostSpriteRender(CKRenderContext* dev)

    These functions are sort of render callbacks, just like the one on the CKRenderContext, but these are virtuals of the managers, to simplify data transmission. See the Understanding the Render Loop chapter.

Last Note : the profiler tool in Virtools profiles the pre and postprocess functions for each manager. If you have other functions you'd like to take into account for the time taken by this manager, just use the two functions CKBaseManager::StartProfile and CKBaseManager::StopProfile, bracketting the sensitive code.

Creating the Manager instance

Your Manager instance is typically created in the InitInstance() and ExitInstance() functnios that where declared in the CKPluginInfo of your Manager Plugin. See the Creating New Plugins chapter for more information.


Using the Visual C++ wizard to create a Manager

The SDK contains a Visual C .NET 2003 wizard to help you set up the initial framework of a Behavior Plugin.

Installation

Copy the two folders vcprojects and wcwizards in your .NET visual C++ directory

\Microsoft Visual Studio .NET 2003\Vc7\

Usage

To trigger the App Wizard, in Visual C++ 7.0, select the File->New->Project menu item, and then, in the "Visual C++ Projects" directory, select the "Virtools Dev BB and Managers" item.

Specify your Project Name and your path. Note that the Project Name will also be the name of the C++ source file for the Plugin DLL (.cpp), so spaces are not recommended.

Hit OK : a custom window appears.

Choose Manager wizard.

First Step

Specifying your manager Name, GUID and events flags :

In this dialog, define the name of your manager along with the GUID it will use.

A Manager can handle a number of events (See CKBaseManager and Main Virtools Events) before and after they are launched. Check the item you want to handle.

Final step

The plugin settings

  • The first two fields let you give information about the plugin.
  • Two other fields let you give information about the author: its name and GUID. Each author should define its own GUID and use it for all the BB that (s)he creates.
  • Two last fields let you define the location of the Virtools SDK and the Virtools application executable in your file system. These information are used to set up the compilation Settings of the project.

Hit Finish, read the summary and accept or cancel to change some information. Accepting creates the project and inserts it into the current workspace. You can then edit the source files to set up your own execution function and implement your callbacks. Please refer to the rest of the documentation for specifics implementation.


Creating a Standalone Application

Introduction

The Virtools libraries are designed to be used inside external executables. All the Virtools executables are built on top of these libraries, and so can be custom executables.

The custom executable should include the needed header files, link with the Virtools libraries, and include the Virtools DLLs with the executable.

The source code of the Virtools player is provided with the SDK and is a good place to start to write your own executable using the Virtools libraries. Refer to the Available Source Code chapter.

Warning

Make sure to use the DLLs delivred in the Redist SDK folder. It is very important to use the Runtime version of VSL components, otherwise you may experience crashes.

The additionnal packs (Physics, Multiuser,...) DLLs runtime version do not make FlexLM licence check.

Main Steps

Basically, the typical structure of a Virtools executable looks like this :

  • various parts of the Virtools engine are initialized (general, Paths)
  • the context for one composition is prepared (Context, Render Context)
  • a Virtools composition is loaded
  • the composition is reset and started (and potentially paused and resumed)
  • the main process loop is repeatedly called for processing and displaying of the composition
  • eventually, the composition is stopped and unloaded
  • the program exits

These steps are detailed below. The Virtools libraries are also referred to as the CK2 library.

Initializing Virtools

The Virtools initialization prepares the system for compositions. Once the system is globally initialized, any number of compositions may be loaded, executed and unloaded, until the program exits. These Virtools initializations have to be done once before any composition can be taken into account.

Initializing Engine

Prior to any other call to the CK2, the CKStartUp function should be called, once. This function initializes basic Virtools structures and processes. When the executable is done with Virtools, it should call CKShutdown (see below).

BOOL InitializeEngine ()
{
     CKStartUp();
    // ...

Initializing Paths

The CK2 library must be told where to look for Plugins, especially Render Plugins, but also Manager, Behavior and Media Plugins. This is done by calling the global internal CKPluginManager, which manages DLLs Plugin Paths, CKPluginInfo, etc.. There is only one instance of this CKPluginManager class inside CK2, which can be acquired using the CKGetPluginManager function :

    CKPluginManager* ThePluginManager=CKGetPluginManager();

The Plugin Manager then accepts file system paths, in which it looks for Plugin DLLs, recursively.

These paths are not typed according to the Plugin types that they contain, as the Plugin type are specified inside each Plugin DLL using the CKGetPluginInfo function. Refer to the Creating New Plugins chapter. Each DLL (file ending with ".dll") is loaded and examined by the Plugin Manager to determine which type of Plugin(s) it provides. The DLL is then unloaded until it is really needed in the course of the execution.

    char * RenderPath = ... ;
    char * ManagerPath = ... ;
    char * BehaviorPath = ... ;
    char * MediaPath = ... ;
    ThePluginManager->ParsePlugins(RenderPath);
    ThePluginManager->ParsePlugins(ManagerPath);
    ThePluginManager->ParsePlugins(BehaviorPath);
    ThePluginManager->ParsePlugins(MediaPath);

The paths may be computed using the VxMath helper classes CKDirectoryParser and CKPathSplitter.

Initializing one composition

One Virtools composition corresponds to a ".cmo" file, and contains objects and behaviors. It corresponds to one Virtools content, independent, which is typically played inside a window of its own.

Many compositions may be played at the same time.

Initializing Context

In CK2, each Virtools composition corresponds to one CKContext instance. The CKContext instance manages all the structures corresponding to the composition. Contexts are thread safe, that means that two threads can each have its own Virtools context.

The CKContext instance should be created before the composition is loaded :

    CKContext *TheCKContext = NULL;
    int RenderEngineIndex = 0;
    WIN_HANDLE aWindow = ... ;
    CKCreateContext(&TheCKContext, aWindow, RenderEngineIndex);

This function fills the TheCKContext pointer with a pointer to a newly created CKContext instance. This instance should eventually be destroyed using the CKCloseContext function.

The WIN_HANDLE should be the main application window. This window should exist all the time that the context exists. The window is used by the render engines to manage various system cooperation operations (it is not used to draw anything). Passing NULL would result in unknown effects if rendering is used.

The render engine index is the index of the render engine that should be used. This index corresponds to the order into which the Plugin Manager has found the Render Engine Plugins, which can be examined using the CKPluginManager functions. Passing 0 (zero) as argument makes CK2 use the default render engine.

Initializing RenderContext

In order to be rendered and displayed, a composition needs at least one Render Context. A Render Context manages what, how, where and by what rendering happens. A composition may be rendered multiple time, and in multiple ways, through multiple Render Contexts (for example in more than one rectangle in one window, or in many windows).

All the Render Contexts of a context are managed by the Render Manager, which is an internal manager. There is only one instance of the CKRenderManager class per instance of CKContext :

CKRenderManager * TheRenderManager = TheCKContext->GetRenderManager();

A RenderContext is created by asking the Render Manager :

    void * aRenderWindow = ... ;
    int aDriverIndex = 0;
    CKRECT aRenderRect = ...    ;
    CKRenderContext * TheRenderContext
        = TheRenderManager->CreateRenderContext(aRenderWindow, aDriverIndex);

The provided window is the window into which the drawing will occur (see the CKRenderContext::BackToFront function). This window should exist during the whole lifetime of the Render Context. By default the drawing happens in the whole window client rect. The CreateRenderContext function accepts a additional argument for specifying a smaller drawing rectangle inside the window. This rectangle can change over time (CKRenderContext::SetWindowRect function).

The CreateRenderContext needs a driver index, corresponding to the list of drivers that the Render Manager provides. These drivers are provided by the rasterizers to the Render Manager, and typically correspond to a association of specialized hardware or to 3D software with 3D library like DirectX or OpenGL. The Render Manager provides the list of drivers that it supports, along with their characteristics, through the GetRenderDriverCount and GetRenderDriverDescription functions. The drivers are sorted by decreasing performance, so the first driver is usually the best, performance-wise.

Opening a composition

Loading a cmo file into a Level

A composition usually comes from a .cmo file that was created using the Virtools application, though one can imagine creating new objects from scratch in a CKContext.

When loading a .cmo file, there may be external dependencies, for example if the .cmo uses external textures, sounds or movies. In this case, only the file names of these external resources are stored inside the cmo file. When such file names are encountered, Virtools looks for the resources in a list of search paths, which by default is empty. This list of paths is typically set up before actually loading the cmo file, and is managed by the Path Manager which is attached to the Context :

    int ResourceCategory = ... ;
    TheCKContext->GetPathManager()->AddPath(ResourceCategory,XString(aPath));
    // etc ...

The resource category is one of CK_PATHMANAGER_CATEGORY :

typedef enum CK_PATHMANAGER_CATEGORY {
    BITMAP_PATH_IDX =0,
    DATA_PATH_IDX =1,
    SOUND_PATH_IDX =2
} CK_PATHMANAGER_CATEGORY;

The paths may be computed using the VxMath helper classes CKDirectoryParser and CKPathSplitter.

Once the search paths are defined, the cmo can be loaded, using the CKContext::Load function. This function reads the cmo and creates instances of Virtools objects according to the descriptions that it finds in the file. As it is a cmo, it contains a Level to which all the objects belong. This Level is set as the current level of the context. If a level was already attached to the context at the moment of the load, all the objects of the cmo would be added to this existing level, and the level of the cmo would be discarded. In all cases, all the objets that were read are also added to the given array.

    CKObjectArray *array=CreateCKObjectArray();
    CKERROR res=CK_OK;

    if ((res=TheCKContext->Load((char*) str,array))==CK_OK)
    {

        // ...

    }
    DeleteCKObjectArray(array);

Preparing the Context for Play and Rendering

Before starting playing and rendering the context, there are some steps that you have to follow in order for the context to be visible:

First, you have to tell the Level which render context(s) will be used for rendering. If no render context is attached, the Level will not be able to be rendered. Typically, the previously created Render Context is attached.

    //--- Add the render context to the level
    CKLevel* TheLevel=TheCKContext->GetCurrentLevel();
    TheLevel->AddRenderContext(TheRenderContext,TRUE);

Optionally, you may want to define a default camera for the render context. Indeed, if no camera is set (using the SetActiveCamera Building Block) in the cmo, there will be no camera through which rendering can occur. So loading is a good place to set a camera, for example the first camera found in the Context.

    //--- Take the first camera we find and attach the viewpoint to it.
    CK_ID* cam_ids=TheCKContext->GetObjectsListByClassID(CKCID_CAMERA);
    if (!cam_ids) cam_ids = TheCKContext->GetObjectsListByClassID(CKCID_TARGETCAMERA);
    if (cam_ids) {
        CKCamera *camera=(CKCamera *)TheCKContext->GetObject(cam_ids[0]);
        if (camera) TheRenderContext->AttachViewpointToCamera(camera);
    }

The last thing, which is mandatory, is to define which scene will be started. The Level may have many scenes, and the starting scene must be specified, using the CKLevel::LaunchScene function. This function also has the important task of defining which will be the initial conditions for all the objects when the Context is reset (see below).

    CKLevel* TheLevel=TheCKContext->GetCurrentLevel();
    TheLevel->LaunchScene(NULL);

Passing a NULL argument to the Level specifies that the default scene should be started, and that the initial conditions should be the conditions of this scene.

Playing a composition

Once a composition has been loaded and prepared for play, the basic idea is to start the context, and then repeatedly execute the main process loop, as fast as possible, until the end.

Resetting, Playing, Pausing, Resuming, Resetting

Before starting, the context should be reset, using the CKContext::Reset function, which has two actions: stop everything that might have been running before, and set the initial conditions for all the concerned objects. In all cases, the according callbacks (on Managers, Behaviors, etc..) are called. So Reset has two functions : stop the ongoing play, and prepare for the next play. It is the equivalent of the "IC" button in the Virtools application.

    TheCKContext->Reset();

Once a context is reset, it can be played (equivalent of the "play" button in the Virtools application) :

TheCKContext->Play();

Once playing, it can be paused (equivalent of the "pause" button in the Virtools application) :

    if (TheContext->IsPlaying()) TheCKContext->Pause();

Once paused, it can be resumed, using the Play function again:
    if (!TheContext->IsPlaying()) TheCKContext->Play();

Once playing, it can be stopped and prepared to play again using Reset :
    if (TheContext->IsPlaying()) TheCKContext->Reset();

Note that these functions don't start a thread or a background process, they only set internal state variables, and execute all the necessary callbacks. The actual processing is done in the main process loop (see below).

Implementing the Process Loop

For an overview of the main Process Loop, see the Presentation of the Process Loop chapter.

Implementing the process loop consists in repeatedly executing the Behavioral Process and the Rendering Process, using respectively the CKContext::Process and CKRenderContext::Render functions. The process loop can be implemented as an infinite loop, or in a system or window callback, so that other events may be taken into account (like UI events, menus, etc..). Since behavioral rate and frame rate can be locked the time manager is used to know when processing and rendering should occur.

CKTimeManager* TheTimeManager = TheContext->GetTimeManager();
while(1)
    {

        float TimeBeforeRender=0,TimeBeforeBeh=0;
        // Ask the time manager the time to wait before
        // doing a render and a process
        // if the time is positive we keep on looping
        // without doing anything

        TheTimeManager->GetTimeToWaitForLimits(TimeBeforeRender,TimeBeforeBeh);

        BOOL DoBehaviors	= (TimeBeforeBeh <=0);
        BOOL DoRender		= (TimeBeforeRender  <=0);

        TheTimeManager->ResetChronos(DoRender,DoBehaviors);

        if (DoBehaviors)	TheCKContext->Process();
        if (DoRender) 		TheRenderContext->Render();
    }

The Process function does all the housekeeping, doing the pre-process and post-process callbacks, and of course calling all the behaviors. The Process Loop should be called as fast as possible for a high frame rate. The Process function has to be called for each Context that is playing. The Render function should be called for each Render Context that is attached to a Level of each Context.

By default, the Render function does both the rendering and the displaying. Optionally, the Render function will only do the rendering (computing the 3D scene and drawing it in an offscreen image buffer). The displaying (copying the offscreen buffer on the screen) may be done when needed using the CKRenderContext::BackToFront function.

Cleanup, closing and exiting

Before closing a context, it should be stopped if it was playing :

    if (TheContext->IsPlaying()) TheCKContext->Reset();

The Render Context(s) of the Context should be destroyed :

    TheCKContext->GetRenderManager()->DestroyRenderContext(TheRenderContext);

All the objects of the context should be deleted :

    TheCKContext->ClearAll();

Then the context can be closed :

    CKCloseContext(TheCKContext);

If all the contexts are closed, CK2 can be shutdown, before the executable exits :

    CKShutdown();

DLL description list

The following table contains the description of the Virtools DLLs. This list helps you detrmine if a DLL should be included in your stand alone player.

(R) indicates that a redistribuable version of this DLL must be included in the stand alone player. Redistribuable file versions can be found in the <Virtools Installation Folder>\Sdk\Redist folder
Dll name | Description | Needed by player | Comment
cg.dll | CgFX DLL | Optional | Include this file at the root of the stand alone player (static or dynamic) if you use CgFX shaders
cgGL.dll | CgFX DLL | Optional | Include this file at the root of the stand alone player (static or dynamic) if you use CgFX shaders
CK2.dll | Behavioral Engine | Mandatory |
CKControls.dll | Interface Control for Virtools User Interface | No |
CKZlib.dll | Compression Tools | Mandatory |
DllEditor.dll | Used to create Plugins with a user interface within Virtools (see Virtools Interface SDK) | No |
InterfaceControls.dll | Interface Control for Virtools User Interface | No |
MFC71.dll | Microsoft MFC | Optional | If your stand alone player is built from the CustomPlayer SDK sample this DLL is needed
msvcp71.dll | Microsoft C++ Library | No |
msvcr71.dll | Microsoft C++ Library | Mandatory |
nk2.dll | Network Kernel | Optional |
NxN_alienbrain_WIF_127.dll | Alienbrain Library | No |
NxN_alienbrain_WIF_128.dll | Alienbrain Library | No |
NxN_alienbrain_WIF_129.dll | Alienbrain Library | No |
resvis.dll | Graphical Resources for Virtools User Interface | No |
VCrypt.dll | Encryption Library | Optional |
vk3DXMLReadWrite.dll | 3D XML Common Tools | No | This DLL must not be included in a Stand alone player
vkCompression.dll | Compression Tools for 3D XML | No | This DLL must not be included in a Stand alone player
vkDAEReadWrite.dll | DAE (Collada) Common Tools | Optionnal | Add this DLL if you use ColladaLoader.dll. Note that there is no Static version of this DLL
vkKernel.dll | Virtools tools Base Library | Optionnal | Add this DLL if you use ColladaLoader.dll. Note that there is no Static version of this DLL
vkMath.dll | Virtools tools Base Library | Optionnal | Add this DLL if you use ColladaLoader.dll. Note that there is no Static version of this DLL
VRKernel.dll | Virtools VR Library Base | No | See the VR Library for details about using a VR Library stand alone player
VSL.dll | Virtools Script Language Kernel | Mandatory (R) | The redistribuable version of this DLL is VSLRT.DLL
vsutils.dll | Virtools Server Utilities | Optional |
VTThumbnail.dll | Virtools Thumbnail Viewer | No |
VxMath.dll | System and mathematic tools | Mandatory |
3DXML\PluginData\bin\*.dll | 3DXML utilities | No |
BuildingBlocks\3DTransfo.dll | 3D Transformations BBs | Optional |
BuildingBlocks\BuildingBlocksAddons1.dll | Misc BBs | Optional (R) |
BuildingBlocks\BuildingBlocksAddons2.dll | Misc BBs | Optional (R) |
BuildingBlocks\Cameras.dll | Cameras BBs | Optional |
BuildingBlocks\Characters.dll | Characters BBs | Optional |
BuildingBlocks\Collisions.dll | Collisions BBs | Optional |
BuildingBlocks\Controllers.dll | Controllers BBs | Optional |
BuildingBlocks\CryptedLoader.dll | Virtools Server Crypted Loader BBs | Optional (R) |
BuildingBlocks\DatabaseClientModule2.dll | Virtools Server Database Client Module | Optional (R) |
BuildingBlocks\DownloadMediaClient2.dll | Virtools Server Download Client Module | Optional (R) |
BuildingBlocks\Encryption.dll | Encryption BBs used by Office/XE Players | No |
BuildingBlocks\FilesManagement.dll | File Management BBs used by Office/XE Players | No |
BuildingBlocks\Grids.dll | Gribs BBs | Optional |
BuildingBlocks\ImageCapture.dll | Image/Video Capture BBs used by Office/XE Players | No |
BuildingBlocks\Interface.dll | Interface BBs | Optional |
BuildingBlocks\Lights.dll | Lights BBs | Optional |
BuildingBlocks\Logics.dll | Logics BBs | Optional |
BuildingBlocks\Materials.dll | Materials-Textures BBs | Optional |
BuildingBlocks\MeshModifiers.dll | Mesh Modifications BBs | Optional |
BuildingBlocks\MidiManager.dll | Midi BBs | Optional |
BuildingBlocks\MultiUserClient.dll | Virtools Server Multiuser Client Module | Optional (R) |
BuildingBlocks\Narratives.dll | Narratives BBs | Optional |
BuildingBlocks\ParticleSystems.dll | Particles BBs | Optional |
BuildingBlocks\Physics.dll | Physics Library BBs | Optional (R) |
BuildingBlocks\PlayerCustomInterface.dll | Custom Interface BBs used by Office/XE Players | No |
BuildingBlocks\Shader.dll | Shader Manager and BBs | Optional |
BuildingBlocks\Sounds.dll | Sounds BBs | Optional |
BuildingBlocks\VectorGraphics.dll | Vector Graphics BBs | No |
BuildingBlocks\Video.dll | Video BBs | Optional |
BuildingBlocks\Visuals.dll | Visual BBs | Optional |
BuildingBlocks\VRDevices.dll | VR Devices BBs | No |
BuildingBlocks\VRDisplay.dll | VR Display BBs | No |
BuildingBlocks\VRDistrib.dll | VR Distrib BBs | No |
BuildingBlocks\VRMain.dll | VR Main Tools | No |
BuildingBlocks\WorldEnvironments.dll | World Environments BBs | Optional |
BuildingBlocks\XInputController.dll | XInput Controller BBs | Optional |
BuildingBlocks\XMLManager.dll | XML Manager used by Office/XE Players | No |
InterfacePlugins\ActionEditor.dll | VSL Action Editor | No |
InterfacePlugins\CryptedKeyInterface.dll | User Interface Component used by Virtools Server Crypted Loader | No |
InterfacePlugins\FEMgr.dll | Flag&Enum Manager User Interface | No |
InterfacePlugins\NXN7Plugin.dll | NxN Manager User Interface (for Nxn 7.0) | No |
InterfacePlugins\NXN7Plugin71.dll | NxN Manager User Interface (for Nxn 7.1) | No |
InterfacePlugins\NXN7Plugin75.dll | NxN Manager User Interface (for Nxn 7.5) | No |
InterfacePlugins\Physics Interface.dll | Physics Library User Interface | No |
InterfacePlugins\ShaderEditor.dll | Shader Editor | No |
Managers\ai.dll | AI Library | Optional (R) |
Managers\AlienBrainDependenciesManager.dll | NxN Manager | No |
Managers\CK2UI.dll | User Interface for CK2 Components | No |
Managers\CKFEMgr.dll | Flag&Enum Manager | Mandatory (R) |
Managers\Dx5InputManager.dll | Input Manager | Optional |
Managers\DX7SoundManager.dll | Sound Manager | Optional |
Managers\ParameterOperations.dll | Parameter Operations | Mandatory |
Managers\VideoManager.dll | Video Manager | Optional |
Managers\vs2_embedded.dll | Virtools Embedded Server | Optional (R) |
Managers\VSLManager.dll | VSL Manager | Mandatory (R) |
Managers\vsmanager2.dll | Virtools Server Manager | Optional (R) |
Managers\WebManager.dll | Web Manager and BBs | Optional |
Managers\WebserverManager.dll | Webserver Manager and BBs | Optional |
Plugins\3dsLoader.dll | 3DS file Loader | Optional |
Plugins\3dxmlplugin.dll | 3D XML File Loader | No |
Plugins\AscLoader.dll | Point Clouds Loader | Optional |
Plugins\AVIReader.dll | AVI Reader | Optional |
Plugins\ColladaLoader.dll | DAE (Collada) Loader | Optional |
Plugins\DDSReader.dll | DDS Loader | Optional |
Plugins\Dx8VideoManager.dll | DX8 Video Manager; | Optional |
Plugins\Dx9VideoManager.dll | DX9 Video Manager | Optional |
Plugins\ImageReader.dll | Common Image Loader (BMP, TGA, PCX) | Optional |
Plugins\JpgLoader.dll | JPG File Loader | Optional |
Plugins\PngLoader.dll | PNG File Loader | Optional |
Plugins\TiffReader.dll | TIFF File Loader | Optional |
Plugins\VirtoolsLoader.dll | Virtools File Loader (cmo/vmo/nmo/nms) | Mandatory |
Plugins\vraniml.dll | VRML Library | Optional |
Plugins\Vrmlloader.dll | VRML Loader | Optional |
Plugins\WavReader.dll | Wav File Reader | Optional |
Plugins\XLoader.dll | X File Loader | Optional |
RenderEngines\CK2_3D.dll | Render Engine | Mandatory |
RenderEngines\CKDX7Rasterizer.dll | DirectX 7 Rasterizer | Optional |
RenderEngines\CKDX8Rasterizer.dll | DirectX 8 Rasterizer | Optional |
RenderEngines\CKDX9Rasterizer.dll | DirectX 9 Rasterizer | Optional |
RenderEngines\CKGLRasterizer.dll | OpenGL Rasterizer | Optional |


Binding New C/C++ functionality for VSL

Binding New C/C++ Functionality to use in VSL

This section is for developers who want add functionality to VSL by binding their own C/C++ code. In this context, "binding" means "to make your custom C/C++ code accessible as a runtime process".

Note: Remember that VSL is not C++. Not all C++ code is "bindable" by VSL.

Binding Architecture

All binding macros use VSLManager, so you have to be sure that VSLManager is successfully loaded before binding anything. The best way to bind your code and data is to create your own manager, inherited from CKBaseManager (see SDK documentation), and place your binding macro in your overloaded member function OnCKInit().

You must start your binding code with the macro STARTVSLBIND. STARTVSLBIND takes a single parameter: the unique CKContext of your application. You must finish with the STOPVSLBIND macro. For example:

#include "VSLManagerSDK.h"

CKERROR MyManager::OnCKInit()
{
    STARTVSLBIND(m_Context)

    // Binding macros ...

    STOPVSLBIND
    return CK_OK;
}

Class - Working Example

In the following sections, we will work with this hypothetic class:
// C++ code
class MyClass
{
 public :
     // Members
     int i;
    float f;
    AnotherClass ac;

    // Constructors and destructor
    MyClass();
    MyClass(int a, float f);
    ~MyClass();

    // Members functions
    void Nothing();
    float SetIAndF(int i, float f);
    int GetI() const;
    MyClass operator*(const MyClass &mc);

 private :
     // Private members can't be bound
};

Bind New Types

Binding new types is a fundamental VSL binding capability; it is also one of the most tricky features to use because you have different ways to bind new types. The various mechanisms are as follows.

DECLAREOBJECTTYPE(type)

type : your struct/class name.

Use this macro to bind struct/class.

Example:

In your MyManager::OnCKInit()

DECLAREOBJECTTYPE(MyClass)
In a VSL script:
MyClass a; // If a constructor is bound, it is called
MyClass b; // Ditto
a = b; // Implemented with memcpy because no assignment operator ( = ) is defined for this class.

DECLAREOBJECTTYPEALIAS(type,alias)

type : your struct/class name.

alias : a string (const char *) containing the name you will use in VSL to manipulate your struct/class.

Use this macro to bind struct/class and to use it with a different name in VSL.

Example:

In your MyManager::OnCKInit()

DECLAREOBJECTTYPEALIAS(MyClass, "myclass")
In a VSL script:
myclass a; // If a constructor is bound, it is called
myclass b; // Ditto
a = b; // Implemented with memcpy because no assignment operator ( = ) is defined for this class

DECLAREPOINTERTYPE(type)

type : your struct/class name.

Use this macro to bind pointer on struct/class (when the constructor is not accessible).

In this case VSL is not able to instantiate any object of this struct/class.

Example:

In your MyManager::OnCKInit()

DECLAREPOINTERTYPE(MyClass)
In a VSL script:
MyClass a; // No constructor is called, a must be affected
MyClass b; // Ditto
a = b; // Affectation is just a DWORD copy (MyClass is managed as a pointer) because no operator = exist

DECLAREPOINTERTYPEALIAS(type,alias)

type : your struct/class name.

alias : a string (const char *) containing the name you will use in VSL to manipulate your struct/class.

Use this macro to bind pointer on struct/class (when constructor is not accessible).

In this case VSL is not able to instantiate any object of this struct/class.

You will also use this class under its alias name.

Example:

In your MyManager::OnCKInit()

DECLAREPOINTERTYPEALIAS(MyClass, "myclass")
In a VSL script:
myclass a; // No constructor is called, a must be affected
myclass b; // Ditto
a = b; // Implemented as a DWORD copy of the pointer (myclass is managed as a pointer)
        //because no assignment operator ( = ) is defined for this class.

Bind Functions

DECLAREFUN_%T_%P(returnType,functionName, [paramDeclList] )

T : function call convention, C for CDECL and S for STDCALL.

P : number of parameters (0 to 6).

returnType : return type of the function.

functionName : function's name (it is not a string).

paramDeclList : list of parameter declaration.

Example:

// C function declaration
void  div(int iNumer, int iDenom, int& oQuot, int& oRemain);
Then in our MyManager::OnCKInit()
DECLAREFUN_C_4(void, div, int iNumer, int iDenom, int& oQuot, int& oRemain)
In a VSL script:
int quot;
int remain;
div(5, 2, quot, remain);

Note that you can bind alias functions. You have to use the macro DECLAREFUNALIAS instead of DECLAREFUN.

DECLAREFUNALIAS_%T_%P(alias,returnType,functionName, [paramDeclList] )

T : function call convention, C for CDECL and S for STDCALL.

P : number of parameters (0 to 6).

alias : function's alias (const char *) .

returnType : return type of the function.

functionName : function's name (it is not a string).

paramDeclList : list of parameter declaration.

Example in our MyManager::OnCKInit() :

DECLAREFUNALIAS_C_4("cDiv", void, div, int iNumer, int iDenom, int& oQuot, int& oRemain)

Bind Friends Functions

DECLAREFRIEND_%P(returnType,functionName, [paramDeclList] )

P : number of parameters (0 to 6).

returnType : return type of the function.

functionName : function's name (it is not a string).

paramDeclList : list of parameter declaration.

Bind Friends Operators

DECLAREFRIENDOP_%P(returnType,operatorName, [paramDeclList] )

P : number of parameters (0 to 2).

returnType : return type of the function.

functionName : function's name (it is not a string).

paramDeclList : list of parameter declaration.

NOTE: operator name must be : "operator" plus the operator.

Example:

// C++ function declaration
friend const VxVector operator+ (const VxVector& v);
Then in our MyManager::OnCKInit()
DECLAREFRIENDOP_1(const VxVector,operator+,const VxVector& v);

Bind Constructors

To bind a constructor you have to define a constructor binding function that will call the real constructor (with the address of the variable as a parameter): this is called a "placement new".

Before binding constructors of a struct/class, this struct/class must be already bound with the macro DECLAREOBJECTTYPE or DECLAREOBJECTTYPEALIAS.

The constructor binding function's name MUST be the concatenation of the string "__new" ("new" is preceded by two underscore characters) and the struct/class C++ name that is being bound(and not the alias name).

In our case:
void __newMyClass(BYTE *iAdd)
{
    new (iAdd) MyClass();
}
And:
void __newMyClass(BYTE *iAdd, int a, float f)
{
    new (iAdd) MyClass(int a, float f);
}

Then you have to bind this function with the macro named "DECLARECTOR_" concatenated with the number of the constructor's parameters. The first parameter to the macro must be the function's name. If your constructor use parameters then you have to add their declarations (in the order that they appear in the constructor definition) to the parameter list.

In our case, in our MyManager::OnCKInit()
DECLARECTOR_0(__newMyClass)
DECLARECTOR_2(__newMyClass, int i, int f)

Bind Destructors

Before binding constructors of a struct/class, this struct/class must be already bound with the macro DECLAREOBJECTTYPE or DECLAREOBJECTTYPEALIAS.

Binding destructors is much like binding constructors. First, define a function that will call the destructor using the macro DECLAREDESTRUCTORFUNCTION with the struct/class name as parameter.

Then bind the function, its name will be the concatenation of "__dest" and the struct/class C++ name.

In our case :

// This macro defines the function __destMyClass
DECLAREDESTRUCTORFUNCTION(MyClass)
Then in our MyManager::OnCKInit()
DECLAREDESTRUCTOR(__destMyClass)

Bind Member Functions

DECLAREMETHOD[C]_%P(class,returnType,functionName, [paramDeclList] )

C : Add C to macro if the member function is constant.

P : number of parameters (0 to 8).

class : class of the member function.

returnType : return type of the function.

functionName : function's name (it is not a string).

paramDeclList : list of parameter declaration.

Then in our MyManager::OnCKInit()
DECLAREMETHOD_0(MyClass,void,Nothing)
DECLAREMETHOD_2(MyClass,float,SetIAndF, int i, int f)

// Note that we use DECLAREMETHODC macro, because GetI is const
DECLAREMETHODC_0(MyClass,int,GetI, int i, int f)

Bind Member Operators

DECLAREOP[C]_%P(class,returnType,operatorName, [paramDeclList] )

C : Add C to macro if the member function is constant.

P : number of parameters (0 to 2).

class : class of the member function.

returnType : return type of the function.

operatorName : function's name (it is not a string).

paramDeclList : list of parameter declaration.

NOTE: operator name must be : "operator" plus the operator.

In our MyManager::OnCKInit()
DECLAREOP_1(MyClass,MyClass,operator*,const MyClass &mc)

Bind Member Static Functions

DECLARESTATIC[C]_%P(class,returnType,functionName, [paramDeclList] )

C : Add C to macro if the member function is constant.

P : number of parameters (0 to 8).

class : class of the member function.

returnType : return type of the function.

functionName : function's name (it is not a string).

paramDeclList : list of parameter declaration.

Bind Members

DECLAREMEMBER(class,type,memberName)

class : class of the member function.

type : member's type (this type must be already bound).

functionName : function's name (it is not a string).

memberName : member's name.

In our MyManager::OnCKInit()
DECLAREMEMBER(MyClass,int,i)
DECLAREMEMBER(MyClass,float,f)
DECLAREMEMBER(MyClass,AnotherClass,ac) // Type AnotherClass must be already bound

Bind Enums

DECLAREENUM(enumName)

enumName : enum's name.

DECLAREENUMVALUE(enumName,valueName,value)

enumName : enum's name (const char *).

valueName : value's name.

value : int value.

Example:

// C/C++ enum declaration
enum CKSUPPORT
{
    CKSUPPORT_FRONT,
    CKSUPPORT_CENTER,
    CKSUPPORT_BACK
};
Then in our MyManager::OnCKInit()
DECLAREENUM("CKSUPPORT");
DECLAREENUMVALUE("CKSUPPORT", "CKSUPPORT_FRONT" , 0);
DECLAREENUMVALUE("CKSUPPORT", "CKSUPPORT_CENTER", 1);
DECLAREENUMVALUE("CKSUPPORT", "CKSUPPORT_BACK"  , 2);

Bind Constants

DECLARECONST(constName,constType,value)

constName : constant's name (const char *).

constType : constant's type (BIND_BOOL, BIND_CHAR, BIND_INT or BIND_FLOAT).

value : value.

Example in our MyManager::OnCKInit()
DECLARECONST("pi",BIND_FLOAT,3.14159)
DECLARECONST("one",BIND_INT,1)
DECLARECONST("WRONG",BIND_BOOL,FALSE)

Bind Managers

Binding a manager requires a combination of the binding techniques that we have just seen: binding class, member functions, etc...

In a VSL script, access to a manager is via the global variable bc:

// In a VSL script, we want to have access to RenderManager
RenderManager rm =  bc.GetRenderManager();

But if you write your own manager, you can not add a GetMyManager() function to the behavior context (bc)..

Therefore, you have to write (and bind) a function that will return your manager's GUID:

CKGUID GetMyManagerGuid()
{
    return MY_MANAGER_GUID;
}

Then, add a static function member Cast() to your manager as follows:

static MyManager * Cast(CKBaseManager* iM)
{
    return (MyManager *)iM;
}

Then you will be able to use GetManagerByGuid from bc, with your function returning your manager's GUID as the parameter:

MyManager mm = MyManager.Cast(bc.GetManagerByGuid(GetMyManagerGuid()));

Bind Function/Members Functions With Defaults Parameters

To bind functions, members functions, static functions and constructors with defaults parameters, you have to use special MACROs. These MACROs use the prefixes listed above (according to what you wish to bind), and you add the postfix _WITH_DEF_VALS.

An example with three functions:
void foo(int i = 0); // Default value is 0
void foo2(int i = 0, int j = 0); // Defaults values are 0
void foo3(int i, int j = 0); // Default value is 0
The bind code is:
DECLAREFUN_C_1_WITH_DEF_VALS(void, foo, int i, 0)
DECLAREFUN_C_2_WITH_DEF_VALS(void, foo2, int i, 0, int j, 0)
DECLAREFUN_C_2_WITH_DEF_VALS(void, foo3, int i, NODEFAULT, int j, 0)

In the last example, because function "foo3" had two prarameters, and only one had a default value, we still had to use MACRO DECLAREFUN_C_2_WITH_DEF_VALS. However, since the first parameter has no default value, we must use NODEFAULT as the default value.

Bind Classes Inheritance

To bind classes' inheritance, and be able to access the parent methods from VSL, you have two specific macros available:

DECLAREINHERITANCESIMPLE("CHILD","PARENT")
DECLAREINHERITANCEDOUBLE("CHILD","PARENT1","PARENT2")
Here is an example with two parents:
//C++ classes declarations
class A {...};
class B {...};
class C: public B, public A { ... };

//Bind declarations
DECLAREOBJECTTYPE(A);
DECLAREOBJECTTYPE(B);
DECLAREOBJECTTYPE(C);
DECLAREINHERITANCEDOUBLE("C","B","A")
It is possible to bind more than 2 parents with defining new macros on the same model. You have to be careful with the order of the classes in the DECLAREINHERITANCE macro which must be the same as the C++ inheritance order. If you have more than one parent, the parent members won't be bound correctly by default. In that case you have to manually bind all the parent members to the child class.

Example:
//C++ classes declarations
class A { int a; };
class B {...};
class C: public B, public A { ... };

//Bind declarations
DECLAREOBJECTTYPE(A);
DECLAREOBJECTTYPE(B);
DECLAREOBJECTTYPE(C);
DECLAREMEMBER(A,int,a)
DECLAREMEMBER(C,int,a)	// a is also bound in the C class to be used properly in VSL
DECLAREINHERITANCEDOUBLE("C","B","A")

The parent class methods are automatically bound in VSL.


FAQ

Frequently Asked Questions

  1. How can I debug my building blocks?
  2. How should I store pointers to CKObject in my structures ?
  3. How can I compile a runtime-only version of my building blocks?
  4. How can I create documentation for custom Building Blocks (BB)?
  5. In a stand alone player, how can I retrieve the loading percentage?
  6. How can I save an object in a .cmo file?
  7. Using compression to save a CMO file
  8. How do I iterate a XObjectArray and XObjectPointerArray ?
  9. Compilation Issues
  10. Crashes on delete or delete []
  11. How do I make my own .Exe ?
  12. My behavior Dll compiled fine,but I can not see it in Virtools
  13. Why can't I retrieve the resources contained in my custom DLL?
  14. How do I send datas within a message ?
  15. I modified Vertex UVs of my mesh, but nothing changes
  16. I modified Vertex Normals of my mesh, but nothing changes
  17. I modified Vertex Colors of my mesh, but nothing changes
  18. I modified Vertex Positions of my mesh, but nothing changes
  19. How do I know an object moved ?
  20. Why, when launching my standalone player, FlexLM licences are required ?
  21. Is Visual Studio .NET supported ?
  22. When I load and save a Virtools file how can I avoid loosing the scripts schematic ?

  • How can I debug my building blocks?

    Use the debug configuration in the building block project setting and in the "C/C++" tab of your building block project settings (in the debug configuration), select the "Code generation" entry of the"Category" combo box, from the "Use run-time library" select the "Multithreaded DLL" instead of "Multithreaded Debug DLL".

    In the link Object/library modules edit box, make sure you have ck2.lib vxmath.lib (not VxMathD.lib).

    Top

  • How should I store pointers to CKObject in my structures ?

    It is unsafe to store pointers to CKObject in your structures if these objects are accessible to the user in the interface. They could get deleted by the user in the level view and the pointer would become invalid. A safe procedure is to store the CK_ID of the object ( you can use the macro CKOBJID(x) to obtain the ID of an object). To obtain the pointer back from the ID use the CKContext::GetObject method which returns the pointer to the object or NULL if the object has been deleted.

    Top

  • How can I compile a runtime-only version of my building blocks or plugin ?

    Plugins, Managers or BB Dll can be compiled so that they can not be used to create/modify a composition but only to play it.

    To make your DLL runtime-only, in your project settings, select the "C/C++" tab, from the Category combo box. Select Preprocessor, then add "VIRTOOLS_RUNTIME_VERSION" in the Preprocessor definitions field.

    Top

  • How can I create documentation for custom Building Blocks (BB)?

    1. Write your documentation using standard HTML. Save the file with *exactly* the same name as the BB has in the interface.
    2. Compile the HTML page(s) to CHM. The file name of the CHM must be exactly the same as the DLL containing the building block(s). e.g. if the DLL is called "mybehaviors.dll" then the CHM must be called mybehaviors.chm
    3. Place the CHM in the Virtools Documentation folder (at the same level as documentation.chm)
    4. Iin Dev, double-click a custom BB and the CHM opens and displaying the documentation page for that BB.

    NOTES:

    • within the CHM structure, the documentation page can be at any level
    • each DLL requires a separate CHM
    • the HTML file name must be exactly the same as the BB name in the Devinterface (including spaces etc)
    • You can use either extension .htm or .html for the HTML pages

    Top

  • In a stand alone player, how can I retrieve the loading percentage?

      • When loading big files, it is common to indicate the loading percentage using a progress bar. We will achieve this using a callback that is called each time an object is loaded.

      To achieve this in a stand alone player: Before loading the .cmo, set the callback using

    TheCKContext->SetInterfaceMode(FALSE,LoadCallBack,NULL);

      The prototype of the callback function is

      CKERROR LoadCallBack(CKUICallbackStruct&,void*);

      The CKUICallbackStruct contain two members NbObjetsLoaded and NbObjetsToLoad fields that are valid when the Reason member is set to CKUIM_LOADSAVEPROGRESS.

      Process the progress bar update in the callback After the loading is over remove the callback using

    TheCKContext->SetInterfaceMode(FALSE,NULL,NULL);

      Top

    • How can I save an object in a .cmo file?

      Here is an example code to save an object and all its dependencies (eg mesh, material for a 3DEntity) in a building block:

    CKBehavior* beh = BehContext.Behavior;
CKContext* ctx = BehContext.Context;
CKLevel* level = BehContext.CurrentLevel;

CKBeObject* tosave = beh->GetTarget();

CKObjectArray* oa = CreateCKObjectArray();

CKDependencies dp;
dp.m_Flags = CK_DEPENDENCIES_FULL;

oa->InsertAt(tosave->GetID());
//--- This is a cmo file : so it must contain a level
//--- if we only want to save the object, we can remove the next line
//--- and use a .nmo extension
oa->InsertAt(level->GetID());

XString path = "c:\\saved.cmo";

ctx->Save((CKSTRING) path,oa,0xFFFFFFFF,&dp);

    Top

    • Using compression to save a CMO file

      To enable compression use the following lines :

      •
TheCKContext->SetFileWriteMode(CKFILE_WHOLECOMPRESSED);
TheCKContext->SetCompressionLevel(n);

      Top

    • How do I iterate a XObjectArray and XObjectPointerArray ?

      //--------------------------------------------------
// XObjectPointerArray xopaliste;
for (CKObject** it = xopaliste.Begin(); it != xopaliste.End(); ++it)
{
    (*it)->GetName();
    ...
}

//--------------------------------------------------
// XObjectArray xoaliste;
for (CK_ID* it = xoaliste.Begin(); it != xoaliste.End(); ++it)
{
    CKObject* obj = Context->GetObject(*it);
    ...
}

      Top

    • Compilation Issues

      Error : C:\PROGRAM FILES\Virtools DEV\VirtoolsSDK\LIB\CK2.lib :

      fatal error LNK1106: invalid file or disk full: cannot seek to 0x3841b901

      Error executing link.exe.

      You are using Visual C++ 5 or older version while our library was built using VC++ 6.0 Service Pack 5

      Top

    • Crashes on delete or delete []

      This problem can often occurs when mixing "Release" and "Debug" Dlls. The new and delete operators are not the same between "Release" and "Debug" so trying to delete a buffer allocated using one version of the new operator with another version of the delete operator will cause an exception.

      The problem can arise when trying to debug a behavior (so in "Debug" version) with Virtools ("Release"), the SDK may return buffer that should be deleted by the user.

      Top

    • How do I make my own .Exe ?

      The source code of the standalone player is provided with this SDK. You should use it as a starting point to create your own executable.

      Top

    • My behavior Dll compiled fine,but I can not see it in Virtools

      The GUID you used for your behavior or dll may have been already used by another behavior, try using a different GUID. Also check the category you used for your behavior.

      Top

    • Why can't I retrieve the resources contained in my custom DLL?

      By default, MFC uses the resource handle of the main application, not the DLL one. To switch the module state to the correct resource handle, you have to call AFX_MANAGE_STATE(AfxGetStaticModuleState()) in your DLL before accessing your resources.

      For more information, see AFX_MANAGE_STATE in the MSDN, and Regular DLLs Dynamically Linked to MFC.

      Top

    • How do I send datas within a message ?

      • Here is sample coming from the "Send Message" building Block in the sample behaviors :

      CKMessageManager* mm = context->GetMessageManager();

// Retrieve the sender
CKBeObject* beo_sender = (CKBeObject*) beh->GetTarget();

// Retrieve the type of message to send
CKMessageType MsgType=-1;
beh->GetInputParameterValue(0,&Msg);

// Retrieve the destination
CKBeObject *beo_destination = (CKBeObject*) beh->GetInputParameterObject(1);

// Creates the message
CKMessage *msg = mm->SendMessageSingle(Msg,beo_destination,beo_sender);

// Now attach all the remaining parameters to the message
int count = beh->GetInputParameterCount();
CKParameterIn* tpin;
for (int i=2 ; i < count ; i++) {
    tpin = (CKParameterIn*)beh->GetInputParameter(i);
    if (tpin) msg->AddParameter(tpin->GetRealSource());

      If we now suppose you don't want to send existing parameters but new ones,say for example an integer value:

      // We suppose the message is already created
// we create a CKParameter that will contains
// our integer value
CKParameter* MyParam = (CKParameter *)CreateObject(CKCID_PARAMETER,"MessageData");

// Set the integer parameter type
MyParam->SetGUID(CKPGUID_INT);

// Set the value to the parameter
int MyValue = 125;
MyParam->SetValue(&MyValue);

// IMPORTANT :  the second parameter is set to TRUE as we want
// the parameter to be deleted once the message has been received
msg->AddParameter(MyParam,TRUE);

      Top

    • I modified Vertex UVs of my mesh, but nothing changes

      Be sure to call the method CKMesh::UVChanged() after modifying your UVs.

      Top

    • I modified Vertex Normals of my mesh, but nothing changes

      Be sure to call the method CKMesh::NormalChanged() after modifying your Normals.

      Top

    • I modified Vertex Colors of my mesh, but nothing changes

      Be sure to call the method CKMesh::ColorChanged() after modifying your Colors.

      Top

    • I modified Vertex Positions of my mesh, but nothing changes

      Be sure to call the method CKMesh::VertexMove() or CKMesh::ModifierVertexMove() after modifying your Vertex Positions.

      Top

    • How do I know an object moved ?

    Each time the world matrix of an object is potentially modified (position,rotation,scale...), the VX_MOVEABLE_HASMOVED flag is set on a CK3dentity (or derived class). This flag is reset at the start of each process loop. It can be tested using CK3dEntity::GetMoveableFlags() & VX_MOVEABLE_HASMOVED.

    • Why, when launching my standalone player, FlexLM licences are required ?

      Make sure to use the DLLs delivred in the Redist folder of the Virtools SDK.

      Top

    • Can I use Visual Studio .NET to build plugins?

      Yes, from Virtools DEV 3.5, Virtools DEV support .NET 2003.

      Top

    • When I load and save a Virtools file using the SDK, how can I avoid loosing the scripts schematic ?

      To solve this issue, add CKContext->SetInterfaceMode(TRUE); just before using CKContext::Load AND just before using CKContext::Save

      Top


Additionnal Tools

In the Utils folder of the Virtools SDK are stored several tools that can help you :

CKGuidGen.exe

Use CKGuidGen.exe to generate CKGUID to use in your behaviors, plugins or manager.

GenerateDependencies.exe

The Virtools Dependency Generator is used to examine a folder or a specific Virtools file and to produce information about all the plugins and building blocks required by that file to play properly.

To use this tool, copy the GenerateDependencies.exe and pelib.dll in the root folder of Virtools Dev.

Using the Browse button you can choose a Virtools file (cmo, vmo, or nmo) or a directory. You can also manually enter a name or drag and drop it (from Explorer for exemple).

Then use the Generate button to get information about the file or the directory you have chosen.

If you have entered a directory, all the files of that directory will be parsed. If the file is a Virtools file (cmo, vmo or nmo) we get its dependencies, for other files (gif, jpg, avi, ...) we check if a reader is available for this file type.

Once the dependencies has been generated a dialog box is displayed.

This dialog box contains:

  • the list of Building Blocks used by file(s).
  • the list of Plugins (here plugins are Building Blocks, Managers or Reader dlls).
  • and the list of other dlls required by plugins (only dlls contained in the Virtools executable (Virtools Dev, Virtools Web Player or a custom player) directory are listed).
You can copy all the lists into the clipboard and display the list of unparsed files (i.e. files with no associated reader) as below:

ImageGenerator.exe

This tools generate the image that describes a building block as used in the documentation. Specify the output folder and Drag'n Drop the dll or folder containing your dll into the dialog.


Virtools SDK Reference

This section contains reference information for the SDK API elements provided by Virtools®. Reference material is divided into the following categories:

Classes | List of SDK classes
Global Functions | List of SDK global functions
Enumerations | List of enumeration definitions
Structures | List of structures definitions
Callback Functions prototypes | Callback functions prototypes definitions
Macro definitions | List of SDK macro definitions
Types definitions | Standard Virtools SDK data types.
Macro Pre-Registred Parameter Types | List of Virtools SDK pre-registered parameter types
ParameterOperation Types | List of Virtools SDK pre-registered parameter operations types
Object Dependencies Options | CKObjects dependencies
Macro Class Identifiers | List of Virtools SDK classes
Macro Error Codes | List of error codes.
VxMath Reference |

See Also

Virtools SDK Documentation

Generated by the DocJet Source Code Documentation System version 6.1.3 Thursday, February 26, 2009


Classes

List of SDK classes

Base | Base classes
Behavior Engine | Behavior engine related classes
Class CKFileExtensionShort |
Class CKGUID |
Class CloudAttributeDescription | Attributes on points
Class CloudIterator | An iterator to iterate on a cloud of points.
Class CloudSelection | An iterator to iterate on a cloud of points.
Render Engine | Render Engine related classes
Sound Engine |
Plugins | Plugins related classes
Miscellaneous Classes | Miscellaneous classes
Variables |
Video Engine |
Class VxBigFile | A VxBigFile is used to store several files together in a single file. Files stored in a big file can be accessed as normal files with the Find method which fills a VxSubFile class with the appropriate data to read the sub file content.
Class VxConsoleListener | A Listener which display informations into a console.
Class VxFileListener | A Listener which display informations into a file.
Class VxLog | Utility class for logging information.
Class VxOutputDebugListener | A Listener which display informations into the debug output of your debbuger.
Class VxRDTSCProfiler |
Class VxStream | Base class for file IO.
Class VxSubFile | The VxSubFile is a special implementation of the VxStream It gives access to a file stored inside a big file (concatenation of several files in a single,bigger file).
Class XMatrix | Template class Describing a 2D Matrix of variable width and height.
Class XPriority |
Class CKBlendShapeSet | A set of blend shapes affecting a mesh. This object can be given to CKMesh::SetBlendShapeSet to set the group of blend shapes affecting that mesh.
Class CKBlendShapeVertexDelta | Position and normal deltas for a specific vertex / blend shape
Class OverridenMaterial | PRIVATE USE : class OverridenMaterial An overriden material

See Also

Virtools SDK Reference


Base

Base classes

Class CKContext | Main Interface Object
Class CKGroup | Management of group of objects
Class CKLevel | Main composition management
Class CKObject | Base class for most CK objects
Class CKSceneObject | Base class for objects which can be referenced in a scene

See Also

Classes


CKContext

Class CKContext

Main Interface Object

Remarks

The CKContext object is the heart of all Virtools based applications, It is the first object that should be created in order to use Virtools SDK. A CKContext is created with the global function CKCreateContext()

The CKContext object act as the central interface to create/destroy objects,to access managers, to load/save files.

Several CKContext can be created inside a same process (in multiple threads for example) but objects created by a specific CKContext must not be used in other contextes.

Groups

Current Composition | Runtime | Interface | Managers | Object Management | Operations | Profiling | Save Load | Save Load Options | Settings | Utilities

Current Composition
Method GetCurrentLevel | Returns the main CKLevel
Method GetCurrentScene | Returns the current active Scene
Method GetPlayerRenderContext | Returns the main render context
Method SetCurrentLevel | Sets the new current Level
Runtime
Method ClearAll | Flushes the entire composition.
Method GetFocusLostBehavior | Returns player's behavior on focus lost
Method IsInBreak | Returns whether execution is broken.
Method IsInClearAll | Returns if a ClearAll operation is in progress.
Method IsPlaying | Returns whether execution is paused.
Method IsReseted | Returns whether execution had been stopped
Method Pause | Deactivates the play mode
Method Play | Sets the play mode active.
Method Process | Execute one process loop
Method Reset | Stops execution and reset to initial conditions.
Interface
Method IsInInterfaceMode | Returns whether we are in interface mode.
Method OutputToConsole | Console window management
Method OutputToInfo | Output a text in the Dev status bar.
Method Select | Sets a list of objects as the current selection in Virtools.
Method SendInterfaceMessage | sends a message to Virtools interface
Method ShowSetup | Opens the setup of an object in Virtools.
Method UICopyObjects | Copies a list of objects in the clipboard in Virtools.
Method UIPasteObjects | Pastes a list of objects from the clipboard in Virtools.
Managers
Method ActivateManager | De/Activates a manager.
Method GetAttributeManager | Returns the Attribute Manager.
Method GetBehaviorManager | Returns the Behavior Manager.
Method GetInactiveManager | Returns the ith inactive manager.
Method GetInactiveManagerCount | Returns the number of inactive managers.
Method GetManager | Returns the Nth manager
Method GetManagerByGuid | Returns a manager according to its Guid
Method GetManagerByName | Returns the Manager searching it by name.
Method GetManagerCount | Returns the number of registred managers.
Method GetManagers | Returns an iterator on the managers
Method GetMessageManager | Returns the Message Manager.
Method GetParameterManager | Returns the Parameter Manager.
Method GetPathManager | Returns the Path Manager.
Method GetRenderManager | Returns a pointer to the Render Manager.
Method GetTimeManager | Returns the Time Manager
Method GetVariableManager | Returns the Variable Manager
Method HasManagerDuplicates | Returns TRUE if a manager has duplicates.
Method IsManagerActive | Returns the activity of a manager.
Method RegisterNewManager | Registers a new manager.
Object Management
Method ChangeObjectDynamic | Sets/Unset an object to be dynamic.
Method CKFillObjectsUnused | Returns the objects unused in the current scene
Method CopyObject | Copy a CKObject or a collection of CKObjects.
Method CreateObject | Creates a CKObject or derived class instance.
Method DestroyAllDynamicObjects | Destroy every dynamic objects contained in a scene.
Method DestroyObjects | Delete CKObjects
Method GetObject | Returns the object having the given ID
Method GetObjectByName | Returns the object having the given name without any class restriction.
Method GetObjectByNameAndClass | Returns the object having the given name and from specific class
Method GetObjectByNameAndParentClass | Returns the object having the given name and that is derived from specific ClassID
Method GetObjectCount | Returns the maximum number of created CKObjects
Method GetObjectListByType | Finds all object of a certain class
Method GetObjectsCountByClassID | Finds object count of a given class
Method GetObjectSize | Returns the memory occupation of a CKObject
Method GetObjectsListByClassID | Returns all object of a given class
Method IsObjectSafe | Check if the argument object is safe
Operations
Method GetFileInfo |
Method GetLoadedFile |
Method SetInterfaceMode | Installs a callback when building a standalone application
Method SetLoadedFile |
Method WillRenderBothStereoEyes | VR Specific
Profiling
Method EnableProfiling | Enables or disables the profiling mode
Method GetLastUserProfileTime | Gets last user profile time.
Method GetProfileStats | Returns the results of the profiling of the last process loop.
Method IsProfilingEnable | Returns whether profiling mode is enabled.
Method UserProfileStart | Starts profiling a subset of code.
Save Load
Method CreateCKFile | Creates an instance of CKFile
Method DeleteCKFile | Deletes an instance of CKFile
Method GetLastCmoLoaded | Gets the last composition file (.CMO) loaded.
Method GetLastFileLoaded | Returns the last file loaded.
Method GetLastFileSaved | Gets the last file saved.
Method IsInLoad | Checks if a file is currently being loaded
Method IsInSave | Checks if a file is currently being saved
Method Load | Loads a file.
Method LoadAnimationOnCharacter | Loads an animation file and adds the animation to the given character.
Method Save | Saves objects to a file
Method SetLastFileSaved | Sets the last saved file name.
Method SetStreamWriter | Installs an object to perform the serialization of CMO files.
Save Load Options
Method GetCompressionLevel | Returns the compression level used when saving files.
Method GetFileWriteMode | Returns the current file writing mode (compression)
Method GetGlobalImagesSaveFormat | Returns the format used to save images.
Method GetGlobalImagesSaveOptions | Returns the global options for image (textures and sprites) saving.
Method GetGlobalSoundsSaveOptions | Returns the global options for sound saving.
Method SetCompressionLevel | Sets the compression level used when saving files.
Method SetFileWriteMode | Sets the current file writing mode (compression).
Method SetGlobalImagesSaveFormat | Sets the format used to save images.
Method SetGlobalImagesSaveOptions | Sets the global options for image (textures and sprites) saving.
Method SetGlobalSoundsSaveOptions | Sets the global options for sounds saving.
Settings
Method GetSelectedRenderEngine | Returns the index of the currently selected render engine
Method GetStartOptions | Returns the options selected at start-up
Utilities
Method CreateCKParameterIn | Creates an instance of CKParameterIn
Method CreateCKParameterLocal | Creates an instance of CKParameterLocal
Method CreateCKParameterOperation | Creates an instance of CKParameterOperation from an operation GUID and parameters GUIDs
Method CreateCKParameterOut | Creates an instance of CKParameterOut
Method CreateCKParameterVariable | Creates an instance of CKParameterVariable
Method DumpObjectManagerMemoryUse | Dumps the memory use of the object managers members and memory usage of CKObjects in a text file.
Method GetMainWindow | Returns the handle to the main application window
Method GetSecureGuid | Returns a newly created secure GUID

See Also

CKContext::CreateObject, CKContext::GetObject, CKContext::DestroyObject


CKContext::GetCurrentLevel

Method CKContext::GetCurrentLevel

CKLevel *CKContext::GetCurrentLevel()

Returns the main CKLevel

Returns

A pointer to the CKLevel

See Also

GetCurrentScene,CKLevel


CKContext::GetCurrentScene

Method CKContext::GetCurrentScene

CKScene *CKContext::GetCurrentScene()

Returns the current active Scene

Returns

A pointer to the current active scene

Remarks

this function is a shortcut for GetCurrentLevel()->GetCurrentScene()

See Also

GetCurrentLevel,CKLevel::GetCurrentScene


CKContext::GetPlayerRenderContext

Method CKContext::GetPlayerRenderContext

CKRenderContext* CKContext::GetPlayerRenderContext()

Returns the main render context

Returns

A pointer to the main render context.

Remarks

Most of the time only one render context is used to render a composition. This method returns a pointer to this render context.

See Also

GetCurrentLevel,CKRenderContext


CKContext::SetCurrentLevel

Method CKContext::SetCurrentLevel

void CKContext::SetCurrentLevel(CKLevel *level)

Sets the new current Level

Parameters

Input argument level

A pointer to a CKLevel object that is to become the main level

Remarks

When loading a file if a Level is detected in the file and there is no current level,the loaded level is automatically set as the current level.

See Also

GetCurrentLevel,GetCurrentScene


CKContext::ClearAll

Method CKContext::ClearAll

CKERROR CKContext::ClearAll()

Flushes the entire composition.

Returns

CK_OK.

Remarks

This function destroy all the CKObjects, freeing up all used memory. Only Render Contexts are not destroyed by this function. Some callbacks can be called during a ClearAll operation, these callbacks can use IsInClearAll method to see check if such an operation is in progress.

See Also

IsInClearAll


CKContext::GetFocusLostBehavior

Method CKContext::GetFocusLostBehavior

CKDWORD CKContext::GetFocusLostBehavior()

Returns player's behavior on focus lost

Returns

Value | Meaning
CK_PAUSE_NO |
CK_PAUSE_INPUT_BROWSER |
CK_PAUSE_INPUT_PLAYER |
CK_PAUSE_ALL |

Remarks

+Authoring tool should not be affected by focus lost +The actual behavior of the player, based on the return value of this function, should be implemented in your custom player code.

See Also

Pause,Reset,Play


CKContext::IsInBreak

Method CKContext::IsInBreak

CKBOOL CKContext::IsInBreak()

Returns whether execution is broken.

Returns

FALSE is execution is paused, TRUE otherwise.

Remarks

A behavior being executed can break the execution by returning CKBR_BREAK. Its function will be called until it return a valid value, meanwhile , default windows message processing is done so the interface is still running.

See Also

Pause,Play,Reset


CKContext::IsInClearAll

Method CKContext::IsInClearAll

CKBOOL CKContext::IsInClearAll()

Returns if a ClearAll operation is in progress.

Returns

TRUE if Reset had been called and Play had not been called meanwhile.

Remarks

This method can be used inside callbacks to check whether they were called because of ClearAll operation.

See Also

ClearAll


CKContext::IsPlaying

Method CKContext::IsPlaying

CKBOOL CKContext::IsPlaying()

Returns whether execution is paused.

Returns

FALSE is execution is paused, TRUE otherwise.

See Also

Pause,Play,Reset


CKContext::IsReseted

Method CKContext::IsReseted

CKBOOL CKContext::IsReseted()

Returns whether execution had been stopped

Returns

TRUE if Reset had been called and Play had not been called meanwhile.

See Also

Pause,Reset,Play


CKContext::Pause

Method CKContext::Pause

CKERROR CKContext::Pause()

Deactivates the play mode

Returns

CK_OK if successful

Remarks

Calling Pause() pauses the execution. Further calls to Process will not process behaviors until Play is called. Each behavior is warmed that execution is paused with the callback message CKM_BEHAVIORPAUSE. Behaviors state (active inputs, outputs, links) is left unchanged.

See Also

Play,Reset,Process,IsPlaying


CKContext::Play

Method CKContext::Play

CKERROR CKContext::Play()

Sets the play mode active.

Returns

CK_OK if successful.

Remarks

Calling Play re-activates all behaviors for processing. Each behavior is warmed that execution start with the callback message CKM_BEHAVIORRESUME.

See Also

Pause,Reset,Process,IsPlaying


CKContext::Process

Method CKContext::Process

CKERROR CKContext::Process()

Execute one process loop

Returns

CK_OK.

Remarks

Does one standard process loop. Basically, it:

calls the time manager to reflect the real time and increment the tick counter calls the behavior manager to process the behaviors calls the Message manager to process the enqueued messages

This is the main runtime entry point of the Virtools library. The client application should call this function in its main runtime loop. CK must be in Play Mode (Play) for this function to execute.If this function is called while CK is paused (Pause) it does nothing.

The Process method executes the following code:

CKERROR CKContext::Process()
{
    if (CKIsPlaying()) {
        ExecuteManagersPreProcess();
        CurrentLevel->PreProcess();
        GetBehaviorManager()->Execute(CKGetTimeManager()->GetLastDeltaTime());
        ExecuteManagersPostProcess();
    }
    ....
}

See Also

CKCreateContext,CKCloseContext,Pause, Play CKTimeManager, CKBehaviorManager, CKMessageManager


CKContext::Reset

Method CKContext::Reset

CKERROR CKContext::Reset(CKBOOL ToLevelScene)

Stops execution and reset to initial conditions.

Parameters

Input argument ToLevelScene

TRUE to go back to the level scene, FALSE to stay in the current scene.

Returns

CK_OK if successful.

Remarks

Calling Reset stops all behaviors and resets their state. Each behavior is warmed that execution is stopped with the callback message CKM_BEHAVIORRESET. Objects that have initial conditions in the current scene are restored to their initial conditions in the scene.

See Also

Play,Pause,Process,IsPlaying


CKContext::IsInInterfaceMode

Method CKContext::IsInInterfaceMode

CKBOOL CKContext::IsInInterfaceMode()

Returns whether we are in interface mode.

Returns

TRUE if this context was created by Virtools.

Remarks

This method returns TRUE when CK is used in interface mode (Virtools) and FALSE when we are in player mode (Custom Application).

See Also

OutputToConsole,SetInterfaceMode


CKContext::OutputToConsole

Method CKContext::OutputToConsole

CKERROR CKContext::OutputToConsole(CKSTRING str,CKBOOL bBeep)
CKERROR CKContext::OutputToConsoleEx(CKSTRING format,...)
CKERROR CKContext::OutputToConsoleExBeep(CKSTRING format,...)

Console window management

Parameters

Input argument str

String to display in console window. dBeep: A boolean if a sound should be produced to warn the user.

Returns

CK_OK.

Remarks

The Virtools library provides a mechanism for console debugging. If you specify a console window, Virtools provides you with a output function that outputs the given string to the console window. The OutputToConsoleEx version is much more flexible fo the user with a sprintf type of argument.

See Also

IsInInterfaceMode,OutputToInfo


CKContext::OutputToInfo

Method CKContext::OutputToInfo

CKERROR CKContext::OutputToInfo(CKSTRING format,...)

Output a text in the Dev status bar.

Parameters

Input argument format

Format string (see printf documentation).

Returns

CK_OK if successful, an error code otherwise.

Remarks

Outputs the format string in the status bar (bottom-left)

See Also

IsInInterfaceMode,OutputToConsole


CKContext::Select

Method CKContext::Select

CKERROR CKContext::Select(const XObjectArray& o,BOOL clearSelection)

Sets a list of objects as the current selection in Virtools.

Parameters

Input argument o | A XObjectArray containing the objects to select.
Input argument clearSelection | FALSE to append the list to the current selection, FALSE to set it as the new selection

Returns

CK_OK if successful, an error code otherwise.

See Also

IsInInterfaceMode,OutputToConsole,ChooseObject,ShowSetup


CKContext::SendInterfaceMessage

Method CKContext::SendInterfaceMessage

CKDWORD CKContext::SendInterfaceMessage(CKDWORD reason,CKDWORD param1,CKDWORD param2,CKDWORD param3)

sends a message to Virtools interface

Parameters

Input argument reason | a CK_UICALLBACK_REASON enum value. This enum is defined in CKTypes.h
Input argument param1 | the 1st param of the message, its purpose depends on the reason
Input argument param2 | the 2nd param of the message, its purpose depends on the reason
Input argument param3 | the 3rd param of the message, its purpose depends on the reason

Returns

the answer of Virtools interface, usually CK_OK, except for some specific messages (ie CKUIM_SENDNOTIFICATION)

Remarks

Here are the possible reasons:

+CKUIM_LOADSAVEPROGRESS: private, it is used by the CK2 load function to tell the interface an item has been loaded.

+CKUIM_DEBUGMESSAGESEND: private, unused.

+CKUIM_OUTTOCONSOLE: output a string to the console, in the status bar on the left param1: CKBOOL, do a beep param2: CKSTRING, the string to output

+CKUIM_OUTTOINFOBAR output a string to the info bar (left to console output in status bar) param2: CKSTRING, the string to output

+CKUIM_SHOWSETUP: shows an object setup param1: CK_ID, the Object's ID;

+CKUIM_SELECT: selects objects in the 3d Layout and the Level Manager param1: XObjectArray*, the array of objects to select param2: bool, set to true clear the selection before

+CKUIM_CHOOSEOBJECT: opens a dialog in Virtools to choose an object (as if editing a parameter of the object type) param1: CK_ID, the Object's ID param2: CWnd*, the parent window for the dialog, can be NULL

+CKUIM_EDITOBJECT: opens the object's setu^^ param1: CK_ID, the Object's ID

+CKUIM_CREATEINTERFACECHUNK: message send to interface to save schematic scripts data (UI data) it is usually used before copying or saving an array of objects. All scripts param1: XObjectArray*, the array of objects to select

+CKUIM_COPYOBJECTS: add a list of object in the clipboard and prepare them for copy This message is used so that the copy is done and the interface is aware of the copy (in order for instance to show new behavior graphes in schematic) param1: XObjectArray*, the array of objects to copy param2: bool, set to true clear the selection before (otherwise, objects already in selection will be copied too)

+CKUIM_PASTEOBJECTS: paste objects in clipboard. This message should follow a CKUIM_COPYOBJECTS This message is used so that the copy is done and the interface is aware of the copy

param1: XObjectArray*, array of objects that will be filled with the objects in the clipboard

+CKUIM_SCENEADDEDTOLEVEL: tells the interface a scene has been created and added to the level param1: CK_ID, the scene object ID

+CKUIM_REFRESHBUILDINGBLOCKS: refresh all building block with specific GUID in the schematic view (for instance if the number of IO has changed in the prototype) param1: CKGUID*, array of CKGUID of building block prototype param2: int, size of array

+CKUIM_DOMESSAGELOOP: Do a standard loop of windows message processing

+CKUIM_VSLBREAKNOTIFY: private, sends a message to VSL Script Manager in Virtools param1: enum VSLInterfaceMessage, defined in VSLManager.h Param2: data

+CKUIM_DUPLICATEOBJECTS: opens the 'Duplicate Names Found' dialog for a loaded CKFile param1: CKFile*, the loaded file

+CKUIM_OPENVSLSCRIPTEDITOR: opens the VSL Script Manager and edit a specific VSL Script param1: ScriptInterface*, the script interface (see VSL Manager)

+CKUIM_SENDNOTIFICATION: send an interface notification to Virtools. it is used to tell the interface to do something or that something has been done see CUIKNotifications.h in Virtools Interface SDK param1: depends on the notification param2: depends on the notification param3: notification name, found in CUIKNotifications.h from SDK


CKContext::ShowSetup

Method CKContext::ShowSetup

CKERROR CKContext::ShowSetup(CK_ID id)

Opens the setup of an object in Virtools.

Parameters

Input argument id

CK_ID of the object.

Returns

CK_OK if successful, an error code otherwise.

See Also

IsInInterfaceMode,OutputToConsole,Select,ChooseObject


CKContext::UICopyObjects

Method CKContext::UICopyObjects

CKERROR CKContext::UICopyObjects(const XObjectArray& iObjects, CKBOOL iClearClipboard)

Copies a list of objects in the clipboard in Virtools.

Parameters

Input argument iObjects | A XObjectArray containing the objects to copy.
Input argument iClearClipboard | FALSE to append the list to the current clipboard, FALSE to set it as the new clipboard content

Returns

CK_OK if successful, an error code otherwise.

See Also

IsInInterfaceMode,OutputToConsole,ChooseObject,ShowSetup,UIPasteObjects


CKContext::UIPasteObjects

Method CKContext::UIPasteObjects

CKERROR CKContext::UIPasteObjects(const XObjectArray& oObjects)

Pastes a list of objects from the clipboard in Virtools.

Parameters

Input argument oObjects

A XObjectArray that will be filled with the list of pasted objects.

Returns

CK_OK if successful, an error code otherwise.

See Also

IsInInterfaceMode,OutputToConsole,ChooseObject,ShowSetup,UICopyObjects


CKContext::ActivateManager

Method CKContext::ActivateManager

void
CKContext::ActivateManager(CKBaseManager* bm, CKBOOL active)

De/Activates a manager.

Parameters

Input argument bm | manager pointer.
Input argument active | Activity desired for the manager.

Remarks

Deactivating a manager you know you won't use can improve the performance. This function does nothing if the activity is already set.

See Also

CKBaseManager, IsManagerActive ,GetManagerByGuid, GetManager


CKContext::GetAttributeManager

Method CKContext::GetAttributeManager

CKAttributeManager *CKContext::GetAttributeManager()

Returns the Attribute Manager.

Returns

A pointer to the unique instance of the CKAttributeManager for this context

See Also

CKAttributeManager


CKContext::GetBehaviorManager

Method CKContext::GetBehaviorManager

CKBehaviorManager *CKContext::GetBehaviorManager()

Returns the Behavior Manager.

Returns

A pointer to the unique instance of the CKBehaviorManager for this context

See Also

CKBehaviorManager


CKContext::GetInactiveManager

Method CKContext::GetInactiveManager

CKBaseManager*
CKContext::GetInactiveManager(int index)

Returns the ith inactive manager.

Returns

The ith inactive manager.

Remarks

When a two plugins try to register two different implementation of the same manager, only the first to register become active, the other is not activated and is stored in a list.

See Also

CKBaseManager, GetInactiveManagerCount ,GetManagerByGuid, GetManager


CKContext::GetInactiveManagerCount

Method CKContext::GetInactiveManagerCount

int CKContext::GetInactiveManagerCount()

Returns the number of inactive managers.

Returns

number of inactive managers.

Remarks

When a two plugins try to register two different implementation of the same manager, only the first to register become active, the other is not activated and is stored in a list.

See Also

CKBaseManager, GetInactiveManager ,GetManagerByGuid, GetManager


CKContext::GetManager

Method CKContext::GetManager

CKBaseManager *CKContext::GetManager(int index)

Returns the Nth manager

Parameters

Input argument index

Index of the manager to retrieve.

Returns

A pointer to the required Manager

Remarks

This function may be of use if you want to parse the list of registred managers.

See Also

CKBaseManager, RegisterNewManager ,GetManagerByGuid, GetManagerCount


CKContext::GetManagerByGuid

Method CKContext::GetManagerByGuid

CKBaseManager *CKContext::GetManagerByGuid(CKGUID guid)

Returns a manager according to its Guid

Parameters

Input argument guid

CKGUID of the manager to retrieve.

Returns

A pointer to the required Manager

Remarks

Virtools Engines registers default managers at startup. These are :

Class               : GUID                      : Direct Access Function
________________________________________________________________________
CKAttributeManager  : ATTRIBUTE_MANAGER_GUID    : GetAttributeManager
CKBehaviorManager   : BEHAVIOR_MANAGER_GUID     : GetBehaviorManager
CKParameterManager  : PARAMETER_MANAGER_GUID    : GetParameterManager
CKRenderManager     : RENDER_MANAGER_GUID       : GetRenderManager
CKMessageManager    : MESSAGE_MANAGER_GUID      : GetMessageManager
CKTimeManager       : TIME_MANAGER_GUID         : GetTimeManager
CKPathManager       : PATH_MANAGER_GUID         : GetPathManager
CKFloorManager      : FLOOR_MANAGER_GUID        :
CKGridManager       : GRID_MANAGER_GUID         :
CKInterfaceManager  : INTERFACE_MANAGER_GUID (Only valid in interface mode (Virtools) and implemented as an external Dll)
CKShaderManager     : ShaderManagerGUID

See Also

CKBaseManager, RegisterNewManager ,GetManager, GetManagerCount


CKContext::GetManagerByName

Method CKContext::GetManagerByName

CKBaseManager *CKContext::GetManagerByName(CKSTRING ManagerName)

Returns the Manager searching it by name.

Parameters

Input argument ManagerName

String representing the name of the manager to be searched.

Returns

Pointer to the Manager.

Remarks

If the Manager Name is not found it available managers, search is done in duplicate managers.

See Also

CKBaseManager


CKContext::GetManagerCount

Method CKContext::GetManagerCount

int CKContext::GetManagerCount()

Returns the number of registred managers.

Returns

Number of registred managers.

Remarks

This function may be of use if you want to parse the list of registred managers.

See Also

CKBaseManager, CKContext::RegisterNewManager ,GetManagerByGuid, GetManager


CKContext::GetManagers

Method CKContext::GetManagers

XManagerHashTableIt CKContext::GetManagers()

Returns an iterator on the managers

Returns

An hash table iterator on the registered managers.

Remarks

This function may be of use if you want to parse the list of registred managers.

See Also

CKBaseManager, RegisterNewManager ,GetManagerByGuid, GetManagerCount


CKContext::GetMessageManager

Method CKContext::GetMessageManager

CKMessageManager* CKContext::GetMessageManager()

Returns the Message Manager.

Returns

A pointer to the unique instance of the CKMessageManager for this context

See Also

CKMessageManager


CKContext::GetParameterManager

Method CKContext::GetParameterManager

CKParameterManager* CKContext::GetParameterManager()

Returns the Parameter Manager.

Returns

A pointer to the unique instance of the CKParameterManager for this context

See Also

CKParameterManager


CKContext::GetPathManager

Method CKContext::GetPathManager

CKPathManager *CKContext::GetPathManager()

Returns the Path Manager.

Returns

A pointer to the unique instance of the CKPathManager for this context

See Also

CKPathManager


CKContext::GetRenderManager

Method CKContext::GetRenderManager

CKRenderManager *CKContext::GetRenderManager()

Returns a pointer to the Render Manager.

Returns

A pointer to the unique instance of the CKRenderManager for this context.

See Also

CKRenderManager


CKContext::GetTimeManager

Method CKContext::GetTimeManager

CKTimeManager* CKContext::GetTimeManager()

Returns the Time Manager

Returns

A pointer to the unique instance of the CKTimeManager for this context

See Also

CKTimeManager


CKContext::GetVariableManager

Method CKContext::GetVariableManager

CKVariableManager* CKContext::GetVariableManager()

Returns the Variable Manager

Returns

A pointer to the unique instance of the CKVariableManager for this context

See Also

CKVariableManager


CKContext::HasManagerDuplicates

Method CKContext::HasManagerDuplicates

CKBOOL
CKContext::HasManagerDuplicates(CKBaseManager* bm)

Returns TRUE if a manager has duplicates.

Parameters

Input argument bm

manager pointer.

Returns

TRUE if the manager has duplicates, FALSE otherwise.

Remarks

The manager given must be active when calling this function. When a two plugins try to register two different implementation of the same manager, only the first to register become active, the other is not activated and is stored in a list, this method returns whether a manager has such duplicates...

See Also

CKBaseManager, ActivateManager ,GetManagerByGuid, GetManager


CKContext::IsManagerActive

Method CKContext::IsManagerActive

CKBOOL
CKContext::IsManagerActive(CKBaseManager* bm)

Returns the activity of a manager.

Parameters

Input argument bm

manager pointer.

Returns

TRUE if the manager is active, FALSE otherwise.

Remarks

When a two plugins try to register two different implementation of the same manager, only the first to register become active, the other is not activated and is stored in a list. This function returns FALSE if the manager is not registered too.

See Also

CKBaseManager, ActivateManager ,GetManagerByGuid, GetManager


CKContext::RegisterNewManager

Method CKContext::RegisterNewManager

CKERROR CKContext::RegisterNewManager(CKBaseManager *manager)

Registers a new manager.

Parameters

Input argument manager

A pointer to a CKBaseManager or derivated class to register .

Returns

CK_OK if sucessful or CKERR_MANAGERALREADYEXISTS if the manager was already registred.

Remarks

You usually should called this function in the constructor of your manager in order to register it.

Example

CKAttributeManager::CKAttributeManager()
{
    m_Context::RegisterNewManager(this);
    ....
    ....
}

See Also

CKBaseManager,GetManagerByGuid


CKContext::ChangeObjectDynamic

Method CKContext::ChangeObjectDynamic

void
CKContext::ChangeObjectDynamic(CKObject* iObject,CKBOOL iSetDynamic)

Sets/Unset an object to be dynamic.

Parameters

Input argument iObject | The object to change
Input argument iSetDynamic | TRUE to transform a non dynamic object to a dynamic one, FALSE otherwise.

Remarks

When set to dynamic, the object will truly behave like a dynamic one (i.e.will be destroyed at the next reset).

See Also

Dynamic Objects,DestroyAllDynamicObjects


CKContext::CKFillObjectsUnused

Method CKContext::CKFillObjectsUnused

const XObjectPointerArray&
CKContext::CKFillObjectsUnused()

Returns the objects unused in the current scene

Returns

A constant reference on a XObjectPointerArray to fill with the unused objects

Remarks

The objects rendered as considered used, so are the objects referenced in parameters, in arrays and in groups.

See Also

CKScene


CKContext::CopyObject

Method CKContext::CopyObject

CKObject* CKContext::CopyObject(CKObject *src,CKDependencies* Dependencies ,CKSTRING AppendName ,CK_OBJECTCREATION_OPTIONS Options)
const XObjectArray&
CKContext::CopyObjects(const XObjectArray& SrcObjects,CKDependencies* Dependencies ,CK_OBJECTCREATION_OPTIONS Options ,CKSTRING AppendName )

Copy a CKObject or a collection of CKObjects.

Parameters

Input argument src | The CKObject to Copy. SrcObjects: an XObjetcArray of object to copy
Input argument Dependencies | Dependencies to use for the copy. NULL means default copy dependencies. Use CKGetDefaultClassDependencies(CK_DEPENDENCIES_COPY) to get the default copy depencies, or CKCopyDefaultClassDependencies() to copy if to a new CKDependencies and modify it afterward. If you want a full dependencies copy, create a CKDependencies and set its m_Flags member to CK_DEPENDENCIES_FULL. if you want a no-dependencies copy, create an empty CKDependencies.
Input argument AppendName | string to append to the name of the created objects. NULL is the default.
Input argument Options | Copy options. Use CK_OBJECTCREATION_DYNAMIC if you want your created objects to be dynamic.

Returns

A pointer to the newly copied object. A constant reference on a XObjetcArray of the copy of the objects given (at the same index than in the SrcObjects array.)

Remarks

CKObjects created must be destroy with the DestroyObject method. Try to avoid copying the meshes and the textures if you don't have the need for it. Default dependencies will guard you from doing this.

See Also

CKObject,CopyObject,DestroyObject,Class Identifiers


CKContext::CreateObject

Method CKContext::CreateObject

CKObject* CKContext::CreateObject(CK_CLASSID Cid,CKSTRING Name,CK_OBJECTCREATION_OPTIONS Options,CK_CREATIONMODE* Res)

Creates a CKObject or derived class instance.

Parameters

Input argument Cid

Class Identifier (CK_CLASSID) of the object to create.

Returns

A pointer to the newly created or existing object.

Remarks

CKObjects must be destroy with the DestroyObject method.

See Also

CKObject,CopyObject,DestroyObject,Class Identifiers


CKContext::DestroyAllDynamicObjects

Method CKContext::DestroyAllDynamicObjects

void CKContext::DestroyAllDynamicObjects(CKScene* iScene)

Destroy every dynamic objects contained in a scene.

Parameters

Input argument iScene

only the dynamic objects from iScene will be deleted

Remarks

If iScene == NULL all dynamic objects will be deleted. Every dynamic object are automatically delete on a Reset operation but you can flush all the dynamic objects by calling this method. This method does not immediatly destroy the dynamic objects, the deletion will be done at the end of the process loop (Process)

See Also

Dynamic Objects,DestroyObjects


CKContext::DestroyObjects

Method CKContext::DestroyObjects

CKERROR CKContext::DestroyObjects(CK_ID* obj_ids,int Count,CKDWORD Flags,CKDependencies* dep)
CKERROR CKContext::DestroyObject(CKObject *obj,DWORD Flags,CKDependencies* dep)
CKERROR CKContext::DestroyObject(CK_ID id,DWORD Flags,CKDependencies* dep)
void CKDestroyObject(CKObject *o,DWORD Flags,CKDependencies* dep)

Delete CKObjects

Parameters

Input argument obj_ids | A pointer to an array of CK_ID containing the objects to delete.
Input argument Count | Number of ids in obj_ids.
Input argument Flags | CK_DESTROY_FLAGS (Default: 0)
Input argument dep | Dependencies options.

Returns

CK_OK if successful, an error code otherwise.

Remarks

If we are currently in play mode, the deletion will not take place instantly but at the end of the process loop otherwise it takes place immediatly. The Dependencies option controls which dependencies of an object (the CKMesh of a CK3dEntity for example) should be destroyed with it. If a non dynamic object is to be destroyed because of dependencies of a dynamic object, the non dynamic object will NOT be destroyed. The default behavior upon deletion of an object is to notify every objects that maybe interested of this deletion. This can be overriden by using the CK_DESTROY_NONOTIFY flag. In the same manner it happens that temporary CKObjects are created which will not be referenced by other objects , these objects can safely be destroyed using CK_DESTROY_TEMPOBJECT (combinaison of CK_DESTROY_FREEID & CK_DESTROY_NONOTIFY) which will ensure the CK_ID of the temporary object can be re-used by future objects.

See Also

CreateObject,CKDependencies


CKContext::GetObject

Method CKContext::GetObject

CKObject *CKContext::GetObject(CK_ID ObjID)

Returns the object having the given ID

Parameters

ObjID

ID of the object to return

Returns

The object with the given ID. NULL if none.

Remarks

The CKObject class maintains a global ID for each of its instances. The IDs are globally unique and automatically created when the object is created. The GetObject method retrieves the object corresponding to the given ID. The object ID being the equivalent of an index into an object table retrieving objects by their ID is a fast operation.

See Also

CKObject::GetID


CKContext::GetObjectByName

Method CKContext::GetObjectByName

CKObject *CKContext::GetObjectByName(CKSTRING name,CKObject* previous)

Returns the object having the given name without any class restriction.

Returns

The object with the given name. NULL if none.

Remarks

You should avoid using this method which looks amongst all existing object for the one with the given name. This operation can be very slow.

See Also

GetObjectByNameAndClass,GetObjectByNameAndParentClass


CKContext::GetObjectByNameAndClass

Method CKContext::GetObjectByNameAndClass

CKObject *CKContext::GetObjectByNameAndClass(CKSTRING name,CK_CLASSID cid,CKObject* previous)

Returns the object having the given name and from specific class

Returns

The object with the given name. NULL if none.

Remarks

This method refine the search for an object by using its class ID but it does not take class hierarchy into account therefore if you call GetObjectByNameAndClass("Name",CKCID_3DENTITY); only CK3dEntity will be returned (character, bodypart or camera which are child class of CK3dEntity won't be searched). To search an entire class hierarchy use GetObjectByNameAndParentClass.

See Also

GetObjectByName,GetObjectByNameAndParentClass


CKContext::GetObjectByNameAndParentClass

Method CKContext::GetObjectByNameAndParentClass

CKObject *CKContext::GetObjectByNameAndParentClass(CKSTRING name,CK_CLASSID cid,CKObject* previous)

Returns the object having the given name and that is derived from specific ClassID

Returns

The object with the given name. NULL if none.

See Also

GetObjectByName,GetObjectByNameAndClass


CKContext::GetObjectCount

Method CKContext::GetObjectCount

int CKContext::GetObjectCount()

Returns the maximum number of created CKObjects

Returns

The maximum number of allocated CK_IDs.

Remarks

This number is approximative but represents a maximum value.


CKContext::GetObjectListByType

Method CKContext::GetObjectListByType

const XObjectPointerArray&
CKContext::GetObjectListByType(CK_CLASSID cid,CKBOOL derived)

Finds all object of a certain class

Parameters

Input argument cid | Parent Class ID for the object to retrieve.
Input argument derived | TRUE if child class of cid should be returned , FALSE to get only instance of class cid.

Returns

A constant reference to a XObjectPointerArray that will be filled with the list of objects.

Remarks

Fills the given array list with all the object having the given class ID. If the derived argument is TRUE, all the instances of the derived classes are also added to the array.

See Also

GetObjectsCountByClassID,GetObjectsListByClassID


CKContext::GetObjectsCountByClassID

Method CKContext::GetObjectsCountByClassID

int CKContext::GetObjectsCountByClassID(CK_CLASSID cid)

Finds object count of a given class

Parameters

Input argument cid

Class ID of objects to return the number of.

Returns

Number of objects of class cid.

Remarks

This function is used with GetObjectsListByClassID method to iterate through a list of objects of a specific class.

See Also

GetObjectsListByClassID,GetObjectListByType


CKContext::GetObjectSize

Method CKContext::GetObjectSize

int CKContext::GetObjectSize(CKObject *obj)

Returns the memory occupation of a CKObject

Parameters

Input argument obj

A pointer to a CKObject which memory occupation should be returned.

Returns

The memory occupation in bytes of the object taking into account its name and every memory allocated.


CKContext::GetObjectsListByClassID

Method CKContext::GetObjectsListByClassID

CK_ID* CKContext::GetObjectsListByClassID(CK_CLASSID cid)

Returns all object of a given class

Returns

A pointer to an ID array of all objects of this class.

Remarks

The returned pointer must NOT be deleted. This sample iterate through every behavior to count the number of each type (script,building blocks or graphes)

int ScriptCount = 0;
int BuildingBlockCount = 0;
int GraphCount = 0;

int BehCount    = Context->GetObjectsCountByClassID(CKCID_BEHAVIOR);
CK_ID* BehIds   = Context->GetObjectsListByClassID(CKCID_BEHAVIOR);
for (int i = 0; i < BehCount; ++i) {
    CKBehavior* beh = CKBehavior::Cast(Context->GetObject(BehIds[i]));

     if (beh->GetType() == CKBEHAVIORTYPE_SCRIPT) ++ScriptCount;
     else
     if (beh->GetType() == CKBEHAVIORTYPE_BASE) ++BuildingBlockCount;
     else
     if (beh->GetType() == CKBEHAVIORTYPE_BEHAVIOR) ++GraphCount;
}

See Also

GetObjectsCountByClassID,GetObjectListByType


CKContext::IsObjectSafe

Method CKContext::IsObjectSafe

CKBOOL CKContext::IsObjectSafe(CKObject *obj)

Check if the argument object is safe

Parameters

Input argument obj

A pointer to a CKObject to check


CKContext::GetFileInfo

Method CKContext::GetFileInfo

CKERROR CKContext::GetFileInfo(CKSTRING FileName,CKFileInfo* FileInfo)
CKERROR CKContext::GetFileInfo(int BufferSize,void* MemoryBuffer,CKFileInfo* FileInfo)


CKContext::GetLoadedFile

Method CKContext::GetLoadedFile

CKFile* CKContext::GetLoadedFile()


CKContext::SetInterfaceMode

Method CKContext::SetInterfaceMode

void CKContext::SetInterfaceMode(CKBOOL mode,CKUICALLBACKFCT CallBackFct,void *data)

Installs a callback when building a standalone application

Parameters

Input argument CallBackFct

A pointer to a function that will be called to display in console window.

Remarks

This method must NOT be used inside Building blocks or manager, or any plugin that could get loaded inside Virtools. The iIsInDev must always be set to FALSE as this method is to be used outside of Virtools application It can be used inside a standalone application (other than DEV) to have a callback installed that will be called upon specific events.

See Also

CKUICALLBACKFCT,CKUICallbackStruct


CKContext::SetLoadedFile

Method CKContext::SetLoadedFile

void CKContext::SetLoadedFile(CKFile* iFile)


CKContext::WillRenderBothStereoEyes

Method CKContext::WillRenderBothStereoEyes

CKBOOL
CKContext::WillRenderBothStereoEyes()

Remarks

VR Specific


CKContext::EnableProfiling

Method CKContext::EnableProfiling

void CKContext::EnableProfiling(CKBOOL enable)

Enables or disables the profiling mode

Parameters

Input argument enable

A Boolean indicating whether to activate profile mode

Remarks

While profiling is enabled, each active behavior,objects or managers is timed. Enabling the profiling mode adds a small overhead to the execution. The result times can be retrieve with GetProfileStats method

See Also

IsProfilingEnable,GetProfileStats,CKBeObject::GetLastExecutionTime


CKContext::GetLastUserProfileTime

Method CKContext::GetLastUserProfileTime

float CKContext::GetLastUserProfileTime(CKDWORD UserSlot)

Gets last user profile time.

Parameters

Input argument UserSlot

User slot which has to be retrieve.

Returns

Returns the time in milliseconds of last profiling for this user slot.

Remarks

User profile slot times are reset to 0 at the start of each process loop.

See Also

EnableProfiling, UserProfileStart,IsProfilingEnable, GetProfileStats


CKContext::GetProfileStats

Method CKContext::GetProfileStats

void CKContext::GetProfileStats(CKStats *stats)

Returns the results of the profiling of the last process loop.

Parameters

Input argument stats

A pointer to a CKStats structure that will be filled with profiling results.

Remarks

If profiling mode is disabled, the values returned by this method are irrelevant.

See Also

EnableProfiling,IsProfilingEnable,CKStats


CKContext::IsProfilingEnable

Method CKContext::IsProfilingEnable

CKBOOL CKContext::IsProfilingEnable()

Returns whether profiling mode is enabled.

Returns

TRUE if profiling is enabled , FALSE otherwise.

See Also

EnableProfiling,GetProfileStats


CKContext::UserProfileStart

Method CKContext::UserProfileStart

void CKContext::UserProfileStart(CKDWORD UserSlot)
float CKContext::UserProfileEnd(CKDWORD UserSlot)

Starts profiling a subset of code.

Parameters

Input argument UserSlot

User profile slot which has to be initiated (0..7) .

Remarks

User profiling times appear in the profiler dialog in the interface in the details part. Multiple call to the pair UserProfileStart/UserProfileEnd with the same user profile slot can be made in which case the times will be added. A call to UserProfileStart must always be completed by a call to UserProfileEnd with the same profile slot. The time taken by the code can also be retrieve in the return value of UserProfileEnd.

Example

This example profile the time taken by a subset of code,
the result time in ms is stored in ElapsedTime but will also
be visible in the profiled dialog in the interface

   Context->UserProfileStart(0);
   for (int i = 0; i< Count; ++i) {
       ... do something
   }
   float ElapsedTime = Context->UserProfileEnd(0);

See Also

EnableProfiling, GetLastUserProfileTime, IsProfilingEnable, GetProfileStats ,VxTimeProfiler


CKContext::CreateCKFile

Method CKContext::CreateCKFile

CKFile* CKContext::CreateCKFile()

Creates an instance of CKFile

Returns

A pointer to the newly created object

Remarks

Creates an instance of CKFile The CKFile class is NOT derivated from CKObject

See Also

CKFile,DeleteCKFile


CKContext::DeleteCKFile

Method CKContext::DeleteCKFile

CKERROR CKContext::DeleteCKFile(CKFile *file)

Deletes an instance of CKFile

Parameters

Input argument file

A pointer to the CKFile object to delete.

Returns

CK_OK if successful or CKERR_INVALIDPARAMETER if file is NULL

Remarks

Deletes an instance of CKFile

See Also

CKFile,CreateCKFile


CKContext::GetLastCmoLoaded

Method CKContext::GetLastCmoLoaded

CKSTRING CKContext::GetLastCmoLoaded()

Gets the last composition file (.CMO) loaded.

Returns

Name(string) of the CMO file that is last loaded.

See Also

CKLoad, SetLastCmoLoaded


CKContext::GetLastFileLoaded

Method CKContext::GetLastFileLoaded

CKSTRING CKContext::GetLastFileLoaded()

Returns the last file loaded.

Returns

Name(string) of the last loaded file.

See Also

Load,GetLastCmoLoaded


CKContext::GetLastFileSaved

Method CKContext::GetLastFileSaved

CKSTRING CKContext::GetLastFileSaved()

Gets the last file saved.

Returns

Name(string) of the last file that was saved.

See Also

CKLoad, SetLastCmoLoaded


CKContext::IsInLoad

Method CKContext::IsInLoad

CKBOOL CKContext::IsInLoad()

Checks if a file is currently being loaded

Returns

TRUE if a file is currently being loaded, FALSE otherwise.

Remarks

Since callbacks function can be called during a load operation this method can be called from these callbacks to know if a file is being loaded.

See Also

Load,IsInSave


CKContext::IsInSave

Method CKContext::IsInSave

CKBOOL CKContext::IsInSave()

Checks if a file is currently being saved

Returns

TRUE if a file is currently being saved, FALSE otherwise.

Remarks

Since callbacks function can be called during a load operation this method can be called from these callbacks to know if a file is being saved.

See Also

Load,IsInLoad


CKContext::Load

Method CKContext::Load

CKERROR CKContext::Load(CKSTRING FileName,CKObjectArray *liste,CK_LOAD_FLAGS LoadFlags,CKGUID* ReaderGuid)
CKERROR CKContext::Load(int BufferSize,void* MemoryBuffer,CKObjectArray *ckarray,CK_LOAD_FLAGS LoadFlags)

Loads a file.

Parameters

Input argument FileName | The path to the file to load.
Input argument liste | A pointer to a CKObjectArray that will contain the loaded objects
Input argument ReaderGuid | NULL to let CK find the appropriate plugin based on the file extension or the CKGUID of a specific reader plugin.
Input argument BufferSize | Size in byte of the buffer to load
Input argument MemoryBuffer | A pointer to a memory buffer than contains a Virtools file.
LoadFlags | A combination of CK_LOAD_FLAGS.

Returns

CK_OK if successful or an error code otherwise.

Remarks

Load is the designated method for loading CKObjects from files. These files can be Virtools files containing whole compositions, simple Virtools objects like character, state files containing the state of objects, or external files, like 3DS,X files, etc...

Load creates instances of CKObject. All the instances created are appended to the given array.

Load creates new global IDs for each loaded object. If the file is a Virtools file containing more than one Virtools object, these objects mutual references are preserved.

This has a tricky consequence: if you save a set of object and then load it back into the same environment without deleteing the saved objects in the meantime (either individually, either globally), the Load function will create duplicates of the objects, with analogous content, but different globals IDs.

The second version of CKLoad use a memory buffer to load objects. This version can only load Virtools file format.

See Also

Save


CKContext::LoadAnimationOnCharacter

Method CKContext::LoadAnimationOnCharacter

CKERROR CKContext::LoadAnimationOnCharacter(int BufferSize,void* MemoryBuffer,CKObjectArray *ckarray,CKCharacter *carac,BOOL AsDynamicObjects)
CKERROR CKContext::LoadAnimationOnCharacter(CKSTRING FileName,CKObjectArray *liste,CKCharacter *carac,CKGUID* ReaderGuid,BOOL AsDynamicObjects)

Loads an animation file and adds the animation to the given character.

Parameters

Input argument FileName | The path to the file to load.
Input argument liste | A pointer to a CKObjectArray that will contain the loaded objects
Input argument ReaderGuid | NULL to let CK find the appropriate plugin based on the file extension or the CKGUID of a specific reader plugin.
Input argument BufferSize | Size in byte of the buffer to load
Input argument MemoryBuffer | A pointer to a memory buffer than contains a Virtools file.
Input argument carac | A pointer to the CKCharacter that should receive the loaded animation.
Input argument AsDynamicObjects | A boolean to indicate if created animations should be dynamic objects (See Dynamic Objects).

Returns

CK_OK if successful or an error code otherwise.

Remarks

The second version of LoadAnimationOnCharacter use a memory buffer to load objects. This version can only load a Virtools file format.

See Also

Save


CKContext::Save

Method CKContext::Save

CKERROR CKContext::Save(CKSTRING FileName,CKObjectArray *List,CKDWORD SaveFlags,CKDependencies *dependencies,CKGUID* ReaderGuid)

Saves objects to a file

Parameters

Input argument FileName | Path to the file liste: A CKObjectArray that contains the objects to save.
Input argument SaveFlags | unused (set to 0xFFFFFFFF)
Input argument dependencies | Dependencies options

Returns

CK_OK is success

Remarks

Save is the designated method for saving Virtools objects to file. You can load back the file with Load method.

All the objects passed in the given CKObjectArray are saved to the file, as well as objects that are referenced by them, and this recursively, so that if the file is loaded in an empty environment, a consistent set of ready to use objects is instanciated.

All objects are stored with their IDs, in a way so that future loading of the file produces a ready to use set of objects.

The dependencies options specifies which references an object should save with. For example a 3DObject can be saved with or without its meshes and materials

See Also

Load,CKDependencies


CKContext::SetLastFileSaved

Method CKContext::SetLastFileSaved

void CKContext::SetLastFileSaved(CKSTRING str)

Sets the last saved file name.

Returns

Name(string) of the last file that was saved.

See Also

CKLoad, SetLastCmoLoaded


CKContext::SetStreamWriter

Method CKContext::SetStreamWriter

void CKContext::SetStreamWriter(CKStreamWriter* iStreamWriter)

Installs an object to perform the serialization of CMO files.

Parameters

Input argument iStreamWriter

A pointer to a CKStreamWriter instance that will be used to save files, NULL resets the framework to use the default writer to a file.

Remarks

The default behavior of the save operations is to write a file on a disk. This behavior can be overriden to have a composition save in any form of stream (for example saving to a memory buffer). If you use this function to change the save behavior before saving a file, take care to reset the writer back by calling SetStreamWriter(NULL);

See Also

CKStreamWriter


CKContext::GetCompressionLevel

Method CKContext::GetCompressionLevel

int CKContext::GetCompressionLevel()

Returns the compression level used when saving files.

Returns

Current compression level (0..10).

See Also

SetCompressionLevel


CKContext::GetFileWriteMode

Method CKContext::GetFileWriteMode

CK_FILE_WRITEMODE CKContext::GetFileWriteMode()

Returns the current file writing mode (compression)

Returns

Current file writing mode.

Remarks

File write mode controls the format of a Virtools file when saved. More specifically it controls whether compression is enabled and also if the Virtools Interface specific data should be stored in the file (if CKFILE_FORVIEWER flag is set , no interface data is saved)

See Also

CK_FILE_WRITEMODE,SetFileWriteMode,SetCompressionLevel,SetGlobalImagesSaveOptions,SetGlobalSoundsSaveOptions


CKContext::GetGlobalImagesSaveFormat

Method CKContext::GetGlobalImagesSaveFormat

CKBitmapProperties* CKContext::GetGlobalImagesSaveFormat()

Returns the format used to save images.

Returns

Global image save format.

Remarks

Each image can have its own format to be stored when saving a composition but it can also use the global settings.

See Also

CKBitmapProperties,SetGlobalImagesSaveFormat,SetGlobalImagesSaveOptions,SetGlobalSoundsSaveOptions


CKContext::GetGlobalImagesSaveOptions

Method CKContext::GetGlobalImagesSaveOptions

CK_TEXTURE_SAVEOPTIONS CKContext::GetGlobalImagesSaveOptions()

Returns the global options for image (textures and sprites) saving.

Returns

Global texture and sprite save options.

Remarks

Each texture or sprite can have its own options as how and where it should be stored when saving a composition but it can also use the global settings.

See Also

CK_TEXTURE_SAVEOPTIONS,SetGlobalImagesSaveOptions,SetGlobalSoundsSaveOptions,SetGlobalImagesSaveFormat,GetGlobalImagesSaveFormat


CKContext::GetGlobalSoundsSaveOptions

Method CKContext::GetGlobalSoundsSaveOptions

CK_SOUND_SAVEOPTIONS CKContext::GetGlobalSoundsSaveOptions()

Returns the global options for sound saving.

Returns

Global sound save options.

Remarks

Each sound can have its own options as how and where it should be stored when saving a composition but it can also use the global settings.

See Also

CK_SOUND_SAVEOPTIONS,SetGlobalImagesSaveOptions,SetGlobalSoundsSaveOptions,SetGlobalImagesSaveFormat,GetGlobalImagesSaveFormat


CKContext::SetCompressionLevel

Method CKContext::SetCompressionLevel

void CKContext::SetCompressionLevel(int level)

Sets the compression level used when saving files.

Parameters

Input argument level

Compression Level.

Remarks

The level of compression is an integer between 0 and 10. 10 gives the maximum compression level but is also slower. Best compromise between speed and size if found with values between 3 and 6. The level of compression applies when saving files with the option CKFILE_WHOLECOMPRESSED.

See Also

CKUnPackData,CKComputeDataCRC,SetFileWriteMode,GetCompressionLevel


CKContext::SetFileWriteMode

Method CKContext::SetFileWriteMode

void CKContext::SetFileWriteMode(CK_FILE_WRITEMODE mode)

Sets the current file writing mode (compression).

Parameters

Input argument mode

Mode for writing when saving files.

Remarks

File write mode controls the format of a Virtools file when saved. More specifically it controls whether compression is enabled and also if the Virtools Interface specific data should be stored in the file (if CKFILE_FORVIEWER flag is set , no interface data is saved)

See Also

CK_FILE_WRITEMODE,GetFileWriteMode,SetCompressionLevel,SetGlobalImagesSaveOptions,SetGlobalSoundsSaveOptions


CKContext::SetGlobalImagesSaveFormat

Method CKContext::SetGlobalImagesSaveFormat

void CKContext::SetGlobalImagesSaveFormat(CKBitmapProperties* Format)

Sets the format used to save images.

Parameters

Input argument Format

A pointer to a CKBitmapProperties structure that contain the format and reader to use to save images.

Remarks

Each sound can have its own options as how and where it should be stored when saving a composition but it can also use the global settings.

See Also

CKBitmapProperties,GetGlobalImagesSaveFormat,SetGlobalImagesSaveOptions,SetGlobalSoundsSaveOptions


CKContext::SetGlobalImagesSaveOptions

Method CKContext::SetGlobalImagesSaveOptions

void CKContext::SetGlobalImagesSaveOptions(CK_TEXTURE_SAVEOPTIONS Options)

Sets the global options for image (textures and sprites) saving.

Parameters

Input argument Options

Global texture and sprite save options to be set.

Remarks

Each texture or sprite can have its own options as how and where it should be stored when saving a composition but it can also use the global settings.

See Also

CK_TEXTURE_SAVEOPTIONS,GetGlobalImagesSaveOptions,SetGlobalSoundsSaveOptions,SetGlobalImagesSaveFormat,GetGlobalImagesSaveFormat


CKContext::SetGlobalSoundsSaveOptions

Method CKContext::SetGlobalSoundsSaveOptions

void CKContext::SetGlobalSoundsSaveOptions(CK_SOUND_SAVEOPTIONS Options)

Sets the global options for sounds saving.

Parameters

Input argument Options

Global sound save options to be set.

Remarks

Each sound can have its own options as how and where it should be stored when saving a composition but it can also use this global settings.

See Also

CK_SOUND_SAVEOPTIONS,SetGlobalImagesSaveOptions,GetGlobalSoundsSaveOptions


CKContext::GetSelectedRenderEngine

Method CKContext::GetSelectedRenderEngine

int CKContext::GetSelectedRenderEngine()

Returns the index of the currently selected render engine

Returns

index of the current render engine.

Remarks

A render engine is selected at startup in CKCreateContext function. This index refers to the list of available Render Engine plugins in the CKPluginManager.

See Also

GetRenderEngineCount,CKGetRenderEngineDescription


CKContext::GetStartOptions

Method CKContext::GetStartOptions

CKDWORD CKContext::GetStartOptions()

Returns the options selected at start-up

Returns

The options passed to CKCreateContext function.

Remarks

This method returns the options used to create this context.

See Also

CKCreateContext


CKContext::CreateCKParameterIn

Method CKContext::CreateCKParameterIn

CKParameterIn* CKContext::CreateCKParameterIn(CKSTRING Name,CKParameterType type,CKBOOL Dynamic)
CKParameterIn* CKContext::CreateCKParameterIn(CKSTRING Name,CKGUID guid,CKBOOL Dynamic)
CKParameterIn* CKContext::CreateCKParameterIn(CKSTRING Name,CKSTRING TypeName,CKBOOL Dynamic)

Creates an instance of CKParameterIn

Parameters

Input argument type | the index of the parameter type
Dynamic | TRUE to create a dynamic object, FALSE otherwise.

Returns

A pointer to the newly created object

Remarks

Creates a new empty instance of the CKParameterIn class, with:

the specified type no owner, no source It is better to use the CKBehavior::CreateInputParameter or CKBehavior::InsertInputParameter methods.

See Also

CKParameterIn,Pre-Registred Parameter Types,Dynamic Objects


CKContext::CreateCKParameterLocal

Method CKContext::CreateCKParameterLocal

CKParameterLocal* CKContext::CreateCKParameterLocal(CKSTRING Name,CKSTRING TypeName,CKBOOL Dynamic)
CKParameterLocal* CKContext::CreateCKParameterLocal(CKSTRING Name,CKParameterType type,CKBOOL Dynamic)
CKParameterLocal* CKContext::CreateCKParameterLocal(CKSTRING Name,CKGUID guid,CKBOOL Dynamic)

Creates an instance of CKParameterLocal

Returns

A pointer to the newly created object

Remarks

Creates a new empty instance of the CKParameterLocal class, with: the specified type no owner, no data It is better to use the CKBehavior::CreateLocalParameter or CKBehavior::InsertLocalParameter methods if the parameter is to be used in a behavior.

See Also

CKParameterOut,Pre-Registred Parameter Types,Dynamic Objects


CKContext::CreateCKParameterOperation

Method CKContext::CreateCKParameterOperation

CKParameterOperation* CKContext::CreateCKParameterOperation(CKSTRING Name,CKGUID opguid,CKGUID ResGuid, CKGUID p1Guid, CKGUID p2Guid)

Creates an instance of CKParameterOperation from an operation GUID and parameters GUIDs

Returns

A new parameter operation instance.

See Also

CKParameterOperation,ParameterOperation Types


CKContext::CreateCKParameterOut

Method CKContext::CreateCKParameterOut

CKParameterOut* CKContext::CreateCKParameterOut(CKSTRING Name,CKParameterType type,CKBOOL Dynamic)
CKParameterOut* CKContext::CreateCKParameterOut(CKSTRING Name,CKGUID guid,CKBOOL Dynamic)
CKParameterOut* CKContext::CreateCKParameterOut(CKSTRING Name,CKSTRING TypeName,CKBOOL Dynamic)

Creates an instance of CKParameterOut

Returns

A pointer to the newly created object

Remarks

Creates a new empty instance of the CKParameterOut class, with: the specified type no owner, no data It is better to use the CKBehavior::CreateOutputParameter or CKBehavior::InsertOutputParameter methods if the parameter is to be used in a behavior.

See Also

CKParameterOut,Pre-Registred Parameter Types,Dynamic Objects


CKContext::CreateCKParameterVariable

Method CKContext::CreateCKParameterVariable

CKParameterVariable* CKContext::CreateCKParameterVariable(CKSTRING Name,CKBOOL Dynamic)

Creates an instance of CKParameterVariable

Returns

A pointer to the newly created object

See Also

CKParameterOut,CKVariableManager


CKContext::DumpObjectManagerMemoryUse

Method CKContext::DumpObjectManagerMemoryUse

CKBOOL CKContext::DumpObjectManagerMemoryUse(CKSTRING DumpFilename,CKBOOL DumpAllObjects)

Dumps the memory use of the object managers members and memory usage of CKObjects in a text file.

Returns

TRUE is the function succeeded FALSE otherwise..

Remarks

This method is very usefull to monitor the memory usage. CKObjet::GetMemoryOccupation can also be used.


CKContext::GetMainWindow

Method CKContext::GetMainWindow

void* CKContext::GetMainWindow()

Returns the handle to the main application window

Returns

A Window Handle (HWND on windows platform) of the main application.

Remarks

This method returns the handle of the window that was given to the CKCreateContext function.


CKContext::GetSecureGuid

Method CKContext::GetSecureGuid

CKGUID CKContext::GetSecureGuid()

Returns a newly created secure GUID

Returns

A CKGUID that can be used to register a parameter type,operation,Behavior or Manager. This function tests the generated GUID against any existent GUID to ensure its uniqueness.


CKGroup

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKGroup

Remarks

Behavioral Objects can be grouped together because they share common attributes or for better understanding of a level. A group is simply a list of objects that can be removed or added.

The class id of CKGroup is CKCID_GROUP.

Groups

Access Functions
Method GetObject | Returns the 'pos'th object in the group
Method GetObjectCount | Returns the number of object in the group
Management Functions
Method AddObject | Adds an object to the group.
Method AddObjectFront | Adds an object to the start of the group.
Method Clear | Removes all the objects from a group
Method GetCommonClassID | Returns the common class identifier of objects in the group
Method InsertObjectAt | Adds an object CK to the group at the specified position
Method MoveObjectUp | Moves an object up or down in the list of objects.
Method RemoveObject | Removes an object from the group

See Also

CKBeObject


CKGroup::GetObject

Method CKGroup::GetObject

CKBeObject *CKGroup::GetObject(int pos)

Returns the 'pos'th object in the group

Parameters

Input argument pos

Index of the object to find

Returns

A pointer to the object, NULL if there is no object at this index

Remarks

Return a pointer the 'pos'th object in the group, or NULL if there is no object at this index.

See Also

CKGroup, CKGroup::GetObjectCount


CKGroup::GetObjectCount

Method CKGroup::GetObjectCount

int CKGroup::GetObjectCount()

Returns the number of object in the group

Returns

The total number of object in the group, 0 if it is empty

Remarks

Returns the number of object in the group. Use this function with the GetObject() to iterate all the object of a group.

Example

   for(int i=0;i<group->GetObjectCount;i++) {
       object = group->GetObject(i);
Place here the code to do
Whatever you want to do
to each member of the group
   }

See Also

CKGroup, CKGroup::GetObjectCount


CKGroup::AddObject

Method CKGroup::AddObject

CKERROR CKGroup::AddObject(CKBeObject *o)

Adds an object to the group.

Parameters

Input argument o

A pointer to the CKBeObject to add.

Returns

If the function succeeds, the return value is CK_OK. If the function fails, the return value may be one of the following error values: CKERR_INVALIDPARAMETER : The given object isn't valid CKERR_ALREADYPRESENT : The object was already in the group

Remarks

Adds an object to the group, assuming it isn't in yet. The object is inserted at the end of the group. Use AddObjectFront to add it to the start.

See Also

CKGroup, CKGroup::AddObjectFront, CKGroup::RemoveObject


CKGroup::AddObjectFront

Method CKGroup::AddObjectFront

CKERROR CKGroup::AddObjectFront(CKBeObject *o)

Adds an object to the start of the group.

Parameters

Input argument o

A pointer to the CKBeObject to add.

Returns

If the function succeeds, the return value is CK_OK. If the function fails, the return value may be one of the following error values: CKERR_INVALIDPARAMETER : the given object isn't valid CKERR_ALREADYPRESENT : the object was already in the group

Remarks

Adds an object CK to the group, assuming it isn't in yet. The object is inserted at the start of the group. Use AddObject to add it to the end.

See Also

CKGroup, CKGroup::AddObject, CKGroup::RemoveObject


CKGroup::Clear

Method CKGroup::Clear

void CKGroup::Clear()

Removes all the objects from a group

Remarks

Removes all the objects from a group.

See Also

CKGroup, CKGroup::AddObject


CKGroup::GetCommonClassID

Method CKGroup::GetCommonClassID

CK_CLASSID CKGroup::GetCommonClassID()

Returns the common class identifier of objects in the group

Returns

The base common CK_CLASSID of objects in the group.

Remarks

If a group contains only 3d entities this function will return CKCID_3DENTITY for example The least class ID that can be returned is CKCID_BEOBJECT

See Also

CKGroup, CK_CLASSID


CKGroup::InsertObjectAt

Method CKGroup::InsertObjectAt

CKERROR CKGroup::InsertObjectAt(CKBeObject *o,int pos)

Adds an object CK to the group at the specified position

Parameters

Input argument o | A pointer to the CKBeObject to add.
Input argument pos | Position in the list.

Returns

If the function succeeds, the return value is CK_OK. If the function fails, the return value may be one of the following error values: CKERR_INVALIDPARAMETER : the given object isn't valid CKERR_ALREADYPRESENT : the object was already in the group

Remarks

Adds an object CK to the group, assuming it isn't in yet. The object is inserted at the specified position in the group. Use AddObject to add it to the end.

See Also

CKGroup, CKGroup::AddObject, CKGroup::RemoveObject, AddObjectFront


CKGroup::MoveObjectUp

Method CKGroup::MoveObjectUp

void CKGroup::MoveObjectUp(CKBeObject *obj)
void CKGroup::MoveObjectDown(CKBeObject *obj)

Moves an object up or down in the list of objects.

Parameters

o : CKObject to move

Remarks

Moving an object up makes it closer to the start of the list of objects.

See Also

AddObject,InsertObjectAt


CKGroup::RemoveObject

Method CKGroup::RemoveObject

CKBeObject *CKGroup::RemoveObject(int pos)
void CKGroup::RemoveObject(CKBeObject *obj)

Removes an object from the group

Parameters

Input argument pos | the position in the group of the object you want to remove
Input argument obj | a pointer to the object you want to remove

Returns

A pointer to the removed object for the function which takes an index as argument.

Remarks

Removes an object from the group, by giving either a pointer to the object you want to remove, or an index number in the group. If the object isn't in the group, or if the index number is outside the limits of the group, nothing occurs.

See Also

CKGroup, CKGroup::AddObject


CKLevel

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKLevel

Remarks

A composition must contain an unique CKLevel object accessible through CKContext::GetCurrentLevel The level manages a list of CKScene and provides the methods to switch from one scene to another. All objects used in the composition must be referenced in the level in order to be saved.

The level also manages a list of CKRenderContext on which the rendering should be done. It uses this list to automatically add an object to the rendercontext when it is added to the level.

A Level automatically creates a scene it owns. This scene is called the Level Scene and is used to store the reference of every objects in the composition. This scene contains additionnal informations about objects such as how do they behave at startup or initial conditions.

The class id of CKLevel is CKCID_LEVEL.

Groups

Object Managememt | Scenes | Places | Active Scene | Render Contextes | Object Management

Object Managememt
Method AddObject | Adds an object to the level.
Method ComputeObjectList | Fills an array with a list of objects present in the level according to their class.
Method RemoveObject | Removes an object from the level.
Scenes
Method AddScene | Adds a scene to the level.
Method GetLevelScene | Returns the level default scene
Method GetScene | Returns a scene given its index.
Method GetSceneCount | Returns the number of scenes in the level.
Method GetSceneIn | Returns the Nth scene in which this object is present.
Method GetSceneInCount | Returns the number of scenes in which this object is present.
Method IsInScene | Returns whether an object is in the scene.
Method Merge | Merges another level inside this level
Method RemoveScene | Removes a scene from the level.
Places
Method AddPlace | Adds a place to the level.
Method GetPlace | Returns a place given its index.
Method GetPlaceCount | Returns the number of places in the level.
Method RemovePlace | Removes a place from level.
Active Scene
Method GetCurrentScene | Returns the current active scene
Method LaunchScene | Immediatly Activates a new scene.
Method SetNextActiveScene | Sets the next active scene.
Render Contextes
Method AddRenderContext | Adds a render context to the level.
Method GetRenderContext | Gets a render context at a given position.
Method GetRenderContextCount | Returns the number of render contextes in the level.
Method RemoveRenderContext | Removes a render context from the level.
Object Management
Method BeginAddSequence | Warns that several objects are being added sequentially of the level or scene.
Method BeginRemoveSequence | Warns that several objects are being removed sequentially of the level or scene.

See Also

CKContext::GetCurrentLevel,CKScene


CKLevel::AddObject

Method CKLevel::AddObject

CKERROR CKLevel::AddObject(CKObject *obj)

Adds an object to the level.

Parameters

Input argument obj

A pointer to CKObject to be added to level.

Returns

CK_OK if successful, error code otherwise.

Remarks

+An object must be added to the level to be processed or drawn. +Adding a object to the level automatically adds it to the level scene along with its dependencies. +To iterate through the list of objects in the level, retrieve the level scene with GetLevelScene method and use the scene iteration method ( CKScene::GetObjectIterator)

See Also

RemoveObject,CKScene,GetLevelScene,CKScene::GetObjectIterator


CKLevel::ComputeObjectList

Method CKLevel::ComputeObjectList

const XObjectPointerArray&
CKLevel::ComputeObjectList(CK_CLASSID cid,CKBOOL derived)

Fills an array with a list of objects present in the level according to their class.

Parameters

Input argument cid | Class identifier of the objects to be retrieved.
Input argument derived | TRUE to include objects derived from the given class.

Returns

A constant reference on a XObjectPointerArray filled with the objects

Remarks

Since this method fills an array with the list of objects it can be slower than using the CKScene::GetObjectIterator method to iterate through all the objects and choose the objects your interested in.

See Also

AddObject,CKScene::GetObjectIterator


CKLevel::RemoveObject

Method CKLevel::RemoveObject

CKERROR CKLevel::RemoveObject(CKObject *obj)
CKERROR CKLevel::RemoveObject(CK_ID objid)

Removes an object from the level.

Parameters

Input argument obj | Pointer to CKObject to be deleted from the level.
Input argument objid | CK_ID of the CKObject to be deleted from the level.

Returns

CK_OK if deleting object is successful, error code otherwise.

Remarks

+Removing an object from the level does not destroy it. +To iterate through the list of objects in the level, retrieve the level scene with GetLevelScene method and use the scene iteration method ( CKScene::GetObjectIterator)

See Also

AddObject


CKLevel::AddScene

Method CKLevel::AddScene

CKERROR CKLevel::AddScene(CKScene *scn)

Adds a scene to the level.

Parameters

Input argument scn

Pointer to CKScene to be added to the level.

Returns

CK_OK if addition is successful, error code otherwise.

See Also

GetScene,GetSceneCount,AddScene,GetLevelScene


CKLevel::GetLevelScene

Method CKLevel::GetLevelScene

CKScene* CKLevel::GetLevelScene()

Returns the level default scene

Returns

Default scene object representing the level.

See Also

GetScene,GetSceneCount,AddScene,RemoveScene


CKLevel::GetScene

Method CKLevel::GetScene

CKScene *CKLevel::GetScene(int pos)

Returns a scene given its index.

Parameters

Input argument pos

Index of the scene in the list of scenes.

Returns

A Pointer to CKScene or NULL if the given index was invalid.

See Also

GetScene,GetSceneCount,AddScene,RemoveScene


CKLevel::GetSceneCount

Method CKLevel::GetSceneCount

int CKLevel::GetSceneCount()

Returns the number of scenes in the level.

Returns

Number of Scenes in the level.

See Also

GetScene,RemoveScene,AddScene,GetLevelScene


CKLevel::Merge

Method CKLevel::Merge

CKERROR CKLevel::Merge(CKLevel *mergedLevel,CKBOOL asScene)

Merges another level inside this level

Parameters

Input argument mergedLevel | A pointer to the CKLevel to merge with this one
Input argument asScene | TRUE if merged level should generate a new scene inside this level or FALSE to

Returns

CK_OK if successful, an error code otherwise

Remarks

Every element in mergedLevel will be added to this level. If asScene is TRUE a new scene is created and all elements are referenced in it otherwise this level default scene will reference all the merged objects.

See Also

CKScene::Merge


CKLevel::RemoveScene

Method CKLevel::RemoveScene

CKScene *CKLevel::RemoveScene(int pos)
CKERROR CKLevel::RemoveScene(CKScene *scn)

Removes a scene from the level.

Parameters

Input argument scn | A CKScene pointer to be removed from the level.
Input argument pos | Index of the scene in the list of scenes.

Returns

A pointer to the CKScene removed.

See Also

GetScene,GetSceneCount,AddScene,GetLevelScene


CKLevel::AddPlace

Method CKLevel::AddPlace

CKERROR CKLevel::AddPlace(CKPlace *pl)

Adds a place to the level.

Parameters

Input argument pl

A CKPlace pointer to be added to the level.

Returns

CK_OK if successful, error code otherwise.

Remarks

A place is a special kind of 3D Entity that can be used to perform quick rejection of objects during rendering.

See Also

CKPlace,GetPlaceCount,GetPlace,RemovePlace


CKLevel::GetPlace

Method CKLevel::GetPlace

CKPlace *CKLevel::GetPlace(int pos)

Returns a place given its index.

Parameters

Input argument pos

Index of the place in the list of places.

Returns

A pointer to CKPlace if place is present, or NULL if the given index was invalid.

See Also

CKPlace,GetPlaceCount,AddPlace,RemovePlace


CKLevel::GetPlaceCount

Method CKLevel::GetPlaceCount

int CKLevel::GetPlaceCount()

Returns the number of places in the level.

Returns

Number of places in the level.

See Also

CKPlace,RemovePlace,GetPlace,AddPlace


CKLevel::RemovePlace

Method CKLevel::RemovePlace

CKPlace *CKLevel::RemovePlace(int pos)
CKERROR CKLevel::RemovePlace(CKPlace *pl)

Removes a place from level.

Parameters

Input argument pl | A Pointer to CKPlace to be removed from the level.
Input argument pos | Index of the place in the list of places.

Returns

A pointer to the CKPlace that was removed.

See Also

CKPlace,GetPlaceCount,GetPlace,AddPlace


CKLevel::GetCurrentScene

Method CKLevel::GetCurrentScene

CKScene* CKLevel::GetCurrentScene()

Returns the current active scene

Returns

A pointer to the current active scene.

See Also

CKScene,SetNextActiveScene


CKLevel::LaunchScene

Method CKLevel::LaunchScene

CKERROR CKLevel::LaunchScene(CKScene *scene,CK_SCENEOBJECTACTIVITY_FLAGS Activity,CK_SCENEOBJECTRESET_FLAGS Reset)

Immediatly Activates a new scene.

Parameters

Input argument scene | Scene to become active.
Input argument Activity | Activation flags for the scene.
Input argument Reset | Reset flags for the scene.

Returns

CK_OK if successful or an error code otherwise.

Remarks

+Activity and Reset flags determine the way objects and scripts will be initialized when launching the scene. +When a behavior wants to set a new active scene it cannot directly use LaunchScene in the middle of the process loop but must use SetNextActiveScene() method to warn the engine of the scene to become active at the beginning of the next process loop. +If textures were used in the previous scene they are all removed from the video memory. +All the behaviors are warned of the activation of a new scene.

See Also

CKScene, SetNextActiveScene, CK_SCENEOBJECTACTIVITY_FLAGS, CK_SCENEOBJECTRESET_FLAGS


CKLevel::SetNextActiveScene

Method CKLevel::SetNextActiveScene

CKERROR CKLevel::SetNextActiveScene(CKScene *scene,CK_SCENEOBJECTACTIVITY_FLAGS Activity,CK_SCENEOBJECTRESET_FLAGS Reset)

Sets the next active scene.

Parameters

Input argument scene | The scene to become active.
Input argument Activity | Activation flags for the scene and its objects.
Input argument Reset | Reset flags for the scene and its objects.

Returns

CK_OK if successful or an error code otherwise.

Remarks

+This method sets the scene which must become active at the next process loop. +When a behavior wants to set a new active scene it cannot directly use LaunchScene but must use this method to warn the engine of the scene to become active in the next process loop. +Activity and Reset flags determine the way objects and scripts will be initialized when launching the scene.

See Also

CKScene, LaunchScene,CK_SCENEOBJECTACTIVITY_FLAGS, CK_SCENEOBJECTRESET_FLAGS


CKLevel::AddRenderContext

Method CKLevel::AddRenderContext

void CKLevel::AddRenderContext(CKRenderContext *context,CKBOOL Main)

Adds a render context to the level.

Parameters

Input argument context | A CKRenderContext on which the objects of the level will be drawn.
Input argument Main | TRUE if the context is main one.

Remarks

+A level can have several render contextes on which it renders the objects but most of the time only one is used. +Amongst all the render contextes one is to be chosen as the “main” one.

See Also

CKRenderContext,RemoveRenderContext,GetRenderContextCount,GetRenderContext


CKLevel::GetRenderContext

Method CKLevel::GetRenderContext

CKRenderContext *CKLevel::GetRenderContext(int pos)

Gets a render context at a given position.

Parameters

Input argument pos

Index of the render context in the level.

Returns

A pointer to the render context or NULL if an invalid index was given.

See Also

CKRenderContext,AddRenderContext,RemoveRenderContext,GetRenderContext


CKLevel::GetRenderContextCount

Method CKLevel::GetRenderContextCount

int CKLevel::GetRenderContextCount()

Returns the number of render contextes in the level.

Returns

Number of rendering contextes in the level.

See Also

CKRenderContext,AddRenderContext,RemoveRenderContext,GetRenderContext


CKLevel::RemoveRenderContext

Method CKLevel::RemoveRenderContext

void CKLevel::RemoveRenderContext(CKRenderContext *context)

Removes a render context from the level.

Parameters

Input argument context

Render context to be removed.

See Also

CKRenderContext,AddRenderContext,GetRenderContextCount,GetRenderContext


CKLevel::BeginAddSequence

Method CKLevel::BeginAddSequence

void CKLevel::BeginAddSequence(CKBOOL Begin)

Warns that several objects are being added sequentially of the level or scene.

Parameters

Input argument Begin

TRUE to warn the start of the sequence, FALSE to end it.

Remarks

+When an object is added to the level or scene, Managers can be warned of this operation. +This method enables the user to warn the engine that several call to AddObject are about to occur so that it can send the notifications only once when all the objects have been added.

See Also

AddObject,BeginRemoveSequence


CKLevel::BeginRemoveSequence

Method CKLevel::BeginRemoveSequence

void CKLevel::BeginRemoveSequence(CKBOOL Begin)

Warns that several objects are being removed sequentially of the level or scene.

Parameters

Input argument Begin

TRUE to warn the start of the sequence, FALSE to end it.

Remarks

+When an object is removed from the level or scene, Managers can be are warned of this operation. +This method enables the user to warn the engine that several call to AddObject are about to occur so that it can send the notifications only once when all the objects have been removed.

See Also

RemoveObject,BeginAddSequence


CKObject

Class CKObject

Base class for most CK objects

Subclasses

CKBehaviorIO, CKBehaviorLink, CKCriticalSectionObject, CKInterfaceObjectManager, CKKinematicChain, CKLayer, CKParameter, CKParameterIn, CKParameterOperation, CKRenderContext, CKSceneObject, CKStateObject, and CKSynchroObject

Remarks

This is the base class for all objects of Virtools. You usually don't need to create an instance of CKObject, though this is possible. You usually create instances of classes derived of CKObject (See CKContext::CreateObject). CKObject provides functionnalities that are applicable to all its derived classes.

CKObject and derived classes have no public (exported) constructors. Instances of CKObject and derived classes are created with the CKContext::CreateObject method, and should be deleted with the CKContext::DestroyObject method. The CKContext::DestroyObject function ensures that all Virtools objects using the to-be-deleted object take the necessary mesures to reflect the upcoming deletion. If you have created and used the object for your own needs and are sure that it has not been referenced anywhere else, you may delete the object without notifications spcifying CK_DESTROY_NONOTIFY.

The CKObject class maintains a global ID for each of its instances. The IDs are globally unique and automatically created when the object is created. You obtain the global ID through the GetID method, and you can retrieve the object corresponding to an ID with the CKContext::GetObject method.

Also, you should always reference CK objects through their global ID rather than with a direct pointer to them. Otherwise, you may keep a reference to an object that does not exist any more, as the object may have been deleted in the meantime. You can check that the object corresponding to the ID is still around when you need it by using the CKGetObject function to retrieve it.

Each class derived from CKObject has a class ID associated to it. You can access this class ID through the instances. This is usefull for filtering or triggering different actions on objects according to their class. You access the class ID through the GetClassID method.

A name can be attached to each instance of the CKObject class and derived classes. This name is a CKSTRING. This functionnality is provided as a conveniency for debugging purposes. The Virtools library does not do any processing on name except for loading purposes only (in the case of animation that should be attributed to objects for example).

It is possible to associate arbitrary data to each instance of CKObject and derived classes. This data is not taken into account by the CK library. It is a service provided to the client application. The client application is responsible for the memory management of this data, for conflict resolution about the access to the data and for its internal organization. You attach the data with the SetAppData method and you get it back with the GetAppData method. You can remove the data with by calling SetAppData with a NULL argument.

Groups

Operations | Name | Visibility | Application Data | Flags

Operations
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Name
Method GetName | Returns the name of the object.
Method SetName | Sets the name of the object.
Visibility
Virtual Method Method CanBeHide | Returns whether this object class allows it to be shown or hidden.
Virtual Method Method IsHiddenByParent | Returns whether this object is hidden by one of its parent.
Method IsHierarchicallyHide | Returns whether this object is hidden (and also hides its children).
Virtual Method Method IsVisible | Returns whether this object is visible.
Virtual Method Method Show | Shows or hides an object.
Application Data
Method GetAppData | Gets the pointer to the application data attached to this object.
Method SetAppData | Attachs a pointer to application data to this object
Flags
Method GetObjectFlags | Returns the current object flags for this object.
Method IsDynamic | Returns if the current object is dynamic (can be deleted or created at runtime).
Method IsToBeDeleted | Returns if the current object is to be deleted.
Method ModifyObjectFlags | Adds or Removes flags for this object.

See Also

CKContext::CreateObject, CKContext::GetObject, CKContext::DestroyObject


CKObject::GetCKContext

Method CKObject::GetCKContext

CKContext* CKObject::GetCKContext()

Returns a pointer to the owner CKContext

Returns

A pointer to the CKContext this object belongs to.

Remarks

Each CKObject belongs to a given CKContext, this method gives acces to this CKContext.

See Also

CKContext


CKObject::GetClassID

Method CKObject::GetClassID

CK_CLASSID CKObject::GetClassID()

Returns the Class Identifier for this object

Returns

CK_CLASSID of this object

Remarks

Used by inherited classes to identified themselves. Each class has a unique ID. This is useful for triggering actions depending on the class of the object.

See Also

Class Hierarchy,CK_CLASSID


CKObject::GetID

Method CKObject::GetID

CK_ID CKObject::GetID()

Returns the Identifier for this object

Returns

CK_ID of this object

Remarks

Returns the global ID for the object. The ID is globally unique. It is automatically assigned to the object when it is created (with CKContext::CreateObject and CKContext::CopyObject). It is safer to always store references to CKObject by storing its ID instead of pointers to these objects. You can retrieve an object from its ID using the CKGetObject or CKContext::GetObject function.

See Also

CreateObject, CreateCopy, CKContext::GetObject, Object Identifiers


CKObject::GetMemoryOccupation

Method CKObject::GetMemoryOccupation

int CKObject::GetMemoryOccupation()

Returns the size taken by this object and its data in memory.

Returns

Size in bytes

Remarks

This method returns the size taken in memory by an object. This takes into account all the data stored in system memory by the object : the size taken by the name of an object, the size taken by vertices , animation data ,etc.... This does not take into account the size taken by the dependencies : the size returned for a character does not includes the size occupied by its animations themselves.


CKObject::SetAppDataVSL

Method CKObject::SetAppDataVSL

void CKObject::SetAppDataVSL(void *Data)

Remarks

Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)


CKObject::GetName

Method CKObject::GetName

CKSTRING CKObject::GetName()

Returns the name of the object.

Returns

A pointer to the object name or NULL if the object is unnamed.

Remarks

+Provided as a conveniency for debugging purposes. +The Virtools library does not do any processing corresponding to the name but it can be used when loading animation on objects for example.

See Also

GetName,CKContext::GetObjectByName,CKContext::GetObjectByNameAndClass


CKObject::SetName

Method CKObject::SetName

void CKObject::SetName(CKSTRING name,CKBOOL shared)

Sets the name of the object.

Remarks

Provided as a conveniency for debugging purposes. The Virtools library does not do any processing corresponding to the name but it can be used when loading animation on objects for example. If a name is given with shared equal TRUE then the object will not allocate nor delete a memory buffer for the name but only store the pointer to reduce memory occupation. If shared is set to TRUE the name pointer must not be deleted afterwards unless no more objects use it as a shared name.

See Also

GetName,CKContext::GetObjectByName,CKContext::GetObjectByNameAndClass


CKObject::CanBeHide

Virtual Method Method CKObject::CanBeHide

int CKObject::CanBeHide()

Returns whether this object class allows it to be shown or hidden.

Returns

Value | Meaning
0 | if the object cannot be hidden
1 | if the object can be hidden
2 | if the object can be hidden and hierarchically hidden

Remarks

This virtual function is mainly used by the Virtools interface to known if visibility flags have an impact on a specific object class. CKRenderObject and derived classes,can be triggered as to be shown or hidden or hierarchically hidden and will return 2 to this function. CKMesh and CKGroup can be triggered as to be shown or hidden and will return 1 to this function. Other classes will return 0 which means CKObject::Show function will not have any impact on them.


CKObject::IsHiddenByParent

Virtual Method Method CKObject::IsHiddenByParent

CKBOOL CKObject::IsHiddenByParent()

Returns whether this object is hidden by one of its parent.

Returns

TRUE if one parent hierarchically hides this object

Remarks

This function will process the hierarchy up to the root, until it finds a parent hierarchically hiding its children, so it has a cost on a bug hierarchy.

See Also

Show,IsVisible,IsHierarchicallyHide,CK3dEntity::GetParent,CK2dEntity::GetParent


CKObject::IsHierarchicallyHide

Method CKObject::IsHierarchicallyHide

CKBOOL CKObject::IsHierarchicallyHide()

Returns whether this object is hidden (and also hides its children).

Returns

TRUE if hierarchically hidden.

Remarks

This methods returns if this object is hidden and also hides all its sub-hierarchy. See CKObject::Show for more details on hierarchically hidden objects.

See Also

Show,IsVisible,IsHiddenByParent,CK3dEntity,CK2dEntity,CK_OBJECT_FLAGS


CKObject::IsVisible

Virtual Method Method CKObject::IsVisible

virtual CKBOOL CKObject::IsVisible()

Returns whether this object is visible.

Returns

TRUE if the object is visible, FALSE otherwise.

Remarks

+Only CKRenderObject and derived classes(CK2dEntity,CK3dEntity),CKMesh and CKGroup return relevant information about their visibility state. Other classes may return any values. +An object can return CKSHOW and still be hidden if its parent (see CK3dEntity::GetParent and CK2dEntity::GetParent) is hierarchically hidden (see CKObject::Show)

See Also

IsHiddenByParent,Show,IsHierarchicallyHide


CKObject::Show

Virtual Method Method CKObject::Show

enum CK_OBJECT_SHOWOPTION {
CKHIDE =0,
CKSHOW =1,
CKHIERARCHICALHIDE =2
}
void CKObject::Show(CK_OBJECT_SHOWOPTION show)

Shows or hides an object.

Members

CKHIDE
CKHIERARCHICALHIDE
CKSHOW

Remarks

If show is set to CKHIERARCHICALHIDE this object will be hidden along with all its children. The render engine renders objets in a hierarchical way and stops iterating a hierarchy if it encounters an object which is hierarchically hidden. The problem is that, for performance reason, children objets visibility flags are left unchanged (ie. if a child object was visible CKObject::IsVisible will still return TRUE). To test is a object is hidden because one of its parent object is hierarchically hidden use CKObject::IsHiddenByParent The CKHIERARCHICALHIDE option is only relevant for CK2dEntity and CK3dEntity derived classes. If show is set to CKSHOW the object will be shown and it also removes the hierarchically hidden flags. If show is set to CKHIDE the object will be hidden and it also removes the hierarchically hidden flags. This function is overload by CKGroup,CKMesh and CK3dEntity.

See Also

CK_OBJECT_SHOWOPTION,IsVisible,IsHierarchicallyHide,IsHiddenByParent


CKObject::GetAppData

Method CKObject::GetAppData

void *CKObject::GetAppData()

Gets the pointer to the application data attached to this object.

Returns

A pointer to the application data or NULL if no data is available.

Remarks

The data attached to the object is the entire responsibility of the caller: memory management, internal structure, access conflit. The application data is not included inside file when saving CKObjects, nor is it deleted when the object is deleted.

See Also

SetAppData


CKObject::SetAppData

Method CKObject::SetAppData

void CKObject::SetAppData(void *Data)

Attachs a pointer to application data to this object

Parameters

Input argument Data

A pointer to the application data or NULL to remove any previous application data.

Remarks

This function enables the user to attach custom data to any CKObject derived classes. The data attached to the object is the entire responsibility of the caller: memory management, internal structure, access conflit. The application data is not included inside file when saving CKObjects, nor is it deleted when the object is deleted.

See Also

GetAppData


CKObject::GetObjectFlags

Method CKObject::GetObjectFlags

CKDWORD CKObject::GetObjectFlags()

Returns the current object flags for this object.

Returns

A combination of CK_OBJECT_FLAGS for this objet.

Remarks

Many of these flags can be directly checked by using the appropriate method (see CK_OBJECT_FLAGS) instead of using this method.

See Also

CK_OBJECT_FLAGS,ModifyObjectFlags


CKObject::IsDynamic

Method CKObject::IsDynamic

CKBOOL CKObject::IsDynamic()

Returns if the current object is dynamic (can be deleted or created at runtime).

Returns

TRUE if object is dynamic.

Remarks

See Dynamic objects for more details.

See Also

CK_OBJECT_FLAGS,ModifyObjectFlags,Dynamic Objects


CKObject::IsToBeDeleted

Method CKObject::IsToBeDeleted

CKBOOL CKObject::IsToBeDeleted()

Returns if the current object is to be deleted.

Returns

TRUE if object is about to be deleted.

Remarks

Managers and behaviors may be notified when objects are destroyed, this method enables them to check if an object they own is about to be destroyed.

See Also

CK_OBJECT_FLAGS,ModifyObjectFlags


CKObject::ModifyObjectFlags

Method CKObject::ModifyObjectFlags

void CKObject::ModifyObjectFlags(CKDWORD add,CKDWORD remove)

Adds or Removes flags for this object.

Parameters

Input argument add | A combination of CK_OBJECT_FLAGS to add.
Input argument remove | A combination of CK_OBJECT_FLAGS to remove.

Remarks

You rarely need to modify directly this flags through CKObject::ModifyObjectFlags instead you should always use the specific acces function (given between () in CK_OBJECT_FLAGS documentation) which may need to perform additionnal operations.

See Also

CK_OBJECT_FLAGS,GetObjectFlags


CKSceneObject

Class CKSceneObject

Base class for objects which can be referenced in a scene

CKObject
Show brief derivation trees

CKSceneObject

CKAnimation

CKKeyedAnimation

CKBeObject

CKDataArray

CKGroup

CKLevel

CKMaterial

CKMesh

CKPatchMesh

CKRenderObject

CK2dEntity

CKSprite

CKSpriteText

CK3dEntity

CK3dObject

CKBodyPart

CK3dPointCloud

CKCamera

CKTargetCamera

CKCharacter

CKCurve

CKCurvePoint

CKGrid

CKLight

CKTargetLight

CKPlace

CKSprite3D

CKScene

CKSound

CKMidiSound

CKWaveSound

CKTexture

CKVideo

CKBehavior

CKObjectAnimation

CKObject
Show full derivation trees

CKSceneObject

Subclasses

CKAnimation, CKBeObject, CKBehavior, and CKObjectAnimation

Remarks

CKSceneObject is the base class for all objects that can be referenced in a scene.

It defines methods to see if an object is present and/or active in a specific scene and methods to know in which scenes the object is referenced.

The class id of CKSceneObject is CKCID_SCENEOBJECT.

Groups

Activity
Method IsActiveInCurrentScene | Returns whether an object is active in the current scene.
Method IsActiveInScene | Returns whether an object is active in a scene.
Scenes
Method GetSceneIn | Returns the Nth scene in which this object is present.
Method GetSceneInCount | Returns the number of scenes in which this object is present.
Method IsInScene | Returns whether an object is in the scene.

See Also

CKBeObject, CKScene


CKSceneObject::IsActiveInCurrentScene

Method CKSceneObject::IsActiveInCurrentScene

CKBOOL CKSceneObject::IsActiveInCurrentScene()

Returns whether an object is active in the current scene.

Returns

TRUE if the object is active in the scene.

Remarks

This is valid for both scripts and behavioral objects, if a script or object is not active it will not be processed. IsActiveInCurrentScene is a shortcut for IsActiveInScene(CKContext::GetCurrentScene())

See Also

CKScene::IsObjectActive,CKScene::Activate,CKContext::GetCurrentScene


CKSceneObject::IsActiveInScene

Method CKSceneObject::IsActiveInScene

CKBOOL CKSceneObject::IsActiveInScene(CKScene *scene)

Returns whether an object is active in a scene.

Parameters

Input argument scene

A pointer to a CKScene

Returns

TRUE if the object is active in the scene.

Remarks

This method returns whether the object is active in the specified scene. This is valid for both scripts and behavioral objects, if a script or object is not active it will not be processed.

See Also

CKScene::IsObjectActive,CKScene::Activate,IsActiveInCurrentScene


CKSceneObject::GetSceneIn

Method CKSceneObject::GetSceneIn

CKScene*
CKSceneObject::GetSceneIn(int index)

Returns the Nth scene in which this object is present.

Parameters

Input argument index

index of scene to be returned.

Returns

Returns a pointer to scene.

See Also

GetSceneInCount,IsInScene


CKSceneObject::GetSceneInCount

Method CKSceneObject::GetSceneInCount

int
CKSceneObject::GetSceneInCount()

Returns the number of scenes in which this object is present.

Returns

number of scenes in which this object is present.

See Also

GetSceneIn,IsInScene


CKSceneObject::IsInScene

Method CKSceneObject::IsInScene

CKBOOL
CKSceneObject::IsInScene(CKScene *scene)

Returns whether an object is in the scene.

Parameters

Input argument scene

A pointer to a CKScene

Returns

TRUE if the object is in the scene.

Remarks

This method returns whether an object is referenced in scene

See Also

GetSceneInCount,GetSceneIn


Behavior Engine

Behavior engine related classes

Behaviors | Behavior related classes
Class CKAttributeManager | Object attributes management.
Class CKBehaviorManager | Behavior execution management.
Class CKBeObject | Base class for objects with behaviors
Class CKMessageManager | Messages management
Class CKParameterManager | Parameter and operation types management
Class CKTimeManager | Story and execution time management
Parameters | Parameter related classes

See Also

Classes


Behaviors

Behavior related classes

Class CKBehavior | Class for defining behaviors
Class CKBehaviorIO | Behaviors Input and Outputs
Class CKBehaviorLink | Links between behaviors Inputs/Outputs
Class CKBehaviorPrototype | Class describing the prototype of a behavior
Class CKMessage | Messages between behaviors and objects
Class CKObjectDeclaration | External object declaration
Class CKScene | Narrative management.
Class CKSceneObjectIterator | Iterators on objects in a scene.

See Also

Behavior Engine


CKBehavior

CKObject

CKSceneObject
Show full derivation trees

CKBehavior

Remarks

The CKBehavior class provides functionnalities for defining a behavior as a function or as a graph, to set various parameters about how and when the behavior is activated, to link them to other behaviors through CKBehaviorLink instances or to create them from CKBehaviorPrototype, for creating CKBehaviorPrototype from a behavior.

Each behavior has an owner, which is an instance of CKBeObject. The owner saves its behaviors with itself when saved into a file, or with CKSaveObjectState. The behavior usually applies to its owner, or to parts of its owner, though it can apply to other objects as well. If the behavior is a graph, all of its sub-behaviors inherits the same owner.

A Behavior is considered to as a box with inputs/ouputs and input,output and local parameters. Inside this box the behavior may be implemented using a graph of sub-behaviors or using a C++ function, depending on which method UseGraph or UseFunction has been specified. For behaviors using a function, the function may be defined internally, or in a external code file (dll, or other depending on the OS).

If you want to implement the behavior with a C++ funtion without defining a prototype, you should specify the function with the SetFunction() method. This function will be called at each process cycle, with one argument: the elapsed time since the last call, in milliseconds.

Behaviors are real time pieces of algorithm. When a behavior is active and enabled or is waiting for a message, it gets called in an iterative fashion at each loop of the process cycle. Each time it is called, the behavior does the minimum amount of processing depending on the time elapsed since the last time it was called. No behavior should hold on the CPU more than necessary, as each other active behaviors have to be called in the process cycle.

Behavior execution is managed by its owner, and by the scene to which its owner belongs. A CKBeObject instance is declared in its scene as being active and/or enabled with the CKScene::SetObjectFlags or CKScene::Activate method. A disabled object's behaviors are never called. Setting an object as active has the effect of having all of its behaviors called during the next process cycle. If you add an object to a scene and want its behaviors to be called when the scene is started with CKLevel::LaunchScene, you should set the flags accordingly with CKScene::SetObjectFlags. If you don't use Scene or have only one scene (the level) setting the flags is not necessary.

If the behavior is implemented using an execution function, this function decides whether the behavior should remain active or not. This is done with the return value of the function. If the return value is CKBR_OK, the behavior is considered as being over and is set to be inactive at the next process cycle. It may become active again at a later time, if one of its entries gets activated.

If the behavior is implemented as a graph of sub-behaviors, it is considered active if at least one of its sub-behaviors is active, and will be called during the next process cycle.

Behavior prototypes are a sort of model of behaviors. One can create a behavior from a prototype. Prototypes are typically used in external pieces of code like dlls. Prototypes are typically used for storing reusable behaviors.

Behaviors usually have inputs and outputs, which may be active or inactive. The inputs and outputs have no value, they are like switches which may be on or off. A behavior is activated if at least one of its entries is active. When all of the entries are inactive and all of its sub-behaviors are inactive and the behavior is not waiting for a message, the behavior is deactivated.

The outputs of a behavior are activated or deactivated by the behavior, as a result of its internal processing and states. Outputs of a behavior may be linked to other behaviors through links, in which case activating an output will trigger the activation of one or more other behaviors. This is the basic principle through which processing travels along behaviors.

A behavior may have zero or more inputs and zero or more outputs. The output of a behavior may be linked to an input of the same behavior.

Outputs of a behavior are linked to inputs or other behaviors through instances of CKBehaviorLink. These links have an activation delay, which may be 0. If it is zero, the input gets activated at the same process cycle which may introduce infinite loops. Such Loops are detected at execution time when exceding the value defined by CKSetBehaviorMaxIteration (Default : 8000)

Behaviors may exchange or store values using parameters, which are instances of CKParameterOut, CKParameterIn. These values may be arbitrarily complex, and you may define your own type of parameters. CKParameterOut instances are used by the behavior to export values, and CKParameterIn instances are used to get values from the outside.

Components of a behavior like parameters, I/O may be named, like all objects of CK. This name is only a conveniency and is not mandatory. These names are saved in the state or in the file with the behavior and may eat up space, so you should use them carefully if this is an issue for your application.

Behaviors may wait for messages. They specify that they wait for messages by registering themselves with the message manager, using the CKMessageManager::RegisterWait method and by providing an input or an output to activate when a corresponding message is received.

The class id of CKBehavior is CKCID_BEHAVIOR.

Groups

Prototype | Input Output | Behavior Links | Input Parameters | Local Parameters | Output Parameters | Parameter Operations | Owner and Target | Runtime | Execution function | Flags | Profiling | Sub Behaviors | Type

Prototype
Method GetPrototype | Returns the prototype the behavior was made from
Method GetPrototypeGuid | Returns the GUID of the prototype the behavior was made from.
Method GetPrototypeName | Returns the name of the prototype the behavior was made from
Method GetVersion | Returns the version of the behavior.
Method InitFctPtrFromGuid | Initializes the behavior function pointer from GUID
Method InitFctPtrFromPrototype | Initializes the behavior function pointer from prototype.
Method InitFromGuid | Initializes the behavior from a prototype's GUID
Method InitFromPrototype | Initializes the behavior from prototype.
Method SetVersion | Sets the version of a building block.
Input Output
Method ActivateInput | Management of input activity state.
Method ActivateOutput | Activates an output.
Method AddInput | Creates a new input and adds it at the end of the input list.
Method AddOutput | Creates a new output and adds it at the end of the output list.
Method CreateInput | Same fonctionnality as AddInput but returns a pointer to the created CKBehaviorIO.
Method CreateOutput | Creates an output of this behavior.
Method DeleteInput | Removes and deletes the input at a given index from the behavior.
Method DeleteOutput | Removes and deletes the output at the given position from the list
Method GetInput | Returns the input at a given index.
Method GetInputCount | Gets behavior inputs count
Method GetInputPosition | Gets the input position.
Method GetOutput | Returns the output at a given index.
Method GetOutputCount | Gets behavior outputs count.
Method GetOutputPosition | Gets the index of the given output of this behavior.
Method InsertInput | Inserts an input
Method InsertOutput | Inserts an output
Method IsInputActive | Returns whether the input behavior is active or not.
Method IsOutputActive | Returns whether behavior output is active.
Method RemoveInput | Removes the input at the given position.
Method RemoveOutput | Removes the output at the given position from the list
Method ReplaceInput | Replaces the input behavior
Method ReplaceOutput | Replaces an output.
Behavior Links
Method AddSubBehaviorLink | Management of the sub-behaviors links
Method GetSubBehaviorLink | Gets the sub behavior link at the given position.
Method GetSubBehaviorLinkCount | Gets the number of sub behavior links in the behavior.
Method RemoveSubBehaviorLink | Removes a sub behavior link.
Input Parameters
Method AddInputParameter | Adds an existing input parameter.
Method CreateInputParameter | Creates a new input parameter with the given type or GUID and optional name.
Method EnableInputParameter | Enables an input parameter.
Method ExportInputParameter | Exports input parameter of behavior
Method GetInputParameter | Gets an input parameter.
Method GetInputParameterCount | Gets number of input parameters.
Method GetInputParameterObject | Gets the object contained in a parameter linked to an input parameter.
Method GetInputParameterPosition | Gets the input parameter position
Method GetInputParameterReadDataPtr | Returns a pointer to the data linked to an input parameter.
Method GetInputParameterValue | Gets the value of an input parameter.
Method InsertInputParameter | Inserts an input parameter.
Method IsInputParameterEnabled | Returns whether Input parameter is enabled or not
Method RemoveInputParameter | Removes the input parameter at the given position.
Method ReplaceInputParameter | Replaces an input parameter.
Local Parameters
Method AddLocalParameter | Adds an existing local parameter.
Method CreateLocalParameter | Creates a local parameter on a behavior.
Method GetLocalParameter | Gets the local parameter at the given position.
Method GetLocalParameterCount | Gets the local parameter count.
Method GetLocalParameterObject | Gets the object contained in a local parameter.
Method GetLocalParameterPosition | Gets the local parameter position
Method GetLocalParameterReadDataPtr | Returns a pointer to the data of a local parameter.
Method GetLocalParameterValue | Gets the value of a local parameter.
Method InsertLocalParameter | Inserts an local parameter.
Method IsLocalParameterSetting | Returns whether a local parameter is used as a setting.
Method RemoveLocalParameter | Removes a local parameter from the behavior.
Method SetLocalParameterObject | Sets the value of a local parameter containing an object.
Method SetLocalParameterValue | Sets the value of a local parameter.
Output Parameters
Method AddOutputParameter | Adds an existing output parameter.
Method CreateOutputParameter | Creates an output parameter on a behavior.
Method EnableOutputParameter | Enables an output parameter.
Method ExportOutputParameter | Exports an output parameter.
Method GetOutputParameter | Gets the output parameter at the given position.
Method GetOutputParameterCount | Gets the output parameter count.
Method GetOutputParameterObject | Gets the object contained in an output parameter
Method GetOutputParameterPosition | Gets the output parameter position.
Method GetOutputParameterValue | Gets the value of an output parameter.
Method GetOutputParameterWriteDataPtr | Returns a pointer to the data of an output parameter.
Method InsertOutputParameter | Inserts an output parameter.
Method IsOutputParameterEnabled | Checks whether output parameter is enabled or not
Method RemoveOutputParameter | Removes an output parameter from the behavior.
Method ReplaceOutputParameter | Replaces an output parameter.
Method SetOutputParameterObject | Sets the value of an output parameter containing an object.
Method SetOutputParameterValue | Sets the value of an output parameter.
Parameter Operations
Method AddParameterOperation | Management of parameter operations
Method GetParameterOperation | Gets the parameter operation at a given position.
Method GetParameterOperationCount | Gets the parameter operations count
Method RemoveParameterOperation | Removes a parameter operation from the behavior.
Owner and Target
Method GetOwner | Returns the owner of the behavior
Method GetTarget | Returns the target of the behavior
Method GetTargetParameter | Gets the target parameter.
Method IsTargetable | Returns whether the behavior is targetable.
Method IsUsingTarget | Checks whether the behavior is using target or not
Method RemoveTargetParameter | Removes input target parameter
Method ReplaceTargetParameter | Replaces the target parameter.
Method UseTarget | Management of the target input parameter
Runtime
Method Activate | Activates the behavior.
Method Execute | Executes the behavior
Method GetPriority | Gets the priority of the behavior
Method GetShortestDelay | Returns the shortest link delay to go from the caller behavior to another one.
Method IsActive | Returns TRUE if the behavior is active
Method IsParentScriptActiveInScene | Returns TRUE if the script containing the behavior is active
Method SetPriority | Sets or gets the priority of the behavior.
Execution function
Method GetFunction | Gets the execution function of the behavior
Method SetCallbackFunction | Sets the callback function to be used by the behavior
Method SetFunction | Manages the execution function for the behavior
Flags
Method GetFlags | Gets the flags of the behavior
Method GetObjectFlags | Returns the current object flags for this object.
Method IsDynamic | Returns if the current object is dynamic (can be deleted or created at runtime).
Method IsToBeDeleted | Returns if the current object is to be deleted.
Method ModifyFlags | Modifies the flags of the behavior
Method ModifyObjectFlags | Adds or Removes flags for this object.
Method SetFlags | Sets the flags of the behavior.
Profiling
Method GetLastExecutionTime | Returns time taken by the behavior for its execution.
Sub Behaviors
Method AddSubBehavior | Management of sub-behaviors
Method GetOwnerScript | Retuns the script in which this behavior is used.
Method GetParent | Retuns the parent behavior of this behavior.
Method GetSubBehavior | Returns the sub behavior at a given position.
Method GetSubBehaviorCount | Gets the number of sub behaviors in the behavior.
Method RemoveSubBehavior | Removes a sub behavior.
Type
Method GetCompatibleClassID | Gets the compatible class ID of the behavior.
Method GetType | Gets the type of the behavior.
Method IsUsingFunction | Checks if the behavior is using function
Method SetCompatibleClassID | Sets the compatible class id of the behavior
Method SetType | Sets the type of the behavior.
Method UseFunction | Defines the behavior as using a function for its execution.
Method UseGraph | Enables behavior to use graph.

See Also

CKBeObject, CKScene, CKParameterOut, CKParameterIn, CKBehaviorLink, CKBehaviorPrototype


CKBehavior::GetPrototype

Method CKBehavior::GetPrototype

CKBehaviorPrototype* CKBehavior::GetPrototype()

Returns the prototype the behavior was made from

Returns

Prototype the behavior was created from, NULL if it wasn't created from a prototype.

See Also

GetPrototypeGuid


CKBehavior::GetPrototypeGuid

Method CKBehavior::GetPrototypeGuid

CKGUID CKBehavior::GetPrototypeGuid()

Returns the GUID of the prototype the behavior was made from.

Returns

GUID of the prototype of the behavior, CKGUID(0,0) if it is a behavior not created from a prototype.

See Also

InitFromGuid, GetPrototypeName


CKBehavior::GetPrototypeName

Method CKBehavior::GetPrototypeName

CKSTRING CKBehavior::GetPrototypeName()

Returns the name of the prototype the behavior was made from

Returns

Name of the prototype the behavior was created from, NULL if it wasn't created from a prototype.

See Also

GetPrototypeGuid


CKBehavior::GetVersion

Method CKBehavior::GetVersion

CKDWORD CKBehavior::GetVersion()

Returns the version of the behavior.

Returns

Behavior Version if it is a building block, else 0.

See Also

GetPrototype, SetVersion


CKBehavior::InitFctPtrFromGuid

Method CKBehavior::InitFctPtrFromGuid

CKERROR CKBehavior::InitFctPtrFromGuid(CKGUID Guid)

Initializes the behavior function pointer from GUID

Parameters

Input argument Guid

the GUID of the prototype.

Returns

CK_OK if successful or an error code.

See Also

CKBehaviorPrototype, InitFctPtrFromPrototype


CKBehavior::InitFctPtrFromPrototype

Method CKBehavior::InitFctPtrFromPrototype

CKERROR CKBehavior::InitFctPtrFromPrototype(CKBehaviorPrototype *proto)

Initializes the behavior function pointer from prototype.

Parameters

Input argument proto

Pointer to Behavior Prototype.

Returns

CK_OK if successful.

Remarks

This method restores the behavior function pointer and the behavior flags.

See Also

CKBehaviorPrototype


CKBehavior::InitFromGuid

Method CKBehavior::InitFromGuid

CKERROR CKBehavior::InitFromGuid(CKGUID Guid)

Initializes the behavior from a prototype's GUID

Parameters

Input argument Guid

the GUID of the prototype to use proto: the prototype to use

Returns

CK_OK is successful, an error code otherwise.

Remarks

+This method initializes a newly created instance of behavior from a prototype: It automatically creates all the inputs,outputs,parameters declared in the prototype. +The prototype can have been created in memory with GeneratePrototype or automatically from an external dll, which are loaded at the library startup time.

+The InitFctPtrFromGuid and InitFctPtrFromPrototype only restores the behavior function pointer and the behavior flags.

See Also

CKBehaviorPrototype


CKBehavior::InitFromPrototype

Method CKBehavior::InitFromPrototype

CKERROR CKBehavior::InitFromPrototype(CKBehaviorPrototype *proto)

Initializes the behavior from prototype.

Parameters

Input argument proto

Pointer to Behavior Prototype

Returns

CK_OK if successful

Remarks

This method creates all input, outputs, input parameters, output parameters and local parameters.

See Also

CKBehaviorPrototype, CKObjectDeclaration, CreateInput, CreateOutput, CreateInputParameter, CreateOutputParameter, CreateLocalParameter


CKBehavior::SetVersion

Method CKBehavior::SetVersion

void CKBehavior::SetVersion(CKDWORD version)

Sets the version of a building block.

See Also

GetPrototype, UseFunction, GetVersion


CKBehavior::ActivateInput

Method CKBehavior::ActivateInput

void CKBehavior::ActivateInput(int pos,CKBOOL active)

Management of input activity state.

Parameters

Input argument pos | Index of the input.
Input argument active | Activity state.

Remarks

ActivateInput activates/deactivates the input specified by pos.

See Also

IsInputActive,AddInput


CKBehavior::ActivateOutput

Method CKBehavior::ActivateOutput

void CKBehavior::ActivateOutput(int pos,CKBOOL active)

Activates an output.

Parameters

Input argument pos | Index of the output.
Input argument active | Activity state.

Remarks

ActivateOutput activates the output specified by pos.

See Also

ActivateInput,AddOutput


CKBehavior::AddInput

Method CKBehavior::AddInput

int CKBehavior::AddInput(CKSTRING name)

Creates a new input and adds it at the end of the input list.

Returns

Position of the created input.

Remarks

A behavior may have zero or more inputs. These inputs may or may not be linked to inputs/outputs of other behaviors. The name is only a conveniency for display and debugging purposes.

See Also

AddOutput,ActivateOutput


CKBehavior::AddOutput

Method CKBehavior::AddOutput

int CKBehavior::AddOutput(CKSTRING name)

Creates a new output and adds it at the end of the output list.

Returns

return the position of the created output.

Remarks

A behavior may have zero or more outputs. These outputs may be linked to inputs of other behaviors or outputs of enclosing behaviors. The name is only a conveniency for display and debugging purposes.

See Also

GetOutputCount,CreateOutput


CKBehavior::CreateInput

Method CKBehavior::CreateInput

CKBehaviorIO *CKBehavior::CreateInput(CKSTRING name)

Same fonctionnality as AddInput but returns a pointer to the created CKBehaviorIO.

Returns

Pointer to the created CKBehaviorIO

Remarks

Creates a new input and adds it at the end of the input list. +The name parameter should be passed as a constant string. For exemple: beh->CreateInput("In");

See Also

CKBehaviorIO, AddInput


CKBehavior::CreateOutput

Method CKBehavior::CreateOutput

CKBehaviorIO *CKBehavior::CreateOutput(CKSTRING name)

Creates an output of this behavior.

Returns

Pointer to the created CKBehaviorIO

Remarks

The new output is added at the end of the output list. +The name parameter should be passed as a constant string. For exemple: beh->CreateOutput("Out");

See Also

CKBehaviorIO, AddOutput


CKBehavior::DeleteInput

Method CKBehavior::DeleteInput

CKERROR CKBehavior::DeleteInput(int pos)

Removes and deletes the input at a given index from the behavior.

Parameters

Input argument pos

Index of the input

Returns

CK_OK, if successful, CKERR_INVALIDPARAMETER otherwise

See Also

CKBehaviorIO, RemoveInput


CKBehavior::DeleteOutput

Method CKBehavior::DeleteOutput

CKERROR CKBehavior::DeleteOutput(int pos)

Removes and deletes the output at the given position from the list

Parameters

Input argument pos

Index of the output.

Returns

CK_OK, if an output exists at pos CKERR_INVALIDPARAMETER otherwise.

Remarks

Deletes the memory allocated for the output.

See Also

CKBehaviorIO, RemoveOutput


CKBehavior::GetInput

Method CKBehavior::GetInput

CKBehaviorIO *CKBehavior::GetInput(int pos)

Returns the input at a given index.

Parameters

Input argument pos

Index to the input array.

Returns

pointer to CKBehaviorIO

See Also

CKBehaviorIO


CKBehavior::GetInputCount

Method CKBehavior::GetInputCount

int CKBehavior::GetInputCount()

Gets behavior inputs count

Returns

Number of inputs of the behavior

See Also

GetInput


CKBehavior::GetInputPosition

Method CKBehavior::GetInputPosition

int CKBehavior::GetInputPosition(CKBehaviorIO *pbio)

Gets the input position.

Parameters

Input argument pbio

A pointer to the input CKBehaviorIO whose index to be retrieved.

Returns

Index which contains pbio.

Remarks

-1 if pbio is NULL or does not exist

See Also

CKBehaviorIO, CKObjectArray::GetPosition


CKBehavior::GetOutput

Method CKBehavior::GetOutput

CKBehaviorIO *CKBehavior::GetOutput(int pos)

Returns the output at a given index.

Parameters

Input argument pos

Index of the output array of the behavior.

Returns

pointer to the CKBehaviorIO if it exists, NULL otherwise

See Also

CKBehaviorIO, GetOutputCount


CKBehavior::GetOutputCount

Method CKBehavior::GetOutputCount

int CKBehavior::GetOutputCount()

Gets behavior outputs count.

Returns

Number of outputs of the behavior

See Also

AddOutput, GetOutput


CKBehavior::GetOutputPosition

Method CKBehavior::GetOutputPosition

int CKBehavior::GetOutputPosition(CKBehaviorIO *pbio)

Gets the index of the given output of this behavior.

Parameters

Input argument pbio

Pointer to CKBehaviorIO whose index in the output array to be retrieved.

Returns

Index of output specified by pbio.

Remarks

-1 if the output is NULL or the output does not exist

See Also

CKBehaviorIO, CKObjectArray::GetPosition


CKBehavior::InsertInput

Method CKBehavior::InsertInput

void CKBehavior::InsertInput(int pos,CKBehaviorIO* bio)

Inserts an input

Parameters

Input argument pos | Index of the desired position.
Input argument bio | A pointer to the CKBehaviorIO to add as an input.

Remarks

insert an existing input in the input list, at the given position, or adds it at the end of the list if the position is -1.

See Also

CKBehaviorIO, CKContext


CKBehavior::InsertOutput

Method CKBehavior::InsertOutput

void CKBehavior::InsertOutput(int pos,CKBehaviorIO* bio)

Inserts an output

Parameters

Input argument pos | Index of the desired position.
Input argument bio | A pointer to the CKBehaviorIO to add as an output.

Remarks

insert an existing output in the output list, at the given position, or adds it at the end of the list if the position is -1.

See Also

CKBehaviorIO, CKContext


CKBehavior::IsInputActive

Method CKBehavior::IsInputActive

CKBOOL CKBehavior::IsInputActive(int pos)

Returns whether the input behavior is active or not.

Parameters

Input argument pos

Index of the output

Returns

Non zero, if the input behavior is active.

See Also

ActivateInput,AddInput


CKBehavior::IsOutputActive

Method CKBehavior::IsOutputActive

CKBOOL CKBehavior::IsOutputActive(int pos)

Returns whether behavior output is active.

Parameters

Input argument pos

Index of the output

Returns

Value | Meaning
TRUE | if the behavior output is active
FALSE | otherwise.

See Also

CKBehavior


CKBehavior::RemoveInput

Method CKBehavior::RemoveInput

CKBehaviorIO *CKBehavior::RemoveInput(int pos)

Removes the input at the given position.

Parameters

Input argument pos

Index of the input to remove.

Returns

Pointer to the removed input if input exists at pos, NULL otherwise.

See Also

CKBehaviorIO, GetInput


CKBehavior::RemoveOutput

Method CKBehavior::RemoveOutput

CKBehaviorIO *CKBehavior::RemoveOutput(int pos)

Removes the output at the given position from the list

Parameters

Input argument pos

Index of the output.

Returns

CKBehaviorIO pointer of the removed output if it exists, NULL otherwise.

See Also

AddOutput, DeleteOutput


CKBehavior::ReplaceInput

Method CKBehavior::ReplaceInput

CKBehaviorIO *CKBehavior::ReplaceInput(int pos,CKBehaviorIO *io)

Replaces the input behavior

Parameters

Input argument pos | Index of the input.
Input argument io | pointer to a CKBehaviorIO

Returns

Pointer to the old CKBehaviorIO.

Remarks

Replaces input specified by pos by io and returns a pointer to the old CKBehaviorIO.

See Also

DeleteInput


CKBehavior::ReplaceOutput

Method CKBehavior::ReplaceOutput

CKBehaviorIO *CKBehavior::ReplaceOutput(int pos,CKBehaviorIO *io)

Replaces an output.

Parameters

Input argument pos | Index of the output.
Input argument io | pointer to the CKBehaviorIO to use instead

Returns

Pointer to the old CKBehaviorIO.

Remarks

Replaces output specified by pos by io and returns a pointer to the old CKBehaviorIO.

See Also

CKBehaviorIO


CKBehavior::AddSubBehaviorLink

Method CKBehavior::AddSubBehaviorLink

CKERROR CKBehavior::AddSubBehaviorLink(CKBehaviorLink *cbkl)

Management of the sub-behaviors links

Parameters

Input argument cbkl

A pointer to a CKBehaviorLink to add/remove. pos: Index of the behavior link to access.

Returns

CK_OK if successful, otherwise error code.

Remarks

When the behavior is implemented as a graph of sub-behaviors, all of the links between the sub-behaviors should be listed within the behavior. When the behavior is saved, all of its sub-behavior's links are saved with it. The links provide I/O chains between the sub-behaviors of the target behavior.

The AddSubBehaviorLink adds the behavior link given as argument to the set of behavior links. The RemoveSubBehaviorLink removes the behavior link with the given ID from the set of behavior links, and returns it. The GetSubBehaviorLink method returns the link at the given position in the set. The GetSubBehaviorLinkCount method returns the number of links in the target behavior.

See Also

CKBehavior::AddSubBehavior, CKBehaviorLink


CKBehavior::GetSubBehaviorLink

Method CKBehavior::GetSubBehaviorLink

CKBehaviorLink *CKBehavior::GetSubBehaviorLink(int pos)

Gets the sub behavior link at the given position.

Parameters

Input argument pos

Position at which sub behavior link is to be obtained.

Returns

Pointer to sub behavior link.

See Also

CKObject, CKBehaviorLink, GetSubBehaviorLinkCount


CKBehavior::GetSubBehaviorLinkCount

Method CKBehavior::GetSubBehaviorLinkCount

int CKBehavior::GetSubBehaviorLinkCount()

Gets the number of sub behavior links in the behavior.

Returns

Number of sub behavior links.

See Also

GetSubBehaviorLink


CKBehavior::RemoveSubBehaviorLink

Method CKBehavior::RemoveSubBehaviorLink

CKBehaviorLink *CKBehavior::RemoveSubBehaviorLink(CKBehaviorLink *ckbl)
CKBehaviorLink *CKBehavior::RemoveSubBehaviorLink(int pos)

Removes a sub behavior link.

Parameters

Input argument pos

Position at which the sub behavior link is to be removed.

Returns

A pointer to a sub behavior link removed, NULL if failed

Remarks

Removes the behavior link from the set of behavior links, and returns it.

See Also

CKBehaviorLink


CKBehavior::AddInputParameter

Method CKBehavior::AddInputParameter

void CKBehavior::AddInputParameter(CKParameterIn *p)

Adds an existing input parameter.

Parameters

Input argument p

A pointer to the CKParameterIn to add.

Remarks

This method adds input parameter at the end of the input parameter list

See Also

CKParameterIn


CKBehavior::CreateInputParameter

Method CKBehavior::CreateInputParameter

CKParameterIn *CKBehavior::CreateInputParameter(CKSTRING name, CKParameterType type)
CKParameterIn *CKBehavior::CreateInputParameter(CKSTRING name, CKGUID guid)

Creates a new input parameter with the given type or GUID and optional name.

Returns

Returns pointer to CKParameterIn with name and type

Remarks

Input parameters (CKParameterIn) receive data from output or local parameters (CKParameter, CKParameterOut and CKParameterLocal). They define the values that are needed by the behavior to do its processing. Input parameters may be accessed by index. They may have a name which is provided as a conveniency, for display and debugging. These input parameters may be created and owned by the behavior, or exported from sub-behaviors if the behavior is a graph, in which case they are still owned by the sub-behavior. +The name parameter should be passed as a constant string. For exemple: beh->CreateInputParameter("Vector",CKPGUID_VECTOR); Input parameters do not own their values, and should be either plugged into an in parameter from the enclosing behavior using the CKParameterIn::ShareSourceWith method, or plugged into an output or local parameter from which it will take its value, using the CKParameterIn::SetDirectSource method. When you ask the in parameter for its value, using the GetReadDataPtr or the GetValue methods, the value is actually taken on the fly by looking in the first parameter value found when walking up the succession of shared sources. The parameter types are managed by the CKParameterManager. You can define you own types of parameters using the CKParameterManager::RegisterParameterType method. InsertInputParameter Creates a new “in parameter” with the given type or type GUID and optional name, and insterts it in the in parameter list, at the given position, or adds it at the end of the list if the position is invalid. ExportInputParameter: Exports the given in parameter, typically coming from a sub-behavior. This exported in parameter is added at the end of the in parameter list. GetInputParameterPosition: Returns the position of the given in parameter in the list of in parameters. GetInputParameter: Returns the in parameter at the given position in the list. RemoveInputParameter: Removes the in parameter that is at the given position in the list, and returns it. GetInputParameterCount: Returns the number of in parameters in the in parameter list. ReplaceInputParameter: Replaces the in parameter that is at the given position by p and returns the previous parameter.

See Also

CKParameterIn,Parameter Types


CKBehavior::EnableInputParameter

Method CKBehavior::EnableInputParameter

void CKBehavior::EnableInputParameter(int pos,CKBOOL enable)

Enables an input parameter.

Remarks

+Input parameters can be disabled. Disabled input parameters are not shown in the interface nor can they be edited when editing behavior parameters. +Common usage of this function is to disable specific input parameters according to the behavior settings.

See Also

CKParameterIn,EnableOutputParameter


CKBehavior::ExportInputParameter

Method CKBehavior::ExportInputParameter

CKERROR CKBehavior::ExportInputParameter(CKParameterIn *p)

Exports input parameter of behavior

Parameters

Input argument p

A pointer to a CKParameterIn

Returns

Returns successful, if it exports the given input parameter

Remarks

Exports the given input parameter, typically coming from a sub-behavior. This exported input parameter is added at the end of the input parameter list.

See Also

CKParameterIn, CKERROR


CKBehavior::GetInputParameter

Method CKBehavior::GetInputParameter

CKParameterIn *CKBehavior::GetInputParameter(int pos)

Gets an input parameter.

Parameters

Input argument pos

Index of the parameter to access.

Returns

Returns pointer to a CKParameterIn NULL if the position is out of bound.

Remarks

Returns the in parameter at the given position in the list.

See Also

CKParameterIn, GetInputParameterCount


CKBehavior::GetInputParameterCount

Method CKBehavior::GetInputParameterCount

int CKBehavior::GetInputParameterCount()

Gets number of input parameters.

Returns

The number of input parameters in the input parameter list.

See Also

GetInputParameter, RemoveInputParameter


CKBehavior::GetInputParameterObject

Method CKBehavior::GetInputParameterObject

CKObject* CKBehavior::GetInputParameterObject(int pos)

Gets the object contained in a parameter linked to an input parameter.

Parameters

Input argument pos

Index of the input parameter to access

Returns

pointer to the CKObject contained.

See Also

GetInputParameterReadDataPtr, GetInputParameterValue


CKBehavior::GetInputParameterPosition

Method CKBehavior::GetInputParameterPosition

int CKBehavior::GetInputParameterPosition(CKParameterIn *p)

Gets the input parameter position

Parameters

Input argument p

A pointer to CKParameterIn

Returns

Returns the position of the given input parameter or -1 if it is not found.

See Also

GetInputParameter, GetInputParameterCount


CKBehavior::GetInputParameterReadDataPtr

Method CKBehavior::GetInputParameterReadDataPtr

void* CKBehavior::GetInputParameterReadDataPtr(int pos)

Returns a pointer to the data linked to an input parameter.

Parameters

Input argument pos

Index of the input parameter to access

Returns

pointer to the parameter data linked to the input parameter.

See Also

GetInputParameterValue, GetInputParameterObject


CKBehavior::GetInputParameterValue

Method CKBehavior::GetInputParameterValue

CKERROR CKBehavior::GetInputParameterValue(int pos,void* val)

Gets the value of an input parameter.

Parameters

Input argument pos | Index of the input parameter to access.
Input argument val | A pointer to value, to be filled.

Returns

Value | Meaning
CK_OK | if successful,
CKERR_INVALIDPARAMETER | otherwise.

See Also

CKParameterIn::GetValue,GetInputParameterObject


CKBehavior::InsertInputParameter

Method CKBehavior::InsertInputParameter

CKParameterIn *CKBehavior::InsertInputParameter(int pos,CKSTRING name, CKParameterType type)
void CKBehavior::InsertInputParameter(int pos,CKParameterIn* p)

Inserts an input parameter.

Parameters

Input argument pos | Index of the desired parameter position.
Input argument p | A pointer to the CKParameterIn to add.

Returns

Pointer to the created CKParameterIn

Remarks

Creates a new input parameter with the given type and optional name, and inserts it in the input parameter list, at the given position, or adds it at the end of the list if the position is -1.

See Also

CKParameterIn, CKContext


CKBehavior::IsInputParameterEnabled

Method CKBehavior::IsInputParameterEnabled

CKBOOL CKBehavior::IsInputParameterEnabled(int pos)

Returns whether Input parameter is enabled or not

Parameters

Input argument pos

Index of the input parameter

Returns

TRUE, if input parameter is enabled FALSE other wise.

Remarks

+This method tests the input parameter at given position and returns whether it is enabled or not

See Also

CKParameterIn, GetInputParameter


CKBehavior::RemoveInputParameter

Method CKBehavior::RemoveInputParameter

CKParameterIn *CKBehavior::RemoveInputParameter(int pos)

Removes the input parameter at the given position.

Parameters

Pos: Index of the parameter to access.

Returns

Returns pointer to the removed CKParameterIn

Remarks

Removes the input parameter that is at the given position in the list, and returns it.

See Also

CKParameterIn, GetInputParameter


CKBehavior::ReplaceInputParameter

Method CKBehavior::ReplaceInputParameter

CKParameterIn *CKBehavior::ReplaceInputParameter(int pos,CKParameterIn *p)

Replaces an input parameter.

Parameters

Input argument pos | Index of the parameter to access.
Input argument p | A pointer to the CKParameterIn to set.

Returns

Returns pointer to the old input parameter.

Remarks

Replaces the input parameter that is at the given position by p and returns the previous parameter.

See Also

CKParameterIn, AddInputParameter


CKBehavior::AddLocalParameter

Method CKBehavior::AddLocalParameter

void CKBehavior::AddLocalParameter(CKParameterLocal *p)

Adds an existing local parameter.

Parameters

Input argument p

Pointer to the CKParameterLocal to add.

Remarks

Adds a CKParameterLocal p to the end of the list of local parameters.

See Also

CKParameterLocal, CreateLocalParameter


CKBehavior::CreateLocalParameter

Method CKBehavior::CreateLocalParameter

CKParameterLocal *CKBehavior::CreateLocalParameter(CKSTRING name,CKParameterType type)
CKParameterLocal *CKBehavior::CreateLocalParameter(CKSTRING name,CKGUID guid)

Creates a local parameter on a behavior.

Returns

Pointer to the created local parameter.

Remarks

+Creates a new local parameter with the given type or guid, and adds it at the end of the local parameter list. +Local parameters are parameters that are internal to the behavior and are intended to be used by sub-behaviors, or for storing local values. +The name is always optional and is provided as a conveniency for debugging and displaying purposes.

See Also

CKParameterLocal, AddLocalParameter


CKBehavior::GetLocalParameter

Method CKBehavior::GetLocalParameter

CKParameterLocal *CKBehavior::GetLocalParameter(int pos)

Gets the local parameter at the given position.

Parameters

Input argument pos

Index to the local parameter list.

Returns

pointer to CKParameterLocal

Remarks

This function is also used to get the settings of a behavior.

See Also

CKParameterLocal, GetLocalParameterCount


CKBehavior::GetLocalParameterCount

Method CKBehavior::GetLocalParameterCount

int CKBehavior::GetLocalParameterCount()

Gets the local parameter count.

Returns

Number of local parameters

See Also

AddLocalParameter, RemoveLocalParameter


CKBehavior::GetLocalParameterObject

Method CKBehavior::GetLocalParameterObject

CKObject* CKBehavior::GetLocalParameterObject(int pos)

Gets the object contained in a local parameter.

Parameters

Input argument pos

Index to the local parameter to access.

Returns

pointer to the CKObject contained.

See Also

GetLocalParameter, SetLocalParameterObject


CKBehavior::GetLocalParameterPosition

Method CKBehavior::GetLocalParameterPosition

int CKBehavior::GetLocalParameterPosition(CKParameterLocal *p)

Gets the local parameter position

Parameters

Input argument p

Pointer to the CKParameterLocal

Returns

Position of the given local parameter in the list of local parameters, -1 if the parameter local is not in the list.

See Also

GetLocalParameter


CKBehavior::GetLocalParameterReadDataPtr

Method CKBehavior::GetLocalParameterReadDataPtr

void* CKBehavior::GetLocalParameterReadDataPtr(int pos)
void* CKBehavior::GetLocalParameterWriteDataPtr(int pos)

Returns a pointer to the data of a local parameter.

Parameters

Input argument pos

Index of the local parameter

Returns

pointer to the local parameter data.

Remarks

+This method tests the local parameter at specified position and returns read data pointer +The GetLocalParameterWriteDataPtr is identical for the local parameters.

See Also

CKParameterLocal


CKBehavior::GetLocalParameterValue

Method CKBehavior::GetLocalParameterValue

CKERROR CKBehavior::GetLocalParameterValue(int pos,void* val)

Gets the value of a local parameter.

Parameters

Input argument pos | Index of the local parameter to access.
Input argument val | A pointer to a buffer where the value is to be copied.

Returns

CK_OK if successful, CKERR_INVALIDPARAMETER otherwise.

See Also

CKParameterLocal, CKParameterOut::GetValue


CKBehavior::InsertLocalParameter

Method CKBehavior::InsertLocalParameter

CKParameterLocal* CKBehavior::InsertLocalParameter(int pos,CKSTRING name,CKParameterType type)
void CKBehavior::InsertLocalParameter(int pos,CKParameterLocal* p)

Inserts an local parameter.

Parameters

Input argument pos | Index of the desired parameter position.
Input argument p | A pointer to the CKParameterLocal to add.

Returns

A pointer to the local parameter created and inserted.

Remarks

Creates a new local parameter, with the given optional name, and the given parameter type index or GUID, and inserts this new parameter at the given position in the local parameter list

See Also

CKParameterOut, CKContext


CKBehavior::IsLocalParameterSetting

Method CKBehavior::IsLocalParameterSetting

CKBOOL CKBehavior::IsLocalParameterSetting(int pos)

Returns whether a local parameter is used as a setting.

Parameters

Input argument pos

Index of the local parameter.

Returns

TRUE if the parameter is used as a setting.

Remarks

When declaring the prototype of a behavior, one can declare settings which can be edited in the user interface. These settings are special local parameters.

See Also

CreateLocalParameter,CKBehaviorPrototype::DeclareSetting


CKBehavior::RemoveLocalParameter

Method CKBehavior::RemoveLocalParameter

CKParameterLocal *CKBehavior::RemoveLocalParameter(int pos)

Removes a local parameter from the behavior.

Parameters

Input argument pos

Index of the local parameter

Returns

Pointer to the removed local paramter.

See Also

CKParameterLocal, GetLocalParameter


CKBehavior::SetLocalParameterObject

Method CKBehavior::SetLocalParameterObject

CKERROR CKBehavior::SetLocalParameterObject(int pos,CKObject *obj)

Sets the value of a local parameter containing an object.

Parameters

Input argument pos | Index of the local parameter to access.
Input argument obj | pointer to CKObject to be set.

Returns

CK_OK if successful, CKERR_INVALIDPARAMETER otherwise.

See Also

GetLocalParameter, CKParameterOut::SetValue


CKBehavior::SetLocalParameterValue

Method CKBehavior::SetLocalParameterValue

CKERROR CKBehavior::SetLocalParameterValue(int pos,const void* val,int size)

Sets the value of a local parameter.

Parameters

Input argument pos | Index of the local parameter to access.
Input argument val | A pointer to the value to be set
Input argument size | Integer specifying the size of the value or 0 to use the default size of the parameter.

Returns

CK_OK if successful, an error code otherwise

Remarks

This function is just a shortcut to the CKParameterLocal::SetValue function.

See Also

CKParameterLocal::SetValue,GetLocalParameter


CKBehavior::AddOutputParameter

Method CKBehavior::AddOutputParameter

void CKBehavior::AddOutputParameter(CKParameterOut *p)

Adds an existing output parameter.

Parameters

Input argument p

A pointer to the output parametert to be added.

Remarks

Adds a CKParameterOut p to the end of the list of output parameters.

See Also

CKParameterOut, CreateOutputParameter


CKBehavior::CreateOutputParameter

Method CKBehavior::CreateOutputParameter

CKParameterOut *CKBehavior::CreateOutputParameter(CKSTRING name,CKGUID guid)
CKParameterOut *CKBehavior::CreateOutputParameter(CKSTRING name,CKParameterType type)

Creates an output parameter on a behavior.

Returns

Pointer to the created output parameter.

Remarks

+The name parameter should be passed as a constant string. For example: beh->CreateOutputParameter("Vector",CKPGUID_VECTOR); +Creates a new output parameter with the given type or guid, and adds it at the end of the output parameter list. +The behavior has output parameters, that may be used by other behaviors to get results from the processing of the behavior. These methods manage the list of output parameters. Output parameters are accessed by their index in the list. The name is provided as a conveniency for display and debugging purposes. The parameter types are managed by the parameter manager.

See Also

CKParameterManager, CKParameterOut


CKBehavior::EnableOutputParameter

Method CKBehavior::EnableOutputParameter

void CKBehavior::EnableOutputParameter(int pos,CKBOOL enable)

Enables an output parameter.

Parameters

Input argument pos | position of the output parameter.
Input argument enable | whether it should be enabled or disabled.

Remarks

+Output parameters can be disabled. Disabled output parameters are not shown in the interface nor can they be edited when editing behavior parameters. +Common usage of this function is to disable specific output parameters according to the behavior settings.

See Also

CKParameterOut,EnableInputParameter


CKBehavior::ExportOutputParameter

Method CKBehavior::ExportOutputParameter

CKERROR CKBehavior::ExportOutputParameter(CKParameterOut *p)

Exports an output parameter.

Parameters

Input argument p

A pointer to the output parameter.

Returns

CK_OK if successful, otherwise error code.

Remarks

Exports an output parameter owned by a sub-behavior so that it is accessible from outside the behavior, and adds it at the end of the output parameter list.

See Also

CKParameterOut


CKBehavior::GetOutputParameter

Method CKBehavior::GetOutputParameter

CKParameterOut *CKBehavior::GetOutputParameter(int pos)

Gets the output parameter at the given position.

Parameters

Input argument pos

Index of the output parameter to access.

Returns

Pointer to a CKParameterOut.

See Also

CKParameterOut, GetOutputParameterCount


CKBehavior::GetOutputParameterCount

Method CKBehavior::GetOutputParameterCount

int CKBehavior::GetOutputParameterCount()

Gets the output parameter count.

Returns

Number of output parameters.

See Also

AddOutputParameter, GetOutputParameter


CKBehavior::GetOutputParameterObject

Method CKBehavior::GetOutputParameterObject

CKObject* CKBehavior::GetOutputParameterObject(int pos)

Gets the object contained in an output parameter

Parameters

Input argument pos

Index of the output parameter to access

Returns

pointer to the CKObject contained.

See Also

GetOutputParameter, SetOutputParameterObject


CKBehavior::GetOutputParameterPosition

Method CKBehavior::GetOutputParameterPosition

int CKBehavior::GetOutputParameterPosition(CKParameterOut *p)

Gets the output parameter position.

Parameters

Input argument p

A pointer to an output parameter

Returns

Position of the given output parameter if found, else returns -1.

See Also

CKParameterOut


CKBehavior::GetOutputParameterValue

Method CKBehavior::GetOutputParameterValue

CKERROR CKBehavior::GetOutputParameterValue(int pos,void* val)

Gets the value of an output parameter.

Parameters

Input argument pos | Index of the output parameter to access.
Input argument val | A pointer to a buffer where the value is to be copied.

Returns

CK_OK if successful, CKERR_INVALIDPARAMETER otherwise.


CKBehavior::GetOutputParameterWriteDataPtr

Method CKBehavior::GetOutputParameterWriteDataPtr

void* CKBehavior::GetOutputParameterWriteDataPtr(int pos)

Returns a pointer to the data of an output parameter.

Parameters

Input argument pos

Index of the output parameter

Returns

pointer to the parameter data.

Remarks

This method tests the output parameter at specified position and returns read data pointer

See Also

CKParameterOut


CKBehavior::InsertOutputParameter

Method CKBehavior::InsertOutputParameter

CKParameterOut *CKBehavior::InsertOutputParameter(int pos,CKSTRING name,CKParameterType type)
void CKBehavior::InsertOutputParameter(int pos,CKParameterOut* p)

Inserts an output parameter.

Parameters

Input argument pos | Index of the desired parameter position.
Input argument p | A pointer to the CKParameterOut to add.

Returns

A pointer to the output parameter created and inserted.

Remarks

Creates a new output parameter, with the given optional name, and the given parameter type index or GUID, and inserts this new parameter at the given position in the output parameter list

See Also

CKParameterOut, CKContext


CKBehavior::IsOutputParameterEnabled

Method CKBehavior::IsOutputParameterEnabled

CKBOOL CKBehavior::IsOutputParameterEnabled(int pos)

Checks whether output parameter is enabled or not

Parameters

Input argument pos

Index of the output parameter

Returns

Value | Meaning
TRUE | if the output parameter is enabled,
FALSE | otherwise.

See Also

CKParameterOut, EnableOutputParameter


CKBehavior::RemoveOutputParameter

Method CKBehavior::RemoveOutputParameter

CKParameterOut *CKBehavior::RemoveOutputParameter(int pos)

Removes an output parameter from the behavior.

Parameters

Input argument pos

Index of the output parameter.

Returns

Pointer to the removed output parameter.

See Also

CKParameterOut, GetOutputParameter


CKBehavior::ReplaceOutputParameter

Method CKBehavior::ReplaceOutputParameter

CKParameterOut *CKBehavior::ReplaceOutputParameter(int pos,CKParameterOut *p)

Replaces an output parameter.

Parameters

Input argument pos | Index of the parameter to replace.
Input argument p | Pointer to the output parameter to set.

Returns

A pointer to the output parameter that was existing at pos.

See Also

CKParameterOut


CKBehavior::SetOutputParameterObject

Method CKBehavior::SetOutputParameterObject

CKERROR CKBehavior::SetOutputParameterObject(int pos,CKObject *obj)

Sets the value of an output parameter containing an object.

Parameters

Input argument pos | Index of the output parameter to access.
Input argument obj | pointer to CKObject to be set.

Returns

CK_OK if successful, CKERR_INVALIDPARAMETER otherwise.

See Also

GetOutputParameter, CKParameterOut::SetValue


CKBehavior::SetOutputParameterValue

Method CKBehavior::SetOutputParameterValue

CKERROR CKBehavior::SetOutputParameterValue(int pos,const void* val,int size)

Sets the value of an output parameter.

Parameters

Input argument pos | Index of the output parameter to access.
Input argument val | A pointer to the value to be set
Input argument size | Integer specifying the size of the value or 0 to use the default size of the parameter.

Returns

CK_OK if successful, otherwise error code.

Remarks

This function is just a shortcut to the CKParameterOut::SetValue function.

See Also

CKParameterOut::SetValue,GetOutputParameter


CKBehavior::AddParameterOperation

Method CKBehavior::AddParameterOperation

CKERROR CKBehavior::AddParameterOperation(CKParameterOperation *op)

Management of parameter operations

Returns

CK_OK if successful, otherwise error code.

Remarks

If the behavior is implemented as a graph, it may have parameter operations, just like it has sub-behaviors. These methods provide way to manage the list of parameter operations used in the graph.

AddParameterOperation: Adds the given operation at the end of the list RemoveParameterOperation: Removes the operation that is at the given position GetParameterOperation: Returns the operation at the given position GetParameterOperationCount: Returns the number of operations in the list

See Also

CKParameterOperation,CreateCKParameterOperation


CKBehavior::GetParameterOperation

Method CKBehavior::GetParameterOperation

CKParameterOperation *CKBehavior::GetParameterOperation(int pos)

Gets the parameter operation at a given position.

Parameters

Input argument pos

Index of the parameter operation.

Returns

A pointer to the parameter operation at the given position

See Also

CKParameterOperation, GetParameterOperationCount


CKBehavior::GetParameterOperationCount

Method CKBehavior::GetParameterOperationCount

int CKBehavior::GetParameterOperationCount()

Gets the parameter operations count

Returns

Number of parameter operations in the behavior.

See Also

CKParameterOperation, GetParameterOperation


CKBehavior::RemoveParameterOperation

Method CKBehavior::RemoveParameterOperation

CKParameterOperation *CKBehavior::RemoveParameterOperation(int pos)
CKParameterOperation *CKBehavior::RemoveParameterOperation(CKParameterOperation *op)

Removes a parameter operation from the behavior.

Parameters

Input argument pos | Index of the parameter operation.
Input argument op | A pointer to parameter operation that is to be removed.

Returns

A pointer to the CKParameterOperation removed, NULL if it failed

See Also

CKParameterOperation


CKBehavior::GetOwner

Method CKBehavior::GetOwner

CKBeObject *CKBehavior::GetOwner()

Returns the owner of the behavior

Returns

A pointer to the owner of the behavior

Remarks

+Each behavior has an unique owner, and is considered to belong to it.The owner is a instance of a CKBeObject or of a derived class. When the owner is saved to a file or to a state, it saves all of its behaviors and scripts. +The user should not used this function to retrieve the object on which this behavior applies, instead use GetTarget. +The owner of a behavior is set with the CKBeObject:AddBehavior or CKBeObject::AddScript methods.

See Also

CKBeObject,GetTarget


CKBehavior::GetTarget

Method CKBehavior::GetTarget

CKBeObject* CKBehavior::GetTarget()

Returns the target of the behavior

Returns

A pointer to the target of the behavior

Remarks

+The target of a behavior is the object to which the behavior should make modifications. +If a behavior is not targetable, it means it can only modify its owner in which case the GetTarget function returns the owner of the behavior (as GetOwner) +A behavior can be set as targetable (see SetAsTargetable and CKBehaviorPrototype::SetBehaviorFlags)

See Also

CKBeObject,GetTarget,UseTarget


CKBehavior::GetTargetParameter

Method CKBehavior::GetTargetParameter

CKParameterIn* CKBehavior::GetTargetParameter()

Gets the target parameter.

Returns

A pointer to target parameter

See Also

UseTarget, IsUsingTarget


CKBehavior::IsTargetable

Method CKBehavior::IsTargetable

CKBOOL CKBehavior::IsTargetable()
void CKBehavior::SetAsTargetable(CKBOOL target)

Returns whether the behavior is targetable.

Returns

TRUE if the behavior is targetable.

Remarks

SetAsTargetable sets this behavior to be targetable by setting or removing the flag CKBEHAVIOR_TARGETABLE.

See Also

GetTarget,UseTarget,CKBehaviorPrototype::SetBehaviorFlags


CKBehavior::IsUsingTarget

Method CKBehavior::IsUsingTarget

CKBOOL CKBehavior::IsUsingTarget()

Checks whether the behavior is using target or not

Returns

TRUE if the behavior is using target, FALSE otherwise.

See Also

GetTargetParameter, UseTarget


CKBehavior::RemoveTargetParameter

Method CKBehavior::RemoveTargetParameter

CKParameterIn* CKBehavior::RemoveTargetParameter()

Removes input target parameter

Returns

Pointer to target parameter removed.

See Also

UseTarget


CKBehavior::ReplaceTargetParameter

Method CKBehavior::ReplaceTargetParameter

CKParameterIn* CKBehavior::ReplaceTargetParameter(CKParameterIn* targetParam)

Replaces the target parameter.

Parameters

targetparam: Pointer to target parameter that replaces current parameter.

Returns

Pointer to the old parameter.

See Also

UseTarget


CKBehavior::UseTarget

Method CKBehavior::UseTarget

CKERROR CKBehavior::UseTarget(CKBOOL Use)

Management of the target input parameter

Parameters

Input argument Use

A boolean specifying whether to enable or disable the target parameter.

Returns

Value | Meaning
CK_OK | if successful
CKERR_INVALIDPARAMETER | if the behavior can not be targeted.

Remarks

+UseTarget creates or deletes an additional input parameter used to specify the target of the behavior. The type of this input parameter is the corresponding type for the compatible class identifier of the behavior (See GetCompatibleClassID). In the following figure the first rotate behavior is not using a target whereas the second can rotates an other object specified in the target parameter.

+One can know if a behavior is using a target with IsUsingTarget, in such case the input parameter can be retrieve with GetTargetParameter or replaced by an other input parameter with ReplaceTargetParameter.

See Also

CKBeObject,GetTarget


CKBehavior::Activate

Method CKBehavior::Activate

void CKBehavior::Activate(CKBOOL active, CKBOOL breset)

Activates the behavior.

Parameters

Input argument active | TRUE to activate the behavior, FALSE to deactivate it.
Input argument breset | TRUE if all sub behaviors, inputs, outputs and behavior links should be reseted.

Remarks

The behavior is not active when it is created, except if its prototype is defined to make it active at creation time. The behavior is active is at least one of its inputs is active. When a behavior is active, its execution function is called at each process loop. A behavior with no active sub-behaviors will automatically deactivate itself.

See Also

IsActive


CKBehavior::Execute

Method CKBehavior::Execute

int CKBehavior::Execute(float delta)

Executes the behavior

Parameters

Input argument delta

Delta time since last frame in milliseconds.

Returns

A CK_BEHAVIOR_RETURN value.

Remarks

If the behavior is a building block Execute calls the behavior function and returns its return value.

If the behavior is the graph, the following operations are done:

For every active behavior link in this behavior, the link delay is decremented. If the updated link delay equals 0 then the corresponding behavior IO is activated. If an input of a sub-behavior is activated the sub-behavior is activated.

The behavior manages a stack of active sub-behaviors. These sub-behaviors are sorted according to their priority.

For each sub-behavior in the active stack, the sub-behavior is poped out from the stack and CKBehavior::Execute is called. If an ouput is activated it activates the corresponding behavior-link. If the link delay of a link is 0, the linked input and sub-behavior are activated and the sub-behavior is pushed in the active behavior stack.

If at the end of execution there is no sub-behaviors active nor sub-behaviors that are waiting for messages, the behavior is deactivated.

See Also

SetPriority, Activate


CKBehavior::GetPriority

Method CKBehavior::GetPriority

int CKBehavior::GetPriority()

Gets the priority of the behavior

Returns

Priority of the behavior

See Also

SetPriority


CKBehavior::GetShortestDelay

Method CKBehavior::GetShortestDelay

int CKBehavior::GetShortestDelay(CKBehavior* beh)

Returns the shortest link delay to go from the caller behavior to another one.

Parameters

Input argument beh

The behavior to go to.

Returns

Shortest existing link delay from this behavior to beh or 1000 if no such path exists.

Remarks

This function allows you to detect 0 link delay and thus warn the user.

See Also

Interrupt


CKBehavior::IsActive

Method CKBehavior::IsActive

CKBOOL CKBehavior::IsActive()

Returns TRUE if the behavior is active

Returns

TRUE if the behavior is currently active, FALSE otherwise.

Remarks

The behavior is not active when it is created, except if its prototype is defined to make it active at creation time. The behavior is active is at least one of its inputs is active. When a behavior is active, its execution function is called at each process loop.

See Also

Activate


CKBehavior::IsParentScriptActiveInScene

Method CKBehavior::IsParentScriptActiveInScene

CKBOOL CKBehavior::IsParentScriptActiveInScene(CKScene *scn)

Returns TRUE if the script containing the behavior is active

Returns

Non-Zero value if the parent script is currently active, zero otherwise.

See Also

Interrupt


CKBehavior::SetPriority

Method CKBehavior::SetPriority

void CKBehavior::SetPriority(int p)

Sets or gets the priority of the behavior.

Parameters

Input argument p

Priority of the behavior (default is 0).

Remarks

Behaviors with priority higher are executed first.

In the following figure, the higher priorities of Counter and Rotate behaviors makes them executes before the translate behavior. Since the behavior link as a 0 delay the rotates behavior will be called 5 times in this frame before translate behavior is called.

See Also

Execute, GetPriority


CKBehavior::GetFunction

Method CKBehavior::GetFunction

CKBEHAVIORFCT CKBehavior::GetFunction()

Gets the execution function of the behavior

Returns

Currently used execution function.

See Also

CKBEHAVIORFCT, SetFunction


CKBehavior::SetCallbackFunction

Method CKBehavior::SetCallbackFunction

void CKBehavior::SetCallbackFunction(CKBEHAVIORCALLBACKFCT fct)

Sets the callback function to be used by the behavior

Parameters

Input argument fct

A pointer to the new callback function

Returns

None

Remarks

The callback function is used for maintenace purposes. It is called by the CK2 library at various stages in the lifetime of the behavior: when it is first attached to an owner, when it is detached, etc... The full list of callbacks is:

CKM_BEHAVIORCREATE Called when the behavior is created

CKM_BEHAVIORDELETE Called when the behavior is deleted (warning, in authoring, the behavior is not deleted immediatly, but when the undo buffer will be flushed.)

CKM_BEHAVIORATTACH Called when the behavior is attached to an object

CKM_BEHAVIORDETACH Called when the behavior is detached from an object or deleted.

CKM_BEHAVIORPRESAVE Called at the start of a save operation

CKM_BEHAVIORPOSTSAVE Called at the end of a save operation

CKM_BEHAVIORRESET Called when CKReset() function is called ( i.e behaviors execution stop)

CKM_BEHAVIORPAUSE Called when the process loop is paused (CKPause)

CKM_BEHAVIORRESUME Called when the process loop starts (CKPlay)

CKM_BEHAVIORLOAD Called when behavior is loaded ( ATTACH CALLBACK is not called )

CKM_BEHAVIOREDITED Called when behavior is edited in the User Interface

CKM_BEHAVIORSETTINGSEDITED Called when behavior settings (local parameters defined as settings in the prototype) is edited in the User Interface

CKM_BEHAVIORREADSTATE

CKM_BEHAVIORNEWSCENE Called when a new scene is launched (CKLevel::LaunchScene)

CKM_BEHAVIORACTIVATESCRIPT Called when the script containing the behavior is activated (CKScene::Activate)

CKM_BEHAVIORDEACTIVATESCRIPT Called when the script containing the behavior is deactivated (CKScene::DeActivate)

CKM_BEHAVIORRESETINBREAKBPOINT A behavior can return a value CKBR_BREAK which break the execution loop, the behavior is called in loop until it returns a value different from CKBR_BREAK. Since the interface is called meanwhile the user can call Reset which stops the execution and force the process loop to exit from this breakpoint. Managing the CKM_BEHAVIORRESETINBREAKBPOINT enables the building block to clean any data that would have been created at the beginning of execution.

A callback function can be provided whether the behavior uses a graph or an execution function for its execution, it will be called the same way in all cases.

Use the SetCallbackFunction to assign a new callback function. Use the GetCallbackFunction method to get the current callback function.

See Also

A Sample Behavior DLL


CKBehavior::SetFunction

Method CKBehavior::SetFunction

void CKBehavior::SetFunction(CKBEHAVIORFCT fct)

Manages the execution function for the behavior

Remarks

The execution function is the function used to implement the behavior, in the case it is not a behavior graph.

If the behavior is set to use an execution function for its execution, the SetFunction method is the way you specify which execution function to use. The execution function takes one argument: the time in milliseconds since the last time it was called. If the behavoir is set to use the graph of its sub-behaviors, the provided execution function will not be called. You can provide both a graph and a function and switch between the two using UseGraph and UseFunction. The GetFunction returns the currently used execution function.

See Also

UseFunction, UseGraph, IsUsingFunction


CKBehavior::GetFlags

Method CKBehavior::GetFlags

CK_BEHAVIOR_FLAGS CKBehavior::GetFlags()

Gets the flags of the behavior

Returns

Flags of the behavior

See Also

SetFlags, ModifyFlags


CKBehavior::ModifyFlags

Method CKBehavior::ModifyFlags

CK_BEHAVIOR_FLAGS CKBehavior::ModifyFlags(CKDWORD Add,CKDWORD Remove)

Modifies the flags of the behavior

Parameters

Input argument Add | Flags to be added
Input argument Remove | Flags to be removed.

Returns

Current Flags of the behavior after modification.

See Also

CK_BEHAVIOR_FLAGS, SetFlags, GetFlags


CKBehavior::SetFlags

Method CKBehavior::SetFlags

void CKBehavior::SetFlags(CK_BEHAVIOR_FLAGS flgs)

Sets the flags of the behavior.

Parameters

Flags : A combination of CK_BEHAVIOR_FLAGS.

Remarks

+The behavior flags are used by the render engine to update internal data, to optimize mesh structure or to set information about the mesh. +Most of the flags can be accessed through this function or are set via a direct function of CKBehavior:

CKBEHAVIOR_WAITSFORMESSAGE  : SetWaitForMessage
CKBEHAVIOR_TARGETABLE           : SetAsTargetable
CKBEHAVIOR_EXECUTEDLASTFRAME    : Execute
CKBEHAVIOR_ACTIVE               : Execute,Activate
CKBEHAVIOR_USEFUNCTION      : UseFunction,UseGraph

See Also

CK_BEHAVIOR_FLAGS, ModifyFlags, GetFlags


CKBehavior::GetLastExecutionTime

Method CKBehavior::GetLastExecutionTime

float CKBehavior::GetLastExecutionTime()

Returns time taken by the behavior for its execution.

Returns

Last execution time in milliseconds.

Remarks

Profiling must be enable (CKContext::EnableProfiling) for the return value to be coherent.

See Also

CKContext::EnableProfiling


CKBehavior::AddSubBehavior

Method CKBehavior::AddSubBehavior

CKERROR CKBehavior::AddSubBehavior(CKBehavior *cbk)

Management of sub-behaviors

Returns

CK_OK if successful, otherwise error code.

Remarks

For behaviors which use a graph of sub-behaviors as their implementation, these methods provides ways to manage the list of used sub-behaviors. When a behaviors is saved, all of its sub-behaviors are saved with it. The exact topology of the sub-behaviors can be specified using the sub-behaviors output, inputs, links etc...

The AddSubBehavior methods add the behavior given as an argument as a sub-behavior of the target behavior. It also sets the owner of the new sub-behavior as the same owner as the target's one.

The RemoveSubBehavior removes the behavior given from the list of sub-behaviors, and returns it.

The GetSubBehavior method returns the sub-behavior at the given position, and the GetSubBehaviorCount method returns the number of sub-behaviors of the target behavior.

See Also

CKBehaviorLink, CKBehaviorIO, CKBehavior::GetOutput, CKBehavior::GetInput, CKBehavior::AddSubBehaviorLink


CKBehavior::GetOwnerScript

Method CKBehavior::GetOwnerScript

CKBehavior *CKBehavior::GetOwnerScript()

Retuns the script in which this behavior is used.

Returns

A pointer to the parent script.

Remarks

The owner script is the topmost parent CKBehavior which has the type CKBEHAVIORTYPE_SCRIPT.

See Also

AddSubBehavior,GetParent


CKBehavior::GetParent

Method CKBehavior::GetParent

CKBehavior *CKBehavior::GetParent()

Retuns the parent behavior of this behavior.

Returns

A pointer to the parent CKBehavior .

See Also

AddSubBehavior,GetOwnerScript


CKBehavior::GetSubBehavior

Method CKBehavior::GetSubBehavior

CKBehavior *CKBehavior::GetSubBehavior(int pos)

Returns the sub behavior at a given position.

Parameters

Input argument pos

Position.

Returns

A pointer to the sub behavior at the given position

See Also

GetSubBehaviorCount


CKBehavior::GetSubBehaviorCount

Method CKBehavior::GetSubBehaviorCount

int CKBehavior::GetSubBehaviorCount()

Gets the number of sub behaviors in the behavior.

Returns

Number of sub behaviors in the behavior.

See Also

GetSubBehavior


CKBehavior::RemoveSubBehavior

Method CKBehavior::RemoveSubBehavior

CKBehavior *CKBehavior::RemoveSubBehavior(int pos)
CKBehavior *CKBehavior::RemoveSubBehavior(CKBehavior *cbk)

Removes a sub behavior.

Parameters

Input argument cbk | Pointer to the sub behavior to be removed.
Input argument pos | Position at which the sub behavior is to be removed.

Returns

A pointer to the behavior removed.

Remarks

Removes a behavior from the list of sub-behaviors at given position, and returns a pointer to the removed behavior.

See Also

GetSubBehavior, GetSubBehaviorCount


CKBehavior::GetCompatibleClassID

Method CKBehavior::GetCompatibleClassID

CK_CLASSID CKBehavior::GetCompatibleClassID()

Gets the compatible class ID of the behavior.

Returns

The compatible Class ID of the behavior.

Remarks

The compatible class ID is the class ID of the highest class in the CKObject hierarchy by which the behavior can be owned. This is used to decide to which object the behavior can be applied or not. GetCompatibleClassID returns the compatible class ID of the behavior.

If you create your own behavior, either internally or through a dll, you should specify which class hierarchy it can be applied to, using the SetCompatibleClassID method.

See Also

SetCompatibleClassID, CKObject::GetClassID,CKObjectDeclaration::SetCompatibleClassID,Class Hierarchy


CKBehavior::GetType

Method CKBehavior::GetType

CK_BEHAVIOR_TYPE CKBehavior::GetType()

Gets the type of the behavior.

Returns

The type of the behavior.

Remarks

The type of the behavior can be any of these values:

CKBEHAVIORTYPE_BASE | This Behavior is a most simple type of behavior ( a function )
CKBEHAVIORTYPE_SCRIPT | This Behavior is a script
CKBEHAVIORTYPE_BEHAVIOR | This Behavior is a simple one ( a graph )

See Also

SetType, CK_BEHAVIOR_TYPE


CKBehavior::IsUsingFunction

Method CKBehavior::IsUsingFunction

int CKBehavior::IsUsingFunction()

Checks if the behavior is using function

Returns

TRUE if the behavior uses a function.

See Also

CK_BEHAVIOR_FLAGS, UseFunction


CKBehavior::SetCompatibleClassID

Method CKBehavior::SetCompatibleClassID

void CKBehavior::SetCompatibleClassID(CK_CLASSID ckcid)

Sets the compatible class id of the behavior

Parameters

Input argument ckcid

compatible class id to be set.

See Also

GetCompatibleClassID


CKBehavior::SetType

Method CKBehavior::SetType

void CKBehavior::SetType(CK_BEHAVIOR_TYPE Type)

Sets the type of the behavior.

Parameters

type: type of the behavior

See Also

GetType, CK_BEHAVIOR_TYPE


CKBehavior::UseFunction

Method CKBehavior::UseFunction

void CKBehavior::UseFunction()

Defines the behavior as using a function for its execution.

Remarks

UseFunction defines the behavior as using a function for its execution. Use SetFunction to specify the function to use.

See Also

UseGraph, SetFunction


CKBehavior::UseGraph

Method CKBehavior::UseGraph

void CKBehavior::UseGraph()

Enables behavior to use graph.

Remarks

+UseGraph defines the behavior as using a graph of sub behaviors for its execution. +Use AddSubBehavior and RemoveSubBehavior for the management of the graph of sub behaviors.

See Also

CKBEHAVIOR_USEFUNCTION, CKBEHAVIOR_BUILDINGBLOCK


CKBehaviorIO

Class CKBehaviorIO

Behaviors Input and Outputs

CKObject
Show brief derivation trees

CKBehaviorIO

CKObject
Show full derivation trees

CKBehaviorIO

Remarks

This class is rarely used since all the methods needed to check or trigger inputs/outputs activity are available in CKBehaviorClass

A CKBehaviorIO is created by CKBehavior::CreateInput,CKBehavior::CreateOutput methods.

The class id of CKBehaviorIO is CKCID_BEHAVIORIO.

Groups

Operations
Method Activate | Activates or deactivates the behavior IO.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method GetOwner | Returns the owner behavior.
Method GetType | Returns whether the behavior IO is an input or output.
Method IsActive | Returns whether the behavior IO is active.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Method SetType | Specifies if the behavior IO is an input or output.

See Also

CKBehavior


CKBehaviorIO::Activate

Method CKBehaviorIO::Activate

void CKBehaviorIO::Activate(CKBOOL Active=TRUE)

Activates or deactivates the behavior IO.

Parameters

Input argument Active

TRUE to activate the behavior IO.

See Also

IsActive


CKBehaviorIO::GetOwner

Method CKBehaviorIO::GetOwner

CKBehavior *CKBehaviorIO::GetOwner()

Returns the owner behavior.

Returns

A pointer to the CKBehavior this IO belongs to.

See Also

SetOwner


CKBehaviorIO::GetType

Method CKBehaviorIO::GetType

int CKBehaviorIO::GetType()

Returns whether the behavior IO is an input or output.

Returns

Returns CK_BEHAVIORIO_IN if this Io is an input. Returns CK_BEHAVIORIO_OUT if it is an output.

See Also

GetType


CKBehaviorIO::IsActive

Method CKBehaviorIO::IsActive

CKBOOL CKBehaviorIO::IsActive()

Returns whether the behavior IO is active.

Returns

TRUE if IO is curerntly active, FALSE otherwise

See Also

Activate


CKBehaviorIO::SetType

Method CKBehaviorIO::SetType

void CKBehaviorIO::SetType(int Type)

Specifies if the behavior IO is an input or output.

Parameters

Input argument Type

CK_BEHAVIORIO_IN if this Io is an input or CK_BEHAVIORIO_OUT if it is an output.

See Also

GetType


CKBehaviorLink

Class CKBehaviorLink

Links between behaviors Inputs/Outputs

CKObject
Show brief derivation trees

CKBehaviorLink

CKObject
Show full derivation trees

CKBehaviorLink

Remarks

The behavior links provide activation propagation between behaviors in a graph. Each link receives the activation from its input and propagates the activation from its input to its output, immediately or with a given delay.

Its input can be the output of a behavior, or another input from the containing behavior.

Its output can be the input of another behavior, or the output of the containing behavior.

The class id of CKBehaviorLink is CKCID_BEHAVIORLINK.

Groups

Operations
Method GetActivationDelay | Management of the activation delay
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Method SetInBehaviorIO | Management of the link's input
Method SetInitialActivationDelay | Management of the initial activation delay.
Method SetOutBehaviorIO | Management of the link's output

See Also

CKBehavior,CKBehaviorIO


CKBehaviorLink::GetActivationDelay

Method CKBehaviorLink::GetActivationDelay

int CKBehaviorLink::GetActivationDelay()
void CKBehaviorLink::SetActivationDelay(int delay)
void CKBehaviorLink::ResetActivationDelay()

Management of the activation delay

Returns

activation delay in number of frames for this link.

Remarks

The activation delay is the number of frames after which the output of the link is activated once the input of the link has triggered the link.

The GetActivationDelay returns the current activation delay. The SetActivationDelay sets the new activation delay. This delay has to be >= 0. At creation time, the activation delay is set to 1, that is that the output is activated one frame after the input has been activated.

The ResetActivationDelay sets back the activation delay to its initial value, that had been specified with SetInitialActivationDelay.

See Also

SetInitialActivationDelay


CKBehaviorLink::SetInBehaviorIO

Method CKBehaviorLink::SetInBehaviorIO

CKBehaviorIO* CKBehaviorLink::GetInBehaviorIO()
CKERROR CKBehaviorLink::SetInBehaviorIO(CKBehaviorIO *ckbio)

Management of the link's input

Returns

CK_OK if successful, an error code otherwise

Remarks

These methods relate to the input of the link, which is an I/O of a behavior. It can be the output of a behavior of the same graph, or an input of the behavior containing the graph. The GetInBehaviorIO returns the CKBehaviorIO to which the input of the link refers.

See Also

CKBehaviorIO


CKBehaviorLink::SetInitialActivationDelay

Method CKBehaviorLink::SetInitialActivationDelay

void CKBehaviorLink::SetInitialActivationDelay(int delay)
int CKBehaviorLink::GetInitialActivationDelay()

Management of the initial activation delay.

Remarks

The initial activation delay is the default value of the activation delay. Even if the activation delay is changed, the initial activation delay remains the same. The activation delay can be reset to be equal to the initial activation delay with the ResetActivationDelay method.

The GetInitialActivationDelay returns the current initial activation delay. At creation time, the initial activation delay is set to 1.

The SetInitialActivationDelay sets a new value for the initial activation delay. This value must be >= 0 and <32765.

See Also

ResetActivationDelay,GetActivationDelay


CKBehaviorLink::SetOutBehaviorIO

Method CKBehaviorLink::SetOutBehaviorIO

CKBehaviorIO* CKBehaviorLink::GetOutBehaviorIO()
CKERROR CKBehaviorLink::SetOutBehaviorIO(CKBehaviorIO *ckbio)

Management of the link's output

Returns

CK_OK if successful, an error code otherwise

Remarks

These methods relate to the output of the link, which is an I/O of a behavior. It can be the input of a sub-behavior of the same graph, or an output of the behavior containing the graph.. The GetOutBehaviorIO returns the CKBehaviorIO to which the output of the link refers.

See Also

CKBehaviorIO


CKBehaviorPrototype

Class CKBehaviorPrototype

Class describing the prototype of a behavior

Remarks

A behavior prototype is a kind of model for behaviors. Behavior prototypes describe the behavior's internal structure and relationships with other objects. Prototypes are usually created in external dlls, but may be created in memory. For more information on creation of behavior dlls take a look to the behavior samples joined in this SDK.

Prototypes are usually defined in a Dll. This prototype is created the first time it is needed, that is either when a behavior in Virtools is drag-n-dropped onto an object, or when a behavior is loaded that is derived from the prototype. In this case, the main dll entry point CKDLL_CREATEPROTOFUNCTION will create the behavior prototype, that will be used to create the behavior using the CKBehavior::InitFromPrototype method. A prototype may use other prototypes, as sub-prototypes, thus generating sub-behaviors.

Each prototype that should be standalone, either in a dll, or in a standalone file, should have a GUID. A guid can be generated by using the CKGetSecureGuid function. If the prototype is created in a dll, the GUID is provided using the object declaration. If the prototype is created in memory, the GUID can be set using the CKBehaviorPrototype::SetGuid method.

A name can be provided for various parts of the behavior. This name is not used for indexing and does not have to be unique. It is provided as a conveniency for display and debugging purposes.

A CKBehaviorPrototype is created with CreateCKBehaviorPrototype.

Groups

Operations
Method GetApplyToClassID | Returns class ID to corresponding class applied with behaviour
Method GetBehaviorFlags | Returns the Behaviour flags set when it is created.
Method GetFlags | Returns the flags describing the prototype
Method GetGuid | Returns the GUID of this prototype
Method GetName | Returns the name of this prototype
Method GetSoureObjectDeclaration | Object declaration that created this protoype
Method SetApplyToClassID | Management of which class of objects can accept a behavior created from this prototype
Method SetBehaviorCallbackFct | Management of the callback function
Method SetBehaviorFlags | Determines flags to set to the behavior when it is created
Method SetFunction | Management of the execution function of the behavior issued from the prototype
Method SetGuid | Sets the GUID of the prototype
Inputs/Outputs Declaration
Virtual Method Method DeclareInParameter | Declaring parameters
Virtual Method Method DeclareInput | Declares an new input for the prototype
Virtual Method Method DeclareOutput | Declares an new output for the prototype
Type Definitions
Method SetFlags | Manages the flags describing the prototype

See Also

CreateCKBehaviorPrototype,CKBehavior


CKBehaviorPrototype::GetApplyToClassID

Method CKBehaviorPrototype::GetApplyToClassID

CK_CLASSID CKBehaviorPrototype::GetApplyToClassID()

Returns class ID to corresponding class applied with behaviour

Returns

Class ID

See Also

SetApplyToClassID


CKBehaviorPrototype::GetBehaviorFlags

Method CKBehaviorPrototype::GetBehaviorFlags

CK_BEHAVIOR_FLAGS CKBehaviorPrototype::GetBehaviorFlags()

Returns the Behaviour flags set when it is created.

Returns

behavior flags

See Also

CK_BEHAVIOR_FLAGS, SetBehaviorFlags


CKBehaviorPrototype::GetFlags

Method CKBehaviorPrototype::GetFlags

CK_BEHAVIORPROTOTYPE_FLAGS CKBehaviorPrototype::GetFlags()

Returns the flags describing the prototype

Returns

Flags

See Also

CK_BEHAVIORPROTOTYPE_FLAGS, CKBehaviorPrototype::SetFlags


CKBehaviorPrototype::GetGuid

Method CKBehaviorPrototype::GetGuid

CKGUID CKBehaviorPrototype::GetGuid()

Returns the GUID of this prototype

Returns

CKGUID of this prototype

See Also

SetGuid


CKBehaviorPrototype::GetName

Method CKBehaviorPrototype::GetName

CKSTRING CKBehaviorPrototype::GetName()

Returns the name of this prototype

Returns

Prototype name.

See Also

GetGuid


CKBehaviorPrototype::GetSoureObjectDeclaration

Method CKBehaviorPrototype::GetSoureObjectDeclaration

CKObjectDeclaration* CKBehaviorPrototype::GetSoureObjectDeclaration()

Object declaration that created this protoype

Returns

A pointer to CKObjectdeclaration that was used to create this prototype


CKBehaviorPrototype::SetApplyToClassID

Method CKBehaviorPrototype::SetApplyToClassID

void CKBehaviorPrototype::SetApplyToClassID(CK_CLASSID cid)

Management of which class of objects can accept a behavior created from this prototype

Remarks

The behavior can be applied on any instance of the class corresponding to this CK_CLASSID, or of one of its derived classes.

See Also

GetApplyToClassID,CKBehavior::GetCompatibleClassID


CKBehaviorPrototype::SetBehaviorCallbackFct

Method CKBehaviorPrototype::SetBehaviorCallbackFct

void CKBehaviorPrototype::SetBehaviorCallbackFct(CKBEHAVIORCALLBACKFCT fct,CKDWORD CallBackMask,void *param)
CKBEHAVIORCALLBACKFCT CKBehaviorPrototype::GetBehaviorCallbackFct()

Management of the callback function

Parameters

Input argument fct | the function that will be called for handling messages
Input argument CallBackMask | A mask indicating which messages should be sent to the callback function. (see CK_BEHAVIOR_CALLBACKMASK)
Input argument param | User-provided argument, for any purpose suitable.

Remarks

The callback function is called at all stages of the lifetime of the behavior. It can be used to perform various maintenance operations concerning the behavior.

SetBehaviorCallbackFct: sets the callback function GetBehaviorCallbackFct: returns the callback function

The full list of callbacks is:

+CKM_BEHAVIORATTACH called when the behavior is attached to an object

+CKM_BEHAVIORDETACH called when the behavior is detached from an object

+CKM_BEHAVIORDELETE called at the deletion of the behavior ( DETACH CALLBACK is not called )

+CKM_BEHAVIORPRESAVE called at the start of a save operation

+CKM_BEHAVIORPOSTSAVE called at the end of a save operation

+CKM_BEHAVIORRESET called when CKContext::Reset() function is called ( i.e behaviors execution stop)

+CKM_BEHAVIORPAUSE called when behaviors execution is paused (e.g. CKContext::Pause())

+CKM_BEHAVIORRESUME called when behaviors execution start (e.g. CKContext::Play())

+CKM_BEHAVIORLOAD called when behavior is loaded ( ATTACH CALLBACK is not called )

+CKM_BEHAVIOREDITED called when behavior is edited in virtools Interface. This callback message may be used to provide a custom dialog box for editing the behavior.

+CKM_BEHAVIORSTTINGSEDITED called when behavior settings (local parameters defined as settings in the prototype) is edited in Virtools Interface

+CKM_BEHAVIORREADSTATE called when behavior state has been changed (eg. its initial conditions have been restored (i.e. Local parameters may have changed))

+CKM_BEHAVIORNEWSCENE called when a new scene becomes the active scene.

+CKM_BEHAVIORACTIVATESCRIPT +CKM_BEHAVIORDEACTIVATESCRIPT called when a script has been activated or deactivated in the interface. This callback message is sent to all sub-behaviors of the script if it has been activated or deactivated in the current scene.

A callback function can be provided whether the behavior uses a graph or an execution function for its execution, it will be called the same way in all cases.

See Also

CKBehavior::SetCallbackFunction


CKBehaviorPrototype::SetBehaviorFlags

Method CKBehaviorPrototype::SetBehaviorFlags

void CKBehaviorPrototype::SetBehaviorFlags(CK_BEHAVIOR_FLAGS flags)

Determines flags to set to the behavior when it is created

See Also

CKBehavior::GetFlags,CK_BEHAVIOR_FLAGS


CKBehaviorPrototype::SetFunction

Method CKBehaviorPrototype::SetFunction

void CKBehaviorPrototype::SetFunction(CKBEHAVIORFCT fct)
CKBEHAVIORFCT CKBehaviorPrototype::GetFunction()

Management of the execution function of the behavior issued from the prototype

Remarks

The execution function is the function that will be called during the process loop of the behavior engine, if the behavior is defined as using an execution function. This function is not called if the behavior is defined as a graph.

This function is the heart of the behavior: it should compute the essence of the behavior, in an incremental way. The minimum amount of computing should be done at each call, to leave time for the other behaviors to run. The function receives the delay in milliseconds that has elapsed since the last behavioral process, and should rely on this value to manage the amount of effect it has on its computation, if the effect of this computation relies on time.

The execution function can retrieve values from the owner of the behavior, and from parameters. It can activate and deactivate inputs and outputs of the behavior. If it is done, it should return CKBR_OK. If it returns CKBR_ACTIVATENEXTFRAME, the behavior will again be called during the next process loop.

This function is different from the callback function. This latter one is used for maintenance purposes.

SetFunction: sets the execution function to use (using float or integer delta time) GetFunction: returns the pointer to the execution function

See Also

CKBehavior


CKBehaviorPrototype::SetGuid

Method CKBehaviorPrototype::SetGuid

void CKBehaviorPrototype::SetGuid(CKGUID guid)

Sets the GUID of the prototype

Remarks

Should only be called when the prototype is created in memory, and not from a dll. In the dll, it is automatically created from the declared GUID in the object declaration.

See Also

GetGuid


CKBehaviorPrototype::DeclareInParameter

Virtual Method Method CKBehaviorPrototype::DeclareInParameter

int CKBehaviorPrototype::DeclareInParameter(CKSTRING name,CKGUID guid_type,CKSTRING defaultval)
int CKBehaviorPrototype::DeclareInParameter(CKSTRING name,CKGUID guid_type,void *defaultval,int valsize)
int CKBehaviorPrototype::DeclareOutParameter(CKSTRING name,CKGUID guid_type,CKSTRING defaultval)
int CKBehaviorPrototype::DeclareOutParameter(CKSTRING name,CKGUID guid_type,void *defaultval,int valsize)
int CKBehaviorPrototype::DeclareLocalParameter(CKSTRING name,CKGUID guid_type,CKSTRING defaultval)
int CKBehaviorPrototype::DeclareLocalParameter(CKSTRING name,CKGUID guid_type,void *defaultval,int valsize)
int CKBehaviorPrototype::DeclareSetting(CKSTRING name,CKGUID guid_type,CKSTRING defaultval)
int CKBehaviorPrototype::DeclareSetting(CKSTRING name,CKGUID guid_type,void *defaultval,int valsize)

Declaring parameters

Returns

Returns an index corresponding to this parameter in the list of similar parameters to be used as a reference for this output in later calls.

Remarks

These methods will generate input, output and local parameters for the behavior when it is generated from the prototype. In each case, the name is optional. The GUID defined the parameter type to be used.

The name parameter should be passed as a constant string for all these functions. For exemple: proto->DeclareInParameter( “Vector Sample”, CKPGUID_VECTOR, “0,0,0” );

The default value can be provided in two different ways: either the parameter type knows how to read itself from a string, then the default value can be provided as a string, which will be converted to provide the default value when needed. Either the parameters type cannot initialize itself from a string, and the default value must be provided directly, with a pointer to data, and the length of the data in bytes. A special kind of local parameters are Settings.

+DeclareInParameter: declares an input parameter with its default value +DeclareOutParameter: declares an output parameter +DeclareLocalParameter: declares a local parameter with its default value +DeclareSetting: declares a local parameter with its default value which will be used by the interface to specify settings of the behavior.

See Also

CKBehavior::CreateInputParameter, CKBehavior::CreateOutputParameter, CKBehavior::CreateLocalParameter


CKBehaviorPrototype::DeclareInput

Virtual Method Method CKBehaviorPrototype::DeclareInput

int CKBehaviorPrototype::DeclareInput(CKSTRING name)

Declares an new input for the prototype

Returns

Index of newly created input.

Remarks

Declares a new input for the prototype. This input will generate an input for the behavior. The name parameter should be passed as a constant string. For exemple: proto->DeclareInput("Out"); The name is optional and is provided for display and debugging purposes. Returns an index corresponding to this input in the list of inputs, to be used as a reference for this input in later calls.

See Also

CKBehavior::AddInput, DeclareOutput


CKBehaviorPrototype::DeclareOutput

Virtual Method Method CKBehaviorPrototype::DeclareOutput

int CKBehaviorPrototype::DeclareOutput(CKSTRING name)

Declares an new output for the prototype

Returns

Index of the newly created output.

Remarks

Declares a new output for the prototype. This output will generate an output for the behavior.

The name parameter should be passed as a constant string. For exemple: proto->DeclareOutput("Out");

The name is optional and is provided for display and debugging purposes. Returns an index corresponding to this output in the list of outputs, to be used as a reference for this output in later calls.

See Also

CKBehavior::AddOutput, DeclareInput


CKBehaviorPrototype::SetFlags

Method CKBehaviorPrototype::SetFlags

enum CK_BEHAVIORPROTOTYPE_FLAGS {
CK_BEHAVIORPROTOTYPE_NORMAL =0x00000001,
CK_BEHAVIORPROTOTYPE_HIDDEN =0x00000002,
CK_BEHAVIORPROTOTYPE_OBSOLETE =0x00000004,
}
void CKBehaviorPrototype::SetFlags(CK_BEHAVIORPROTOTYPE_FLAGS flags)

Manages the flags describing the prototype

Members

CK_BEHAVIORPROTOTYPE_HIDDEN
CK_BEHAVIORPROTOTYPE_NORMAL
CK_BEHAVIORPROTOTYPE_OBSOLETE

Remarks

The flags describe whether the prototype is shown or hidden.

See Also

CK_BEHAVIORPROTOTYPE_FLAGS


CKMessage

Class CKMessage

Messages between behaviors and objects

Remarks

Important : CKMessage DOES NOT derive from CKObject... !

Instances of CKMessage can be sent to objects or to behaviors. Behaviors input or outputs can be automatically activated when messages are dispatched.

This class is to be used in cooperation with the CKMessageManager. Output parameters can be attached to messages in order to provide additional values to the recipients. Messages can be sent to a single recipient, to a list of recipients or to all instances of a class hierarchy.

Messages are versatile: They are often created automatically by the SendMessage.. functions and destroyed at the end of the next frame. DO NOT KEEP pointers to CKMessage.

Most of the CKMessage methods (type,sender,recipient,sending type) are automatically called when creating a message with the SendMessage methods of the CKMessageManager

Groups

Message Type | Sending Type | Sender | Recipient | Parameters | Operations

Message Type
Method GetMsgType | Returns the type of this message.
Method SetMsgType | Sets the type of this message.
Sending Type
Method GetSendingType | Returns the sending type of the message
Method SetSendingType | Sets the sending type of the message
Sender
Method GetSender | Returns the sender of this message
Method SetSender | Specify the sender of this message
Recipient
Method GetRecipient | Returns the recipient of this message.
Method SetBroadcastObjectType | Defines the target class ID for a broadcast message.
Method SetRecipient | Returns the recipient of this message.
Parameters
Method AddParameter | Adds a parameter to this message.
Method GetParameter | Gets the parameter given its index.
Method GetParameterCount | Returns the number of parameters attached to this message.
Method RemoveParameter | Removes the given parameter from the list of parameters of a message.
Operations
Method GetBroadcastObjectType |

See Also

CKMessageManager, CKMessageManager::SendMessageSingle, CKMessageManager::SendMessageGroup, CKMessageManager::SendMessageBroadcast


CKMessage::GetMsgType

Method CKMessage::GetMsgType

CKMessageType CKMessage::GetMsgType()

Returns the type of this message.

Returns

Message Type.

Remarks

Each message has a type("On Click",etc..) , which corresponds to an index in a table maintained by the message manager. This type is used as a filter for dispatching messages.

See Also

SetMsgType,CKMessageManager::AddMessageType


CKMessage::SetMsgType

Method CKMessage::SetMsgType

void CKMessage::SetMsgType(CKMessageType type)

Sets the type of this message.

Remarks

Each message has a type("On Click",etc..) , which corresponds to an index in a table maintained by the message manager. This type is used as a filter for dispatching messages.

See Also

GetMsgType,CKMessageManager::AddMessageType


CKMessage::GetSendingType

Method CKMessage::GetSendingType

enum CK_MESSAGE_SENDINGTYPE {
CK_MESSAGE_BROADCAST = 1,
CK_MESSAGE_SINGLE = 2,
CK_MESSAGE_GROUP = 3,
}
CK_MESSAGE_SENDINGTYPE CKMessage::GetSendingType()

Returns the sending type of the message

Members

CK_MESSAGE_BROADCAST | Send message to all objects of a specific class ID
CK_MESSAGE_GROUP | Send message to an object and its dependencies (CKCharacter and CKGroup)
CK_MESSAGE_SINGLE | Send message to a single object

Returns

Sending type.

Remarks

The sending type refers to the kind of destinations of the message. The sending types are:

CK_MESSAGE_BROADCAST: sent to all instances of a class hierarchy CK_MESSAGE_SINGLE: sent to a single recipient CK_MESSAGE_GROUP: sent to a single recipient and its dependencies (CKGroup and CKCharacter only)

See Also

SetSendingType,GetRecipient, SetRecipient


CKMessage::SetSendingType

Method CKMessage::SetSendingType

void CKMessage::SetSendingType(CK_MESSAGE_SENDINGTYPE Type)

Sets the sending type of the message

Remarks

The sending type refers to the kind of destinations of the message. The sending types are: CK_MESSAGE_BROADCAST: sent to all instances of a class hierarchy CK_MESSAGE_SINGLE: sent to a single recipient CK_MESSAGE_GROUP: sent to a single recipient and its dependencies (CKGroup and CKCharacter only) This method is automatically called by CKMessageManager::SendMessage.. methods.

See Also

GetSendingType,GetRecipient, SetRecipient


CKMessage::GetSender

Method CKMessage::GetSender

CKBeObject * CKMessage::GetSender()

Returns the sender of this message

Returns

A pointer to the CKBeObject that sends this message.

See Also

SetSender


CKMessage::SetSender

Method CKMessage::SetSender

void CKMessage::SetSender(CKBeObject *obj)

Specify the sender of this message

Parameters

Input argument obj

Sender of this message (Optionnal).

See Also

GetSender


CKMessage::GetRecipient

Method CKMessage::GetRecipient

CKObject* CKMessage::GetRecipient()

Returns the recipient of this message.

Returns

A pointer to the CKObject that is recipientof this message.

Remarks

The recipient is not taken into account when using a broadcast message.

See Also

GetSendingType, SetRecipient, SetBroadcastObjectType


CKMessage::SetBroadcastObjectType

Method CKMessage::SetBroadcastObjectType

CKERROR CKMessage::SetBroadcastObjectType(CK_CLASSID type)

Defines the target class ID for a broadcast message.

Returns

CK_OK if successful, an error code otherwise

Remarks

Broadcast messages are sent to all instances of a class hierarchy. The class hierarchy is defined by the class ID of the root of the hierarchy. By default, the root is the CKCID_BEOBJECT which means all instances of class derived from CKBeObject (all behavioral objects) receive the message. The instances taken into account are the instances at the moment of the reception of the message.

See Also

SetSendingType,GetSendingType, GetRecipient, SetRecipient


CKMessage::SetRecipient

Method CKMessage::SetRecipient

void CKMessage::SetRecipient(CKObject *recipient)

Returns the recipient of this message.

Remarks

In case of single sending

The recipient is not taken into account when using a broadcast message.

See Also

GetSendingType, SetRecipient, SetBroadcastObjectType


CKMessage::AddParameter

Method CKMessage::AddParameter

CKERROR CKMessage::AddParameter(CKParameter* param,CKBOOL DeleteParameterWithMessage)

Adds a parameter to this message.

Parameters

Input argument param | A pointer to a CKParameterOut or CKParameterLocal to add to this message.
Input argument DeleteParameterWithMessage | TRUE if the given parameter should be deleted with the message.

Returns

CK_OK if successful, an error code otherwise

Remarks

The message can carry along with it a set of parameters which may be used by the recipients to retrieve values. These parameters may be existing parameters, or may be created ad hoc. If they were created ad hoc, that is only for this message, they should be added to the message with the flags DeleteParameterWithMessage sets to TRUE. This way, when the message will be deleted, the parameter will be automatically deleted too.

Example

To add a parameter to a message
   CKParameterOut *MyParam=CKContext->CreateCKParameterOut(...);
   MyMessage->AddParameter(MyParam,TRUE);

Or if the parameter already exists (for example the local parameter of  behavior)
   MyMessage->AddParameter(MyBeh->GetLocalParameter(0),FALSE);

See Also

RemoveParameter,GetParameterCount,GetParameter


CKMessage::GetParameter

Method CKMessage::GetParameter

CKParameter* CKMessage::GetParameter(int pos)

Gets the parameter given its index.

Parameters

Input argument pos

Position of the parameter in the list.

Returns

Pointer to the Parameter at given positon or NULL if there are no parameters.

See Also

GetParameterCount,AddParameter


CKMessage::GetParameterCount

Method CKMessage::GetParameterCount

int CKMessage::GetParameterCount()

Returns the number of parameters attached to this message.

Returns

Number of parameters.

See Also

GetParameter


CKMessage::RemoveParameter

Method CKMessage::RemoveParameter

CKERROR CKMessage::RemoveParameter(CKParameter* param)

Removes the given parameter from the list of parameters of a message.

Parameters

Input argument param

A pointer to the parameter that is to be removed.

Returns

Value | Meaning
CK_OK | if the function succeeds,
CKERR_INVALIDPARAMETER | if the given parameter is invalid.

See Also

AddParameter,GetParameterCount,GetParameter


CKMessage::GetBroadcastObjectType

Method CKMessage::GetBroadcastObjectType

CK_CLASSID CKMessage::GetBroadcastObjectType( void )


CKObjectDeclaration

Class CKObjectDeclaration

External object declaration

Remarks

+A CKObjectDeclaration is used by Virtools engine to store a list of available extensions objects. +Only declarations of CKBehaviorPrototype are supported in this version. The CKObjectDeclaration contains a short description about the behavior prototype and its author and also contains a pointer to the function that will be used to create the behavior prototype when needed. +A CKObjectDeclaration is created with CreateCKObjectDeclaration.

Groups

Operations
Method GetName | Gets the name of behavior Prototype.
Method GetPluginIndex | Returns the index of the DLL that has declared this object.
Method NeedManager | Warns that the declared behavior needs a specific manager .
Method SetAuthorGuid | Sets the Author Guid of the behavior.
Method SetAuthorName | Sets the Author Name for the behavior.
Method SetCategory | Sets the category for the behavior.
Method SetCompatibleClassId | Sets the compatible Class ID of the behavior.
Method SetCreationFunction | Sets the prototype creation function.
Method SetDescription | Sets the description of the behavior
Method SetGuid | Sets the Guid to the behavior
Method SetVersion | Sets the version of the behavior.

Example

The following sample creates an object declaration for the "Rotate" behavior.
This object declaration is given :
 - The type of object declaration (Must Be CKDLL_BEHAVIORPROTOTYPE)
 - A short description of what the behavior is supposed to do.
 - The category in which this behavior will appear in the Virtools interface.
 - A unique CKGUID
 - Author and Version info
 - The class identifier of objects to which the behavior can be applied to.
 - The function that will create the CKBehaviorPrototype for this behavior.

   CKObjectDeclaration *FillBehaviorRotateDecl()
   {
       CKObjectDeclaration *od = CreateCKObjectDeclaration("Rotate");

       od->SetType(CKDLL_BEHAVIORPROTOTYPE);
       od->SetDescription("Rotates the 3D Entity.");
       od->SetCategory("3D Transformations/Basic");
       od->SetGuid(CKGUID(0xffffffee, 0xeeffffff));
       od->SetAuthorGuid(VIRTOOLS_GUID);
       od->SetAuthorName("Virtools");
       od->SetVersion(0x00010000);
       od->SetCompatibleClassId(CKCID_3DENTITY);

       od->SetCreationFunction(CreateRotateProto);
       return od;
   }

See Also

CKBehaviorPrototype,


CKObjectDeclaration::GetName

Method CKObjectDeclaration::GetName

CKSTRING CKObjectDeclaration::GetName()

Gets the name of behavior Prototype.

Returns

A pointer to Behavious Prototype name.

Remarks

The object declaration name is always the same than the behavior prototype.


CKObjectDeclaration::GetPluginIndex

Method CKObjectDeclaration::GetPluginIndex

int CKObjectDeclaration::GetPluginIndex()

Returns the index of the DLL that has declared this object.

Returns

Index of the plugin that registered this object in the plugin manager.

Remarks

The return value is the index of the plugin in the behavior category of the plugin manager. To retrieve information about the plugin use :

CKPluginManager::GetPluginDllInfo(CKPLUGIN_BEHAVIOR_DLL,Index);

See Also

CKPluginManager


CKObjectDeclaration::NeedManager

Method CKObjectDeclaration::NeedManager

void CKObjectDeclaration::NeedManager(CKGUID Manager)

Warns that the declared behavior needs a specific manager .

Parameters

Input argument Manager

GUID of the manager that must be present for the behavior to execute correctly.


CKObjectDeclaration::SetAuthorGuid

Method CKObjectDeclaration::SetAuthorGuid

void CKObjectDeclaration::SetAuthorGuid(CKGUID guid)
CKGUID CKObjectDeclaration::GetAuthorGuid()

Sets the Author Guid of the behavior.

Parameters

Input argument guid

Author Guid of the behavior.


CKObjectDeclaration::SetAuthorName

Method CKObjectDeclaration::SetAuthorName

void CKObjectDeclaration::SetAuthorName(CKSTRING Name)
CKSTRING CKObjectDeclaration::GetAuthorName()

Sets the Author Name for the behavior.


CKObjectDeclaration::SetCategory

Method CKObjectDeclaration::SetCategory

void CKObjectDeclaration::SetCategory(CKSTRING cat)
CKSTRING CKObjectDeclaration::GetCategory()

Sets the category for the behavior.

Parameters

Input argument cat

Category of the behavior (ie: “Visuals/FX” ).

Remarks

The category is where the behavior will be visible in the interface.


CKObjectDeclaration::SetCompatibleClassId

Method CKObjectDeclaration::SetCompatibleClassId

void CKObjectDeclaration::SetCompatibleClassId(CK_CLASSID cid)
CK_CLASSID CKObjectDeclaration::GetCompatibleClassId()

Sets the compatible Class ID of the behavior.

Parameters

Input argument cid

Compatible Class Id of the behavior.

Remarks

Only object which inherits from the given class ID can be assigned this behavior. For example with SetCompatibleClassId(CKCID_3DENTITY) the behaviors created from this object declaration can only be assigned to CK3dEntity or derived classes.


CKObjectDeclaration::SetCreationFunction

Method CKObjectDeclaration::SetCreationFunction

void CKObjectDeclaration::SetCreationFunction(CKDLL_CREATEPROTOFUNCTION f)
CKDLL_CREATEPROTOFUNCTION CKObjectDeclaration::GetCreationFunction()

Sets the prototype creation function.

Parameters

Input argument f

Pointer to the prototype creation function.

Remarks

The prototype creation function will be called the first time a behavior must be created to create the CKBehaviorPrototype that contains the description of the behavior.

See Also

CKDLL_CREATEPROTOFUNCTION, CKBehaviorPrototype


CKObjectDeclaration::SetDescription

Method CKObjectDeclaration::SetDescription

void CKObjectDeclaration::SetDescription(CKSTRING Desc)
CKSTRING CKObjectDeclaration::GetDescription()

Sets the description of the behavior

Parameters

Input argument Desc

A CKSTRING that describes the behavior


CKObjectDeclaration::SetGuid

Method CKObjectDeclaration::SetGuid

void CKObjectDeclaration::SetGuid(CKGUID guid)
CKGUID CKObjectDeclaration::GetGuid()

Sets the Guid to the behavior

Parameters

Input argument guid

guid for the behavior to be set.

See Also

CKObjectDeclaration


CKObjectDeclaration::SetVersion

Method CKObjectDeclaration::SetVersion

void CKObjectDeclaration::SetVersion(CKDWORD version)
CKDWORD CKObjectDeclaration::GetVersion()

Sets the version of the behavior.

Parameters

Input argument version

Version of the behavior.

Remarks

Upper word of version contains the major version while lower contain the minor version.


CKScene

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKScene

Remarks

A level in Virtools can counts several scenes or no scene at all. A scene is used to described what objects should be present, and how should they act (which behaviors should be active).

An object in the scene can have an initial value stored (called Initial Conditions)

A scene can also stored some render options that can be set when the scene becomes active such as background color,fog options or starting camera. Changing these options at runtime does not affect the current rendering, they are only use when the scene becomes active.

The class id of CKScene is CKCID_SCENE.

Groups

Environment Settings
Method ApplyEnvironmentSettings | Sets the environment settings to the given render contextes
Method EnvironmentSettings | Checks whether defined environment settings are used or not.
Method GetAmbientLight | Returns ambient light of the scene
Method GetBackgroundColor | Returns the background color of the scene
Method GetBackgroundTexture | Returns the background texture.
Method GetFogColor | Returns fog color in the scene
Method GetFogDensity | Returns fog density to the scene
Method GetFogEnd | Returns the depth at which fog is at is maximum
Method GetFogMode | Returns the fog mode
Method GetFogStart | Returns the depth at which fog starts
Method GetStartingCamera | Returns the active camera at scene start.
Method SetAmbientLight | Sets ambient light to the scene
Method SetBackgroundColor | Sets the background color of the scene
Method SetBackgroundTexture | Sets the background texture
Method SetFogColor | Sets the color to fog
Method SetFogDensity | Sets the fog density
Method SetFogEnd | Sets the depth at which the fog is at its maximum
Method SetFogMode | Sets fog mode
Method SetFogStart | Sets the depth at which fog starts
Method SetStartingCamera | Set the camera to use at scene start.
Method UseEnvironmentSettings | Sets or unsets the usage of defined environment settings.
Misc
Method GetLevel | Returns the level which owns this scene.
Object activity
Method Activate | Activates a scene object (script or behavioral object)
Method DeActivate | Deactivates a scene object (script or behavioral object)
Method IsObjectActive | Returns whether a scene object is active
Object Management
Method AddObjectToScene | Adds an object to the scene
Method BeginAddSequence | Warns that several objects are being added sequentially of the level or scene.
Method BeginRemoveSequence | Warns that several objects are being removed sequentially of the level or scene.
Method ComputeObjectList | Fills an array with objects of a given class in the scene.
Method GetObjectCount | Gets the number of objects referenced in the scene
Method GetObjectFlags | Gets the object properties in the scene
Method GetObjectInitialValue | Returns the object initial value in the scene.
Method GetObjectIterator | Return an iterator to iterates on all the objects in the scene.
Method IsObjectHere | Checks if an object is referenced in the scene
Method ModifyObjectFlags | Modify an object properties in the scene
Method RemoveObjectFromScene | Removes an object from the scene
Method SetObjectFlags | Sets an object properties in the scene
Method SetObjectInitialValue | Sets the object initial value associated with the scene

See Also

CKLevel::LaunchScene


CKScene::ApplyEnvironmentSettings

Method CKScene::ApplyEnvironmentSettings

void CKScene::ApplyEnvironmentSettings(XObjectPointerArray* renderlist)

Sets the environment settings to the given render contextes

Parameters

Input argument renderlist

An array of render contextes

Remarks

When calling this function, the environment settings such as fog settings, ambient light, background color/texture and current camera are overrided by the scene defaults. This method is automaticaly called when starting a scene if EnvironmentSettings is TRUE. You can also call the function without any argument. In that case, the scene's level default render contextes list will be used.

See Also

SetFogMode, SetFogColor, SetFogDensity, SetFogStart, SetFogEnd,SetAmbientLight, SetBackgroundColor, SetBackgroundTexture, SetStartingCamera


CKScene::EnvironmentSettings

Method CKScene::EnvironmentSettings

CKBOOL CKScene::EnvironmentSettings()

Checks whether defined environment settings are used or not.

Returns

Nonzero if defined environment settings are used zero otherwise.

Remarks

If environment settings are used they are automatically set when the scene becomes active.

See Also

UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::GetAmbientLight

Method CKScene::GetAmbientLight

CKDWORD CKScene::GetAmbientLight()

Returns ambient light of the scene

Returns

Ambient light of the scene

See Also

SetAmbientLight


CKScene::GetBackgroundColor

Method CKScene::GetBackgroundColor

CKDWORD CKScene::GetBackgroundColor()

Returns the background color of the scene

Returns

Background color (ARGB 32 bits) of the scene

See Also

SetBackgroundColor


CKScene::GetBackgroundTexture

Method CKScene::GetBackgroundTexture

CKTexture* CKScene::GetBackgroundTexture()

Returns the background texture.

Returns

pointer to Texture

See Also

CKScene::SetBackgroundTexture


CKScene::GetFogColor

Method CKScene::GetFogColor

CKDWORD CKScene::GetFogColor()

Returns fog color in the scene

Returns

Color of fog (ARGB 32 bits)

See Also

SetFogColor


CKScene::GetFogDensity

Method CKScene::GetFogDensity

float CKScene::GetFogDensity()

Returns fog density to the scene

Returns

Density value of fog

Remarks

The fog density is only used in exponential fog modes.

See Also

SetFogDensity


CKScene::GetFogEnd

Method CKScene::GetFogEnd

float CKScene::GetFogEnd()

Returns the depth at which fog is at is maximum

Returns

Scene fog end distance.

See Also

SetFogEnd


CKScene::GetFogMode

Method CKScene::GetFogMode

VXFOG_MODE CKScene::GetFogMode()

Returns the fog mode

Returns

Scene fog mode.

See Also

SetFogMode,VXFOG_MODE


CKScene::GetFogStart

Method CKScene::GetFogStart

float CKScene::GetFogStart()

Returns the depth at which fog starts

Returns

Scene fog start distance.

See Also

SetFogStart


CKScene::GetStartingCamera

Method CKScene::GetStartingCamera

CKCamera* CKScene::GetStartingCamera()

Returns the active camera at scene start.

Returns

Pointer to Camera

See Also

CKCamera, SetStartingCamera,CKRenderContext::AttachViewpointToCamera


CKScene::SetAmbientLight

Method CKScene::SetAmbientLight

void CKScene::SetAmbientLight(CKDWORD Color)

Sets ambient light to the scene

Parameters

color: Ambient light

Remarks

This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetAmbientLight,UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::SetBackgroundColor

Method CKScene::SetBackgroundColor

void CKScene::SetBackgroundColor(CKDWORD Color)

Sets the background color of the scene

Parameters

Input argument Color

Background color (ARGB 32 bits) of the scene

Remarks

This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetBackgroundColor,CKRenderContext::GetBackgroundMaterial,UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::SetBackgroundTexture

Method CKScene::SetBackgroundTexture

void CKScene::SetBackgroundTexture(CKTexture* texture)

Sets the background texture

Parameters

Input argument texture

A pointer to the texture to use as background during the scene or NULL.

Remarks

This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetBackgroundTexture, CKTexture,CKRenderContext::GetBackgroundMaterial,UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::SetFogColor

Method CKScene::SetFogColor

void CKScene::SetFogColor(CKDWORD Color)

Sets the color to fog

Parameters

Input argument Color

Fog color (ARGB 32 bits)

Remarks

This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetFogColor,CKRenderContext::SetFogColor,UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::SetFogDensity

Method CKScene::SetFogDensity

void CKScene::SetFogDensity(float Density)

Sets the fog density

Parameters

Input argument Density

Fog density.

Remarks

The fog density is only used in exponential fog modes. This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetFogDensity,CKRenderContext::SetFogDensity,UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::SetFogEnd

Method CKScene::SetFogEnd

void CKScene::SetFogEnd(float End)

Sets the depth at which the fog is at its maximum

Remarks

This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetFogEnd,SetFogStart,CKRenderContext::SetFogStart,UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::SetFogMode

Method CKScene::SetFogMode

void CKScene::SetFogMode(VXFOG_MODE Mode)

Sets fog mode

Parameters

Input argument Mode

Fog Mode

Remarks

This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetFogMode,VXFOG_MODE,CKRenderContext::SetFogMode,UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::SetFogStart

Method CKScene::SetFogStart

void CKScene::SetFogStart(float Start)

Sets the depth at which fog starts

Remarks

This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetFogStart,SetFogEnd,CKRenderContext::SetFogStart,UseEnvironmentSettings,ApplyEnvironmentSettings


CKScene::SetStartingCamera

Method CKScene::SetStartingCamera

void CKScene::SetStartingCamera(CKCamera* camera)

Set the camera to use at scene start.

Parameters

Input argument camera

A pointer to the camera or NULL

Remarks

The function returns immediatly if the camera is not in the scene. This setting is set at the scene start only if EnvironmentSettings() is TRUE. All the environment settings can be applied using ApplyEnvironmentSettings.

See Also

GetStartingCamera,CKRenderContext::AttachViewpointToCamera


CKScene::UseEnvironmentSettings

Method CKScene::UseEnvironmentSettings

void CKScene::UseEnvironmentSettings(BOOL use=TRUE)
void CKScene::UseEnvironmentSettings(CKBOOL use)

Sets or unsets the usage of defined environment settings.

Parameters

Input argument use

Sets the usage of defined environment settings if TRUE Unsets otherwise.

Remarks

If environment settings are used they are automatically set when the scene becomes active.

See Also

EnvironmentSettings,ApplyEnvironmentSettings


CKScene::GetLevel

Method CKScene::GetLevel

CKLevel* CKScene::GetLevel()

Returns the level which owns this scene.

Returns

A pointer to a CKLevel object.

See Also

CKLevel


CKScene::Activate

Method CKScene::Activate

void CKScene::Activate(CKSceneObject *o,CKBOOL Reset)

Activates a scene object (script or behavioral object)

Parameters

Input argument o

A pointer to scene object

Remarks

For a script, if Reset is TRUE the script reset which means all the sub-behaviors are deactivated and the execution of the script will restart from the beginning. The activated script execution will only start at the next process loop. For a behavioral object with initial conditions in the scene,if Reset is TRUE their initial conditions are restored.

See Also

DeActivate,IsObjectActive


CKScene::DeActivate

Method CKScene::DeActivate

void CKScene::DeActivate(CKSceneObject *o)

Deactivates a scene object (script or behavioral object)

Parameters

Input argument o

pointer to scene object to deactivate.

Remarks

If o is a currently active script its execution will be stopped at the beginnning of the next process loop. So if this function is called by a behavior during the process loop on a script that is active but has not yet been processed during this execution loop, the script will still be processed a last time during this process loop.

See Also

Activate,IsObjectActive


CKScene::IsObjectActive

Method CKScene::IsObjectActive

CKBOOL CKScene::IsObjectActive(CKSceneObject *o)

Returns whether a scene object is active

Parameters

Input argument o

pointer to scene object to return the activity of.

Returns

TRUE if the scene object is active

See Also

Activate,DeActivate,


CKScene::AddObjectToScene

Method CKScene::AddObjectToScene

void CKScene::AddObjectToScene(CKSceneObject *o,CKBOOL dependencies)

Adds an object to the scene

Parameters

Input argument o | Object to add
Input argument dependencies | Should the dependencies of the objects be added too.

Remarks

Adding an object to the scene allow it to be rendered and its behaviors to be processed when the scene is active. When an object is added to a scene, it can also adds its depedencies. for example when a 3dObject is added to a scene,its meshes are also referenced in the scene which in their turns add its materials,textures and so on. An object can be added to several scenes.

See Also

IsObjectHere, RemoveObjectFromScene


CKScene::BeginAddSequence

Method CKScene::BeginAddSequence

void CKScene::BeginAddSequence(CKBOOL Begin)

Warns that several objects are being added sequentially of the level or scene.

Parameters

Input argument Begin

TRUE to warn the start of the sequence, FALSE to end it.

Remarks

When an object is added to the level or scene, Managers can be warned of this operation. This method enables the user to warn the engine that several call to AddObject are about to occur so that it can send the notifications only once when all the objects have been added.

See Also

AddObject,BeginRemoveSequence


CKScene::BeginRemoveSequence

Method CKScene::BeginRemoveSequence

void CKScene::BeginRemoveSequence(CKBOOL Begin)

Warns that several objects are being removed sequentially of the level or scene.

Parameters

Input argument Begin

TRUE to warn the start of the sequence, FALSE to end it.

Remarks

When an object is removed from the level or scene, Managers can be are warned of this operation. This method enables the user to warn the engine that several call to AddObject are about to occur so that it can send the notifications only once when all the objects have been removed.

See Also

RemoveObject,BeginAddSequence


CKScene::ComputeObjectList

Method CKScene::ComputeObjectList

const XObjectPointerArray&
CKScene::ComputeObjectList(CK_CLASSID cid, CKBOOL derived)

Fills an array with objects of a given class in the scene.

Parameters

Input argument cid | Class identifier for the objects to be retrieved.
Input argument derived | Should the derived object of the given class be listed.

Returns

A constant reference on a XObjectPointerArray filled with the objects

Remarks

Because of the creating and copy in the array, this function is less effective than using directly the GetObjectIterator function.

See Also

GetObjectCount, GetObjectIterator


CKScene::GetObjectCount

Method CKScene::GetObjectCount

int CKScene::GetObjectCount()

Gets the number of objects referenced in the scene

Returns

Number of objects referenced in the scene.

See Also

GetObject,ComputeObjectList


CKScene::GetObjectFlags

Method CKScene::GetObjectFlags

CK_SCENEOBJECT_FLAGS CKScene::GetObjectFlags(CKSceneObject *o)

Gets the object properties in the scene

Parameters

Input argument o

the object for which to get flags.

Returns

This method returns the object flags it can be any combination of CK_SCENEOBJECT_FLAGS values

Remarks

Many of these flags can be directly checked by using the appropriate method (see CK_OBJECT_FLAGS) instead of using this method.

Implementation Notes

The flags of an object in the scene describe the way the object acts as the start of the scene. These flags act differently if the given object is a script or a behavioral object (see CK_SCENEOBJECT_FLAGS). It also contains the current activation state of the object.

See Also

SetObjectFlags,ModifyObjectFlags


CKScene::GetObjectInitialValue

Method CKScene::GetObjectInitialValue

CKStateChunk *CKScene::GetObjectInitialValue(CKSceneObject *o)

Returns the object initial value in the scene.

Parameters

Input argument o

The object for which the value is requested

Returns

A pointer to a CKStateChunk containing the object's initial value or NULL if the object does not have an initial value.

See Also

SetObjectInitialValue, CKSaveObjecState, CKReadObjectState


CKScene::GetObjectIterator

Method CKScene::GetObjectIterator

CKSceneObjectIterator CKScene::GetObjectIterator()

Return an iterator to iterates on all the objects in the scene.

Returns

A CKSceneObjectIterator object.

Remarks

This should be the preferred method for iterating through the objects of a scene. Try to avoid using methods such as ComputeObjectList which requires an array to be created and filled.

Typical code to use this iterator is

CKSceneObjectIterator it = scene->GetObjectIterator();
CKObject* obj;

while(!it.End()) {
    CKSceneObject* obj = context->GetObject(it.GetObjectID());
    ...
    ...
    it++;
}

See Also

GetObjectCount, CKSceneObjectIterator,ComputeObjectList


CKScene::IsObjectHere

Method CKScene::IsObjectHere

CKBOOL CKScene::IsObjectHere(CKObject *o)

Checks if an object is referenced in the scene

Parameters

Input argument o

Object to check

Returns

TRUE if the object is referenced in the scene, FALSE otherwise.

See Also

AddObjectToScene, RemoveObjectFromScene,CKSceneObject::IsInScene


CKScene::ModifyObjectFlags

Method CKScene::ModifyObjectFlags

CK_SCENEOBJECT_FLAGS CKScene::ModifyObjectFlags(CKSceneObject *o,CKDWORD Add,CKDWORD Remove)

Modify an object properties in the scene

Parameters

Input argument o | The object which flags should be modified.
Input argument Add | flags to add, this can be any combination of any CK_SCENEOBJECT_FLAGS
Input argument Remove | flags to remove, this can be any combination of any CK_SCENEOBJECT_FLAGS

Returns

Modified object flags (CK_SCENEOBJECT_FLAGS)

Remarks

You rarely need to modify directly this flags through CKObject::ModifyObjectFlags instead you should always use the specific acces function (given between () in CK_OBJECT_FLAGS documentation) which may need to perform additionnal operations.

Implementation Notes

The flags of an object in the scene describe the way the object acts as the start of the scene. These flags act differently if the given object is a script or a behavioral object (see CK_SCENEOBJECT_FLAGS). It also contains the current activation state of the object.

See Also

GetObjectFlags,SetObjectFLags


CKScene::RemoveObjectFromScene

Method CKScene::RemoveObjectFromScene

void CKScene::RemoveObjectFromScene(CKSceneObject *o,CKBOOL dependencies)

Removes an object from the scene

Parameters

Input argument o | Object to Remove
Input argument dependencies | Should the dependencies of the objects be removed too.

Remarks

When an object is removed from a scene, it also tries to remove its dependencies. for example when a 3dObject is rendered, it removes its meshes, material and texture. If its mesh is shared with other objects in the scene, the reference count of the object in the scene is decreased and the object is really removed when it reaches 0.

See Also

AddObjectToScene, IsObjectHere


CKScene::SetObjectFlags

Method CKScene::SetObjectFlags

void CKScene::SetObjectFlags(CKSceneObject *o,CK_SCENEOBJECT_FLAGS flags)

Sets an object properties in the scene

Parameters

Input argument o | The object for which to set flags.
Input argument flags | new value, this can be any combination of any CK_SCENEOBJECT_FLAGS

Remarks

The flags of an object in the scene describe the way the object acts as the start of the scene. These flags act differently if the given object is a script or a behavioral object (see CK_SCENEOBJECT_FLAGS). It also contains the current activation state of the object. To change the properties of an object in the scene you should rather use the ModifyObjectFlags method which provides a more convenient way of adding and removing flag on a object.

See Also

GetObjectFLags,ModifyObjectFlags


CKScene::SetObjectInitialValue

Method CKScene::SetObjectInitialValue

CKBOOL CKScene::SetObjectInitialValue(CKSceneObject *o,CKStateChunk *chunk)

Sets the object initial value associated with the scene

Parameters

Input argument o | object which inital value should be set.
Input argument chunk | A pointer to a CKStatechunk containing the object saved state

Returns

TRUE if successful.

Remarks

Use this method to set the initial state of an object in the scene, this state is used to specify the object initial conditions when the scene starts.

See Also

GetObjectInitialValue, CKSaveObjecState, CKReadObjectState


CKSceneObjectIterator

Class CKSceneObjectIterator

Iterators on objects in a scene.

Remarks

Objects in a scene are stored in a Hash table, this class can be used with CKScene::GetObjectIterator to iterate on objects in a scene.

For example if can be use in following way:

CKSceneObjectIterator it = scene->GetObjectIterator();
CKObject* obj;

while(!it.End()) {
    obj = context->GetObject(it.GetObjectID());
    ....
    ...
    it++;
}

Groups

Data Members
Member Variable m_Hash |
Operators
Method operator++ | Description: Postfix Increment Operator This increments the current object.
Operations
Method End | Indicates if end of list is reached.
Method GetObjectID | Returns the ID of the current object.
Method Rewind | Reset iterator to start of the list.

See Also

CKScene::GetObjectIterator


CKSceneObjectIterator::m_Hash

Member Variable CKSceneObjectIterator::m_Hash

CKSODHash& CKSceneObjectIterator::m_Hash


CKSceneObjectIterator::operator++

Method CKSceneObjectIterator::operator++

CKSceneObjectIterator& CKSceneObjectIterator::operator++(int)

Returns

The value of the current object before the operation was performed.

Remarks

Description: Postfix Increment Operator

This increments the current object.


CKSceneObjectIterator::End

Method CKSceneObjectIterator::End

int CKSceneObjectIterator::End()

Indicates if end of list is reached.

Returns

Returns TRUE if the iterator is at the end of the list of objects.


CKSceneObjectIterator::GetObjectID

Method CKSceneObjectIterator::GetObjectID

CK_ID CKSceneObjectIterator::GetObjectID()

Returns the ID of the current object.

Returns

CK_ID of the current object.


CKSceneObjectIterator::Rewind

Method CKSceneObjectIterator::Rewind

void CKSceneObjectIterator::Rewind()

Reset iterator to start of the list.


CKAttributeManager

Class CKAttributeManager

Object attributes management.

CKBaseManager
Show brief derivation trees

CKAttributeManager

CKBaseManager
Show full derivation trees

CKAttributeManager

Remarks

Every CKBeObject may be given some attributes that behaviors or other classes may ask for information. An attribute is defined by : A Name A Category (Optionnal) A Parameter type (Optionnal) New types of attributes may be registered by giving them a name and the type of parameters that will come along with them. Once registered this new type of attribute may be accessed by name or by the unique index returned by RegisterNewAttributeType. Retrieving attributes by index is of course far more efficient than by Name. The unique instance of CKAttributeManager can be retrieved by calling CKContext::GetAttributeManager() and its manager GUID is ATTRIBUTE_MANAGER_GUID. See the Using attributes paper for more detail on how to use attributes.

Groups

Attribute Types
Method GetAttributeCategory | Returns category of the attribute type.
Method GetAttributeCategoryIndex | Returns category index of the attribute type.
Method GetAttributeCompatibleClassId | Returns compatible class id of the attribute given its type.
Method GetAttributeCount | Returns the number of attributes registered so far.
Method GetAttributeFlags | Returns flags of the attribute type.
Method GetAttributeNameByType | Returns the name of the attribute given its type.
Method GetAttributeParameterGUID | Returns the parameter's GUID given the type of the attribute.
Method GetAttributeTypeByName | Returns the type of the attribute given its name.
Method IsAttributeIndexValid | Checks whether the given attribute type is valid.
Method RegisterNewAttributeType | Registers a new attribute type
Method SetAttributeCallbackFunction | Sets a callback function for the attribute type.
Method SetAttributeDefaultValue | Sets default value of an attribute whose type is given.
Method SetAttributeNameByType | Modifies the name of the attribute given its type.
Method UnRegisterAttribute | Removes from the registry the attribute whose type is passed.
Objects with attributes
Method FillListByAttributes | Fills a list of objects which have one or more attribute.
Method GetAttributeListPtr | Returns the list of objects having an attribute.
Categories
Method AddCategory | Adds a new category.
Method GetCategoriesCount | Returns the number of categories registred so far.
Method GetCategoryByName | Returns category type from its name.
Method GetCategoryFlags | Returns category flags,
Method GetCategoryName | Returns the name of the category given its index.
Method IsCategoryIndexValid | Checks whether the given category index is valid.
Method RemoveCategory | Removes a category.
Method SetAttributeCategory | Sets the category of an attribute, whose type is given.
Method SetCategoryName | Modifies the name of a category given its type.
Operations
Method RemoveUnusedAttributes |
Method StartProfile | Starts profiling.
Method StopProfile | Stops profiling.

See Also

CKBeObject::SetAttribute,CKBeObject,CKParameterManager,Using Attributes


CKAttributeManager::GetAttributeCategory

Method CKAttributeManager::GetAttributeCategory

CKSTRING CKAttributeManager::GetAttributeCategory(CKAttributeType AttribType)

Returns category of the attribute type.

Parameters

Input argument AttribType

Type of the attribute

Returns

Category name of the attribute type.

See Also

GetAttributeCategoryIndex


CKAttributeManager::GetAttributeCategoryIndex

Method CKAttributeManager::GetAttributeCategoryIndex

int CKAttributeManager::GetAttributeCategoryIndex(CKAttributeType AttribType)

Returns category index of the attribute type.

Parameters

Input argument AttribType

Type of the attribute

Returns

Category index of the attribute type.

See Also

GetAttributeCategory


CKAttributeManager::GetAttributeCompatibleClassId

Method CKAttributeManager::GetAttributeCompatibleClassId

CK_CLASSID CKAttributeManager::GetAttributeCompatibleClassId(CKAttributeType AttribType)

Returns compatible class id of the attribute given its type.

Parameters

Input argument AttribType

Type of the attribute

Returns

Compatible class id of the attribute.

Remarks

+The compatible class ID indicates which instances can have attributes of this type attached to them. +For example one can restrain an “collision” attribute to 3d Entities only for example


CKAttributeManager::GetAttributeCount

Method CKAttributeManager::GetAttributeCount

int CKAttributeManager::GetAttributeCount()

Returns the number of attributes registered so far.

Returns

Number of attributes.

See Also

RegisterAttribute,UnRegisterAttribute


CKAttributeManager::GetAttributeFlags

Method CKAttributeManager::GetAttributeFlags

CK_ATTRIBUT_FLAGS CKAttributeManager::GetAttributeFlags(CKAttributeType AttribType)

Returns flags of the attribute type.

Parameters

Input argument AttribType

Type of the attribute

Returns

Flags of the attribute.

Remarks

Flags indicate special options for an attribute type, attribute can be hidden or not saved with objects.

See Also

CK_ATTRIBUT_FLAGS


CKAttributeManager::GetAttributeNameByType

Method CKAttributeManager::GetAttributeNameByType

CKSTRING CKAttributeManager::GetAttributeNameByType(CKAttributeType AttribType)

Returns the name of the attribute given its type.

Parameters

Input argument AttribType

Type of the attribute.

Returns

Name of the attribute.

See Also

GetAttributeTypeByName


CKAttributeManager::GetAttributeParameterGUID

Method CKAttributeManager::GetAttributeParameterGUID

CKGUID CKAttributeManager::GetAttributeParameterGUID(CKAttributeType AttribType)
CKParameterType CKAttributeManager::GetAttributeParameterType(CKAttributeType AttribType)

Returns the parameter's GUID given the type of the attribute.

Parameters

Input argument AttribType

Type of the attribute

Returns

Parameter's GUID (or Type) of the attribute.

Remarks

When an attribute is added to an object it can be associated to a parameter which will hold values for this attribute.


CKAttributeManager::GetAttributeTypeByName

Method CKAttributeManager::GetAttributeTypeByName

CKAttributeType CKAttributeManager::GetAttributeTypeByName(CKSTRING AttribName)

Returns the type of the attribute given its name.

Parameters

Input argument AttribName

Name of the attribute.

Returns

Type of the attribute if proper name is passed otherwise -1.

See Also

GetAttributeNameByType


CKAttributeManager::IsAttributeIndexValid

Method CKAttributeManager::IsAttributeIndexValid

CKBOOL CKAttributeManager::IsAttributeIndexValid(CKAttributeType index)

Checks whether the given attribute type is valid.

Parameters

Input argument index

Attribute type to be verified.

Returns

Value | Meaning
TRUE | if index maps to a valid attribute
FALSE | otherwise.


CKAttributeManager::RegisterNewAttributeType

Method CKAttributeManager::RegisterNewAttributeType

CKAttributeType CKAttributeManager::RegisterNewAttributeType(CKSTRING Name,CKGUID ParameterType,CK_CLASSID CompatibleCid,CK_ATTRIBUT_FLAGS Flags)

Registers a new attribute type

Returns

The newly created attribute type.

Remarks

The new attribute type will have the supplied name, type and flags If an attribute with the supplied name is already present in the attribute list, its index is returned.

See Also

UnRegisterAttribute,CK_ATTRIBUT_FLAGS


CKAttributeManager::SetAttributeCallbackFunction

Method CKAttributeManager::SetAttributeCallbackFunction

void CKAttributeManager::SetAttributeCallbackFunction(CKAttributeType AttribType,CKATTRIBUTECALLBACK fct,void *arg)

Sets a callback function for the attribute type.

Parameters

Input argument AttribType | Type of the Attribute to which the callback function to be set. AttribName : Name of the Attribute to which the callback function to be set.
Input argument fct | callback function name.
Input argument arg | Pointer to callback function's argument

Remarks

+If wrong attribute type is passed, no action will happen. +Overloaded to take attribute name to set the callback function. +The callback function will be called each time an attribute of this type is added to or removed from an object.

See Also

CKATTRIBUTECALLBACK


CKAttributeManager::SetAttributeDefaultValue

Method CKAttributeManager::SetAttributeDefaultValue

void CKAttributeManager::SetAttributeDefaultValue(CKAttributeType AttribType,CKSTRING DefaultVal)
CKSTRING CKAttributeManager::GetAttributeDefaultValue(CKAttributeType AttribType)

Sets default value of an attribute whose type is given.

Parameters

Input argument AttribType | Type of the attribute
Input argument DefaultVal | Default value of the attribute

Remarks

If a default value is given, it will be used when attaching an attribute to a CKBeObject: a parameter is created of the type given at the registration of the attribute and its value is set using CKParameterOut::SetStringValue

See Also

GetAttributeDefaultValue


CKAttributeManager::SetAttributeNameByType

Method CKAttributeManager::SetAttributeNameByType

void CKAttributeManager::SetAttributeNameByType(CKAttributeType AttribType,CKSTRING name)

Modifies the name of the attribute given its type.

Parameters

Input argument AttribType

AttributeType

See Also

GetAttributeNameByType


CKAttributeManager::UnRegisterAttribute

Method CKAttributeManager::UnRegisterAttribute

void CKAttributeManager::UnRegisterAttribute(CKAttributeType AttribType)
void CKAttributeManager::UnRegisterAttribute(CKSTRING AttribTypeName)

Removes from the registry the attribute whose type is passed.

Parameters

Input argument AttribType | Type of the Attribute to be unregistered.
Input argument AttribTypeName | Name of the Attribute to be unregistered.

Remarks

The attribute is automatically removed from all objects which had it.

See Also

RegisterNewAttributeType


CKAttributeManager::FillListByAttributes

Method CKAttributeManager::FillListByAttributes

const XObjectPointerArray&
CKAttributeManager::FillListByAttributes(CKAttributeType *ListAttrib,int AttribCount)
const XObjectPointerArray&
CKAttributeManager::FillListByGlobalAttributes(CKAttributeType *ListAttrib,int AttribCount)

Fills a list of objects which have one or more attribute.

Parameters

Input argument ListAttrib | List of CKAttributeType.
Input argument AttribCount | Number of attributes in ListAttrib.

Returns

A constant reference on an array of objects that will be filled with the objects having the given attributes .

Remarks

+If a current scene is available the function fills the array with objects in the current scene only. To have all objects regardless of the current scene use FillListByGlobalAttributes +If an object has more than one of the attribute given by ListAttrib it may appear more than once in the array

See Also

FillListByGlobalAttributes


CKAttributeManager::GetAttributeListPtr

Method CKAttributeManager::GetAttributeListPtr

const XObjectPointerArray& CKAttributeManager::GetAttributeListPtr(CKAttributeType AttribType)
const XObjectPointerArray& CKAttributeManager::GetGlobalAttributeListPtr(CKAttributeType AttribType)

Returns the list of objects having an attribute.

Parameters

Input argument AttribType

Type of the attribute

Returns

Reference to object list.

Remarks

+The method returns the list of objects in the current scene that have the given attribute. +The GetGlobalAttributeListPtr returns the list of objects that have the given attribute whichever the scenes they are in.

See Also

GetGlobalAttributeListPtr


CKAttributeManager::AddCategory

Method CKAttributeManager::AddCategory

CKAttributeCategory CKAttributeManager::AddCategory(CKSTRING Category,CKDWORD flags)

Adds a new category.

Parameters

Input argument Category | Name of the Category to create.
Input argument flags | flags for the new category (CK_ATTRIBUT_FLAGS)

Returns

Created Category Type.

Remarks

If the Category already exists, the method returns its type.

See Also

RemoveCategory


CKAttributeManager::GetCategoriesCount

Method CKAttributeManager::GetCategoriesCount

int CKAttributeManager::GetCategoriesCount()

Returns the number of categories registred so far.

Returns

Number of categories.

See Also

GetCategoryName


CKAttributeManager::GetCategoryByName

Method CKAttributeManager::GetCategoryByName

CKAttributeCategory CKAttributeManager::GetCategoryByName(CKSTRING Name)

Returns category type from its name.

Returns

Category type or -1 if the category does not exist.

See Also

GetAttributeCategory


CKAttributeManager::GetCategoryFlags

Method CKAttributeManager::GetCategoryFlags

CKDWORD CKAttributeManager::GetCategoryFlags(CKAttributeCategory cat)
CKDWORD CKAttributeManager::GetCategoryFlags(CKSTRING CatName)

Returns category flags,

Parameters

Input argument cat | Category index.
Input argument CatName | Category Name.

Returns

A combination of CK_ATTRIBUT_FLAGS for this category.

See Also

GetAttributeCategoryIndex


CKAttributeManager::GetCategoryName

Method CKAttributeManager::GetCategoryName

CKSTRING CKAttributeManager::GetCategoryName(CKAttributeCategory index)

Returns the name of the category given its index.

Parameters

Input argument index

Category index.

Returns

Name of the category.

See Also

GetAttributeCategory,GetCategoriesCount,GetCategoryByName


CKAttributeManager::IsCategoryIndexValid

Method CKAttributeManager::IsCategoryIndexValid

CKBOOL CKAttributeManager::IsCategoryIndexValid(CKAttributeCategory index)

Checks whether the given category index is valid.

Parameters

Input argument index

Index to be verified for having a valid category.

Returns

TRUE if index maps to a valid category,FALSE otherwise.

See Also

IsAttributeIndexValid,GetCategoryName


CKAttributeManager::RemoveCategory

Method CKAttributeManager::RemoveCategory

void CKAttributeManager::RemoveCategory(CKSTRING Category)

Removes a category.

Parameters

Input argument Category

Name of category to be removed.

See Also

AddCategory


CKAttributeManager::SetAttributeCategory

Method CKAttributeManager::SetAttributeCategory

void CKAttributeManager::SetAttributeCategory(CKAttributeType AttribType,CKSTRING Category)

Sets the category of an attribute, whose type is given.

Parameters

Input argument AttribType | Type of the attribute.
Input argument Category | Category of the attribute.

See Also

GetAttributeCategory


CKAttributeManager::SetCategoryName

Method CKAttributeManager::SetCategoryName

void CKAttributeManager::SetCategoryName(CKAttributeCategory catType,CKSTRING name)

Modifies the name of a category given its type.

Parameters

Input argument catType

Category Type

See Also

AddCategory


CKAttributeManager::RemoveUnusedAttributes

Method CKAttributeManager::RemoveUnusedAttributes

void CKAttributeManager::RemoveUnusedAttributes()


CKBehaviorManager

Class CKBehaviorManager

Behavior execution management.

CKBaseManager
Show brief derivation trees

CKBehaviorManager

CKBaseManager
Show full derivation trees

CKBehaviorManager

Remarks

There is only one instance of the CKBehaviorManager class in a Context. This instance may be obtained with the CKContext::GetBehaviorManager() method. The behavior manager manages the list of object which behaviors need to be executed at each process loop, and manages their execution. The behavior manager is automatically called by the process loop and by the scenes, but direct access is provided for special behavior processing and direct access to the execution of behaviors.

Groups

Operations
Method AddObject | Adds/Removes the given object to the list of active objects.
Method GetObject | Returns the active object at the given index
Method GetObjectsCount | Returns the current number of active objects
Method RemoveAllObjects | Removes all the currently active objects from the behavior manager.
Method StartProfile | Starts profiling.
Method StopProfile | Stops profiling.
Behaviour
Method Execute | Executes all the needed behaviors
Settings
Method GetBehaviorMaxIteration | Sets or returns the maximum number of iteration for a behavior during one frame.

See Also

CKBehavior, CKBeObject, CKScene


CKBehaviorManager::AddObject

Method CKBehaviorManager::AddObject

CKERROR CKBehaviorManager::AddObject(CKBeObject *b)
CKERROR CKBehaviorManager::RemoveObject(CKBeObject *b)
CKERROR CKBehaviorManager::AddObjectNextFrame (CKBeObject *b)
CKERROR CKBehaviorManager::RemoveObjectNextFrame (CKBeObject *b)

Adds/Removes the given object to the list of active objects.

Parameters

Input argument b

A pointer to a CKBeObject to add or remove to the active objects.

Returns

CK_OK if successful, an error code otherwise.

Remarks

+The behavior manager maintains all the instances of CKBeObject that need to be executed at each process loop. These objects are normally maintained by the CKScene, but direct access to them is provided for special processing.

+This method adds immediatly the object to the list of active objects. If this is done from a behavior being executed you should used AddObjectNextFrame which will take into account other behaviors which could want to deactivate this object with RemoveObjectNextFrame.

+In the same manner RemoveObject removes immediatly the object from the list of active objects. From a behavior you should rather call RemoveObjectNextFrame to avoid changing the list of active objects while it is parsed during the execution.

See Also

CKScene,GetObjectsCount,GetObject,RemoveAllObjects


CKBehaviorManager::GetObject

Method CKBehaviorManager::GetObject

CKBeObject* CKBehaviorManager::GetObject(int pos)

Returns the active object at the given index

Parameters

Input argument pos

Index of the object to return.

Returns

A pointer to the pos th active object.

Remarks

The behavior manager maintains all the instances of CKBeObject that need to be executed at each process loop. These objects are normally maintained by the CKScene, but direct access to them is provided for special processing.

See Also

CKScene,GetObjectsCount,AddObject


CKBehaviorManager::GetObjectsCount

Method CKBehaviorManager::GetObjectsCount

int CKBehaviorManager::GetObjectsCount()

Returns the current number of active objects

Remarks

The behavior manager maintains all the instances of CKBeObject that need to be executed at each process loop. These objects are normally maintained by the CKScene, but direct access to them is provided for special processing

Return Value. Number of currently active object.

See Also

CKScene,AddObject


CKBehaviorManager::RemoveAllObjects

Method CKBehaviorManager::RemoveAllObjects

CKERROR CKBehaviorManager::RemoveAllObjects()

Removes all the currently active objects from the behavior manager.

Returns

CK_OF is successful, an error code otherwise

Remarks

The behavior manager maintains all the instances of CKBeObject that need to be executed at each process loop. These objects are normally maintained by the CKScene, but direct access to them is provided for special processing.

See Also

CKScene,GetObjectsCount,AddObject,GetObject,AddObjectNextFrame


CKBehaviorManager::Execute

Method CKBehaviorManager::Execute

CKERROR CKBehaviorManager::Execute(float delta)

Executes all the needed behaviors

Parameters

Input argument delta

elapsed time in milliseconds since the last call to this function.

Returns

CK_OK on success

Remarks

This method executes all the behaviors attached to the enabled, active or waiting for a message objects of the behavior manager. The function responsible for each behavior is executed. This method is automatically called by the standard process loop, but direct access is provided for special processings.

See Also

CKProcess


CKBehaviorManager::GetBehaviorMaxIteration

Method CKBehaviorManager::GetBehaviorMaxIteration

int CKBehaviorManager::GetBehaviorMaxIteration()
void CKBehaviorManager::SetBehaviorMaxIteration(int n)

Sets or returns the maximum number of iteration for a behavior during one frame.

Parameters

n: Max number of iteration.

Returns

Max number of iteration.

Remarks

This limit is set to insure that behaviors will end in finite time thus avoiding infinite loop. A typical occasion of infinite loops are behaviors looping on themselves with a link delay of 0 Default Value : 8000

See Also

CKBehavior,CKBehaviorLink


CKBeObject

Class CKBeObject

Base class for objects with behaviors

CKObject

CKSceneObject
Show brief derivation trees

CKBeObject

CKDataArray

CKGroup

CKLevel

CKMaterial

CKMesh

CKPatchMesh

CKRenderObject

CK2dEntity

CKSprite

CKSpriteText

CK3dEntity

CK3dObject

CKBodyPart

CK3dPointCloud

CKCamera

CKTargetCamera

CKCharacter

CKCurve

CKCurvePoint

CKGrid

CKLight

CKTargetLight

CKPlace

CKSprite3D

CKScene

CKSound

CKMidiSound

CKWaveSound

CKTexture

CKVideo

CKObject

CKSceneObject
Show full derivation trees

CKBeObject

Subclasses

CKDataArray, CKGroup, CKLevel, CKMaterial, CKMesh, CKRenderObject, CKScene, CKSound, CKTexture, and CKVideo

Remarks

CKBeObject is the base class for all objects that can have scripts and attributes (BeObjects).

Instances of BeObjects can have a set of scripts attached to them. The object owns the scripts. The scripts are instances of CKBehavior.

The scripts are the behaviors that are activated when the object is installed in the current scene. They are the main starting points of the composition. They declare what the object does at the “beginning”.

When an instance of CKBeObject registers itself as waiting for messages, the message manager will process the messages sent to the object by stacking it in the object's “last frame messages” list. Behaviors attached to the object may then dequeue the messages by using the GetLastFrameMessage and GetLastFrameMessageCount methods. These messages are only stored during one “frame”.

Behavioral objects may be active or not in any scene they belong to. When they are active, all their active scripts, are processed during the process loop. By default, a behavioral object is activated at start.

Behavioral objects can have “Attributes” attached to them, each attribute has a specific type (or name) and a type of parameter that is associated to. For exemple one can create a new attribute type called “Health Point” with a associated parameter type “float” and attach it to any behavioral object using SetAttribute method.

Behavioral objects may be grouped together using instance of CKGroup.

The class id of CKBeObject is CKCID_BEOBJECT.

Groups

Attributes | Behaviors | Groups | Messages | Profiling | Scripts

Attributes
Method GetAttributeCount | Returns the number of attributes on this object.
Method GetAttributeList | Computes the list of attributes
Method GetAttributeParameter | Returns the parameter associated with the specified attribute.
Method GetAttributeParameterByIndex | Returns the parameter used by the Nth attribute
Method GetAttributeType | Returns the attribute type of an attribute
Method HasAttribute | Returns whether this object has the specified attribute.
Method RemoveAllAttributes | Removes all attributes from this object.
Method RemoveAttribute | Removes an attribute from the object.
Method SetAttribute | Adds the specified attribute and parameter to the object
Behaviors
Method CallBehaviorCallbackFunction | Sends a callback message to one or all the behaviors of this object.
Method ExecuteBehaviors | Executes the active behaviors of the object
Groups
Method IsInGroup | Returns whether this object is in a group.
Messages
Method GetLastFrameMessage | Returns a message received last frame.
Method GetLastFrameMessageCount | Returns the number of messages received last frame.
Method IsWaitingForMessages | Returns whether this object is waiting for messages
Method SetAsWaitingForMessages | Warns the object to save all the messages it received each frame.
Profiling
Method GetLastExecutionTime | Returns the time elapsed during last execution of the behaviors of this object.
Scripts
Method AddScript | Adds a script to the object
Method GetPriority | Gets the Behavioral Object Priority
Method GetScript | Returns the script at the given index
Method GetScriptCount | Returns the number of scripts of the object
Method RemoveAllScripts | Removes all the scripts of the object
Method RemoveScript | Removes a script from the object
Method SetPriority | Sets the Behavioral Object Priority

See Also

CKBehavior, CKMessageManager,CKAttributeManager,CKScene


CKBeObject::GetAttributeCount

Method CKBeObject::GetAttributeCount

int CKBeObject::GetAttributeCount()

Returns the number of attributes on this object.

Returns

Number of attributes.

See Also

SetAttribute,RemoveAttribute,Using attributes


CKBeObject::GetAttributeList

Method CKBeObject::GetAttributeList

void CKBeObject::GetAttributeList(CKAttributeVal* liste)

Computes the list of attributes

Parameters

Input argument liste

A pointer to an array of CKAttributeVal.

Remarks

+The liste pointer must have been allocated to GetAttributeCount() element before calling this function. +The method will copy all couple (AttributeType,Associated Parameter CK_ID) in the array.

See Also

SetAttribute,HasAttribute,Using attributes


CKBeObject::GetAttributeParameter

Method CKBeObject::GetAttributeParameter

CKParameterOut* CKBeObject::GetAttributeParameter(CKAttributeType AttribType)

Returns the parameter associated with the specified attribute.

Returns

A pointer to the associated parameter or NULL if the attribute is not set on the object.

See Also

SetAttribute,RemoveAttribute,Using attributes


CKBeObject::GetAttributeParameterByIndex

Method CKBeObject::GetAttributeParameterByIndex

CKParameterOut* CKBeObject::GetAttributeParameterByIndex(int index)

Returns the parameter used by the Nth attribute

Parameters

Input argument index

Index of the attribute to return;

Returns

Returns the parameter used to store the index th attribute.

Remarks

try to avoid using this method as accessing an attribute by its index in the object list of attributes is much slower than using its attribute type.

See Also

GetAttributeParameter,SetAttribute,RemoveAttribute,Using attributes


CKBeObject::GetAttributeType

Method CKBeObject::GetAttributeType

int CKBeObject::GetAttributeType(int index)

Returns the attribute type of an attribute

Parameters

Input argument index

Index of the attribute to return the type of.

Returns

Type of the index th attribute

Remarks

Accessing an attribute by its index in the object list of attributes is much slower than using its attribute type.

See Also

SetAttribute,RemoveAttribute,GetAttributeCount,GetAttributeName,Using attributes


CKBeObject::HasAttribute

Method CKBeObject::HasAttribute

CKBOOL CKBeObject::HasAttribute(CKAttributeType AttribType)

Returns whether this object has the specified attribute.

Parameters

Input argument AttribType

Type of the attribute to test the presence of .

Returns

TRUE if the object has the given attribute

See Also

SetAttribute,RemoveAttribute,Using attributes


CKBeObject::RemoveAllAttributes

Method CKBeObject::RemoveAllAttributes

void CKBeObject::RemoveAllAttributes()

Removes all attributes from this object.

See Also

SetAttribute,RemoveAttribute


CKBeObject::RemoveAttribute

Method CKBeObject::RemoveAttribute

CKBOOL CKBeObject::RemoveAttribute(CKAttributeType AttribType)

Removes an attribute from the object.

Parameters

Input argument AttribType

Type of the attribute to remove. AttribName: Name of the attribute type to remove.

Returns

TRUE if successful.

See Also

SetAttribute,HasAttribute,Using attributes


CKBeObject::SetAttribute

Method CKBeObject::SetAttribute

CKBOOL CKBeObject::SetAttribute(CKAttributeType AttribType,CK_ID parameter)

Adds the specified attribute and parameter to the object

Parameters

Input argument AttribType

Type of the attribute to set.

Returns

TRUE if successful, FALSE otherwise.

Remarks

+Adds the specified attribute to the object (if not already present) and sets the attached parameter. +If the attribute is already present the function returns FALSE. +If no parameter is specified and the attribute type is associated to a parameter type a parameter is automatically created, set to its default value and attached to the object.

See Also

HasAttribute,RemoveAttribute,Using attributes


CKBeObject::CallBehaviorCallbackFunction

Method CKBeObject::CallBehaviorCallbackFunction

int CKBeObject::CallBehaviorCallbackFunction(CKDWORD Message,CKGUID* behguid)

Sends a callback message to one or all the behaviors of this object.

Parameters

Input argument Message | An identifier of the message to send to the behaviors.
Input argument behguid | NULL if all the behaviors should be warned or a valid behavior CKGUID to warn a specific behavior.

Remarks

Behavior may have a callback function that is called for special events. (See CKBehaviorPrototype::SetBehaviorCallbackFct for more details). You may use this function to send user-defined messages to specific behaviors.

See Also

CKBehaviorPrototype::SetBehaviorCallbackFct


CKBeObject::ExecuteBehaviors

Method CKBeObject::ExecuteBehaviors

void CKBeObject::ExecuteBehaviors(float delta)

Executes the active behaviors of the object

Parameters

delta

Time elapsed since last call to this function.

Remarks

+This methods rarely needs to be called explicitly. It is automatically called by the main process loop. +You may call it directly, for special purposes. In this case, the delta argument should be the time in milliseconds since the last call.

See Also

CKProcess


CKBeObject::IsInGroup

Method CKBeObject::IsInGroup

CKBOOL CKBeObject::IsInGroup(CKGroup *Group)

Returns whether this object is in a group.

Parameters

Input argument Group

A pointer to a CKGroup.

Returns

TRUE if the object belongs to Group.

See Also

CKGroup::AddObject


CKBeObject::GetLastFrameMessage

Method CKBeObject::GetLastFrameMessage

CKMessage* CKBeObject::GetLastFrameMessage(int pos)

Returns a message received last frame.

Parameters

Input argument pos

Index of the message to be returned.

Returns

Returns pointer to Message, NULL if there is no message at this position

Remarks

Behaviors attached to the object may consult the messages received last frame by using this method.

See Also

CKMessage,GetLastFrameMessageCount


CKBeObject::GetLastFrameMessageCount

Method CKBeObject::GetLastFrameMessageCount

int CKBeObject::GetLastFrameMessageCount()

Returns the number of messages received last frame.

Returns

Number of messages received.

Remarks

When an instance of CKBeObject receives a message, it is actually stacked in this object's “last frame messages” list by the message Manager. They are called “last frame” because this list is also emptied by the message manager just before it processes its messages, so the messages in the object's queue only live during one frame. These methods give access to the list of messages, so that they can be queried by one of the object's behavior for example. The object must have been set as waiting for messages through SetAsWaitingForMessages function in order the messages to be stacked.

See Also

GetLastFrameMessage,CKMessageManager::Process, CKMessageManager::RegisterWait,SetAsWaitingForMessages


CKBeObject::IsWaitingForMessages

Method CKBeObject::IsWaitingForMessages

CKBOOL CKBeObject::IsWaitingForMessages()

Returns whether this object is waiting for messages

Returns

TRUE if the object is waiting for message


CKBeObject::SetAsWaitingForMessages

Method CKBeObject::SetAsWaitingForMessages

void CKBeObject::SetAsWaitingForMessages(CKBOOL wait)

Warns the object to save all the messages it received each frame.

Parameters

Input argument wait

TRUE to force the object to save all the messages it receive each frame, FALSE otherwise.

Remarks

The object must have been set as waiting for messages through SetAsWaitingForMessages function in order the messages to be stacked.

See Also

GetLastFrameMessageCount,IsWaitingForMessages


CKBeObject::GetLastExecutionTime

Method CKBeObject::GetLastExecutionTime

float CKBeObject::GetLastExecutionTime()

Returns the time elapsed during last execution of the behaviors of this object.

Returns

A float containing time elapsed in milliseconds.

Remarks

The value will only be correct if the profiling is enabled through CKContext::EnableProfiling() function.

See Also

CKContext::EnableProfiling


CKBeObject::AddScript

Method CKBeObject::AddScript

CKERROR CKBeObject::AddScript(CKBehavior *ckb)

Adds a script to the object

Parameters

Input argument ckb

the script to add

Returns

Value | Meaning
CK_OK | if successful.
CKERR_ALREADYPRESENT | if the script is already attach to this object.
CKERR_INCOMPATIBLECLASSID | if the object ClassID is incompatible with the script.

Remarks

Adds a new script to the set of scripts of the object.

See Also

GetScriptCount, GetScript, RemoveScript, RemoveAllScripts


CKBeObject::GetPriority

Method CKBeObject::GetPriority

int CKBeObject::GetPriority()

Gets the Behavioral Object Priority

Returns

Current Priority.

Remarks

+Higher priority make object's scripts being executed before lesser priority objects. +The default priority of a behavioral object is CKOBJECT_PRIORITYDEFAULT (0). +The Level has the highest priority by default (CKOBJECT_PRIORITYMAX) so its script are executed first then come the Scenes with a default priority of 30000 and places (20000).

See Also

SetPriority


CKBeObject::GetScript

Method CKBeObject::GetScript

CKBehavior *CKBeObject::GetScript(int pos)

Returns the script at the given index

Parameters

Input argument pos

the index of the script to return

Returns

A pointer to the script at the given index.

Remarks

Returns NULL if the index is invalid.

See Also

GetScriptCount, RemoveScript, AddScript, RemoveAllScripts


CKBeObject::GetScriptCount

Method CKBeObject::GetScriptCount

int CKBeObject::GetScriptCount()

Returns the number of scripts of the object

Returns

The number of scripts of the object.

See Also

GetScript, RemoveScript, AddScript, RemoveAllScripts


CKBeObject::RemoveAllScripts

Method CKBeObject::RemoveAllScripts

CKERROR CKBeObject::RemoveAllScripts()

Removes all the scripts of the object

Returns

CK_OK if success.

Remarks

Removes all the scripts of the object

See Also

GetScriptCount, GetScript, RemoveScript, AddScript


CKBeObject::RemoveScript

Method CKBeObject::RemoveScript

CKBehavior *CKBeObject::RemoveScript(int pos)
CKBehavior *CKBeObject::RemoveScript(CK_ID id)

Removes a script from the object

Parameters

Input argument id | CK_ID of the script to remove
Input argument pos | Index of the script to remove

Returns

A pointer to the removed script or NULL if not present.

Remarks

+Removes the script from the set of scripts of the object. +This method can be called with either the CK_ID of the script or its index in the list of scripts.

See Also

GetScriptCount, GetScript, AddScript, RemoveAllScripts


CKBeObject::SetPriority

Method CKBeObject::SetPriority

void CKBeObject::SetPriority(int priority)

Sets the Behavioral Object Priority

Parameters

Input argument priority

New Priority Value (between CKOBJECT_PRIORITYMIN (-32000) and CKOBJECT_PRIORITYMAX (32000)

Remarks

Higher priority make object's scripts being executed before lesser priority objects. The default priority of a behavioral object is CKOBJECT_PRIORITYDEFAULT (0). The Level has the highest priority by default (CKOBJECT_PRIORITYMAX) so its script are executed first then come the Scenes with a default priority of 30000 and places (20000).

See Also

GetPriority


CKMessageManager

Class CKMessageManager

Messages management

CKBaseManager
Show brief derivation trees

CKMessageManager

CKBaseManager
Show full derivation trees

CKMessageManager

Remarks

There is only one instance of the message manager per application. This instance receives and dispatches the messages to the objects or the behaviors that have requested it. It also manages a list of message types.

Behaviors that wish to wait for a message should register themselves using the RegisterWait method specifying the input to activate when the message will be received. They will then receive the messages sent with the SendMessage method. After the first message received, they will be automatically unregistered. They can also unregister themselves at any time using the unregisterWait methods.

Another way to proceed is to specify that an object accept all messages using CKBeObject::SetAsWaitingForMessages. This way all messages sent to an object will be stored for one frame. Behaviors may then ask the object about how many and which messages did he received last frame.

Messages have a type. The list of accepted types is maintained by the message manager. If an object or a behavior registers itself as waiting for a new type of message, this type is automatically added to the list of types. One can also add a new type manually using the AddMessageType method. The list of types can be accessed with the GetMessageTypeCount and GetMessageTypeName methods. In the registration methods, the type can be referred to by its name, or for optimization reasons, by its number.

When the SendMessage method is called, the given message is stacked by the message manager. When the Process method of the message manager is called, it unstacks the messages and dispatches them to the behaviors or objects, and then unregisters them. The messages to behaviors activate the provided input or output. The messages to the object are stacked in the object's “last frame messages” list.

The unique instance of CKMessageManager is accessed through the CKContext::GetMessageManager function.

Groups

Operations
Method RegisterWait | Registering a behavior or an object as waiting for a message
Method SendMessage | Enqueues the given message until the next call to Process
Method SetMessageHandler | Adds a message handler
Method StartProfile | Starts profiling.
Method StopProfile | Stops profiling.
Method UnRegisterWait | UnRegistering a behavior or an object as waiting for a message
Events
Virtual Method Method OnCKEnd | Called at deletion of a CKContext
Virtual Method Method OnCKInit | Called at the end of the creation of a CKContext.
Virtual Method Method OnCKPause | Called when the process loop is paused.
Virtual Method Method OnCKPlay | Called when the process loop is started .
Virtual Method Method OnCKPostReset | Called after the composition has been restarted.
Virtual Method Method OnPostBackToFront | Called after the backbuffer is presented.
Virtual Method Method OnPostCopy | Called at the end of a copy.
Virtual Method Method OnPostFullScreen | Called after switching to/from fullscreen.
Virtual Method Method OnPostRender | Called after the rendering of the 3D objects .
Virtual Method Method OnPostSpriteRender | Called after the rendering of foreground 2D entities.
Virtual Method Method OnPreBackToFront | Called before the backbuffer is presented.
Virtual Method Method OnPreCopy | Called at the beginning of a copy.
Virtual Method Method OnPreFullScreen | Called before switching to/from fullscreen.
Virtual Method Method OnPreRender | Called before the rendering of the 3D objects.
Virtual Method Method OnPreSpriteRender | Called Before the rendering of background 2D entities.
Virtual Method Method OnRasterizerEvent | Called for specific rasterizer events.
Virtual Method Method PostClearAll | Called at the end of a CKContext::ClearAll operation.
Virtual Method Method PostLaunchScene | Called after a scene became active.
Virtual Method Method PostLoad | Called at the end of a load operation.
Virtual Method Method PostProcess | Processes the messages ready for dispatch
Virtual Method Method PostSave | Called at the end of a save operation.
Virtual Method Method PreLaunchScene | Called before a scene becomes active.
Virtual Method Method PreLoad | Called at the beginning of a load operation.
Virtual Method Method PreProcess | Called at the beginning of each process loop.
Virtual Method Method PreSave | Called at the beginning of a save operation.
Virtual Method Method SequenceAddedToScene | Called when objects are added to a scene
Virtual Method Method SequenceDeleted | Called after objects have been deleted.
Virtual Method Method SequenceRemovedFromScene | Called when objects are removed from a scene
Virtual Method Method SequenceToBeDeleted | Called just before objects are deleted.
Messaages
Method GetMessageTypeCount | Returns the current number of registered type names. Return : Numbe of registerd message types.
Method GetMessageTypeName | Returns the message name given its type.
Method RenameMessageType | Modifies the name of a registered message type.
Messages
Method AddMessageType | Adds a message type.
Virtual Method Method OnCKReset | Removes all the waiting messages from the message queue.
Virtual Method Method PreClearAll | Resets the message manager.
Method SendMessageBroadcast | Broadcasts the message for a class of objects.
Method SendMessageGroup | Sends message to a group of objects.
Method SendMessageSingle | Sends message to a single object.

See Also

CKContext::GetMessageManager,CKMessage,CKMessageHandler


CKMessageManager::RegisterWait

Method CKMessageManager::RegisterWait

CKERROR CKMessageManager::RegisterWait(CKMessageType MsgType, CKBehavior *behav, int OutputToActivate,CKBeObject *obj)
CKERROR CKMessageManager::RegisterWait(int MsgType ,CKBehavior *behav,int OutputToActivate,CKBeObject *object)
CKERROR CKMessageManager::RegisterWait(CKSTRING MsgName,CKBehavior *behav,int OutputToActivate,CKBeObject *obj)

Registering a behavior or an object as waiting for a message

Parameters

Input argument MsgName | the name of type of the expected message
obj | the BeObject that is waiting for the message.
Input argument MsgType | the type of the expected message
Input argument behav | the behavior that is waiting for the message. Can be NULL.
Input argument OutputToActivate | the number of the input or output to activate on the behavior.

Returns

CK_OK if success

Remarks

The RegisterWait method registers a behavior or an object as waiting for a message. The behavior or the object should unregister when they do not need to wait, with the UnRegisterWait method. As soon as they receive a message, they are automatically unregistered after the message is received. If the given message type does not exist, it is automatically added to the list of message types. One can register either a behavior or an object. If a behavior is registered, when a message corresponding to the type is received, its corresponding behavior's IO, defined by inputOutputToActivate and isInput, is activated at the next frame and the behavior is unregistered automatically. You can unregsiter the behavior at any time with the UnRegisterWait method. If an object is provided, then when a message is received, it is added to the “last frame message list” associated with this object. This list can be accessed, by a behavior for example, with the CKBeObject::GetLastFrameMessageCount and CKBeObject::GetLastFrameMessage methods. After the message is put in the object's message list, the object is automatically unregistered. You can also unregister it at any time using the UnregisterWait method.

See Also

CKMessage, UnRegisterWait, SendMessage, AddMessageType, CKBeObject::GetLastFrameMessageCount, CKBeObject::GetLastFrameMessage


CKMessageManager::SendMessage

Method CKMessageManager::SendMessage

CKERROR CKMessageManager::SendMessage(CKMessage *msg, XBOOL useHandler )

Enqueues the given message until the next call to Process

Returns

CK_OK if success

Remarks

This methd enqueues the message in the queue of messages maintained by the message manager. The messages are dequeued by the Process method. Messages Should be created using the dedicated functions of the CKMessage class. You can also use the following global functions, as shortcuts: CKSendMessage, CKSendMessageSingle, CKSendMessageGroup, CKSendMessageBroadcast.

See Also

CKMessage, CKSendMessage, CKSendMessageSingle, CKSendMessageGroup, CKSendMessageBroadcast


CKMessageManager::SetMessageHandler

Method CKMessageManager::SetMessageHandler

CKMessageHandler*
CKMessageManager::SetMessageHandler( CKMessageHandler* msgHandler )

Adds a message handler

Returns

The previous message handler


CKMessageManager::UnRegisterWait

Method CKMessageManager::UnRegisterWait

CKERROR CKMessageManager::UnRegisterWait(CKMessageType MsgType, CKBehavior *behav, int OutputToActivate)
CKERROR CKMessageManager::UnRegisterWait(int MsgType ,CKBehavior *behav,int OutputToActivate)
CKERROR CKMessageManager::UnRegisterWait(CKSTRING MsgName,CKBehavior *behav,int OutputToActivate)

UnRegistering a behavior or an object as waiting for a message

Parameters

Input argument MsgName | the name of type of the expected message
Input argument MsgType | the type of the expected message
Input argument behav | the behavior that is waiting for the message. Can be NULL.
Input argument OutputToActivate | the number of the input or output to activate on the behavior. obj: the BeObject that is waiting for the message.

Returns

CK_OK if success

Remarks

The RegisterWait method registers a behavior or an object as waiting for a message. The behavior or the object should unregister when they do not need to wait, with the UnRegisterWait method. As soon as they receive a message, they are automatically unregistered after the message is received. If the given message type does not exist, it is automatically added to the list of message types. One can register either a behavior or an object. If a behavior is registered, when a message corresponding to the type is received, its corresponding behavior's IO, defined by inputOutputToActivate and isInput, is activated at the next frame and the behavior is unregistered automatically. You can unregsiter the behavior at any time with the UnRegisterWait method. If an object is provided, then when a message is received, it is added to the “last frame message list” associated with this object. This list can be accessed, by a behavior for example, with the CKBeObject::GetLastFrameMessageCount and CKBeObject::GetLastFrameMessage methods. After the message is put in the object's message list, the object is automatically unregistered. You can also unregister it at any time using the UnregisterWait method.

See Also

CKMessage, RegisterWait, SendMessage, AddMessageType, CKBeObject::GetLastFrameMessageCount, CKBeObject::GetLastFrameMessage


CKMessageManager::PostProcess

Virtual Method Method CKMessageManager::PostProcess

CKERROR CKMessageManager::PostProcess()

Processes the messages ready for dispatch

Returns

CK_OK if success

Remarks

You can override this function to add specific processing at the end of a CKContext::Process operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PostProcess for this function to get called.

Implementation Notes

Processes the messages in the message queue to dispatch them to the behaviors and object that are registered as waiting. When a message is sent using the CKMessageManager::SendMessage method or the CKSendMessage global function, they are not dispatched to their target immediately, but rather are stacked in a queue inside the message manager. This queue is emptied and the messages dispatched one by one when the CKMessageManager::Process method is called. For each message, its type is looked up, the behaviors and object registered as waiting for this type are found, each one of them is notified (the behaviors have their input or output activated, the object receive the message in their “last frame messages” list), and then the object or behavior is unregistered and the message deleted. By default, this method is called once per frame.

See Also

CKSendMessage, CKMessageManager::SendMessage


CKMessageManager::GetMessageTypeCount

Method CKMessageManager::GetMessageTypeCount

int CKMessageManager::GetMessageTypeCount()

Returns the current number of registered type names.

Return : Numbe of registerd message types.

See Also

AddMessageType


CKMessageManager::GetMessageTypeName

Method CKMessageManager::GetMessageTypeName

CKSTRING CKMessageManager::GetMessageTypeName(CKMessageType MsgType)
CKSTRING CKMessageManager::GetMessageTypeName(int MsgType)

Returns the message name given its type.

Parameters

MsgType

Message type

Returns

Name of the message.

See Also

AddMessageType


CKMessageManager::RenameMessageType

Method CKMessageManager::RenameMessageType

void CKMessageManager::RenameMessageType(CKMessageType MsgType,CKSTRING NewName)
void CKMessageManager::RenameMessageType(int MsgType,CKSTRING NewName)
void CKMessageManager::RenameMessageType(CKSTRING OldName,CKSTRING NewName)

Modifies the name of a registered message type.

Parameters

Input argument OldName | Old name of the message.
Input argument MsgType | Type of the message to be renamed.
Input argument NewName | New name of the message.

Remarks

MsgType has to be greater than 0 and less than that of total number of registerd messages, otherwise no action will take place.

See Also

RenameMessageType


CKMessageManager::AddMessageType

Method CKMessageManager::AddMessageType

CKMessageType CKMessageManager::AddMessageType(CKSTRING MsgName)

Adds a message type.

Parameters

Input argument MsgName

Message name to be added.

Returns

Index of the message added.

Remarks

+The message manager maintains a set of message types. +These types can be refered to by name or, for optimization reasons, by index. +A certain number of message types are predefined. +New types can be added at any time. +Using a new type name in the CKMessageManager::RegisterWait method automatically defines the type name and assigns it a number. +Message names are case sensitive. +The default message type is “OnClick”.

+The AddMessageType method adds a new type name to the set and assigns it an index that it returns. +If the type name was already registered, the previous index is returned. +You can also use the CKAddMessageType global function.

See Also

CKMessageManager::RegisterWait


CKMessageManager::OnCKReset

Virtual Method Method CKMessageManager::OnCKReset

CKERROR CKMessageManager::OnCKReset()

Removes all the waiting messages from the message queue.

Returns

Returns CK_OK on success.

See Also

CKMessageManager::SendMessage


CKMessageManager::PreClearAll

Virtual Method Method CKMessageManager::PreClearAll

CKERROR CKMessageManager::PreClearAll()

Resets the message manager.

Returns

CK_OK on success.

Remarks

You can override this function to add specific processing at the beginning of a CKContext::ClearAll operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PreClearAll for this function to get called.

Implementation Notes

All current messages and waiting behaviors are removed from the manager. All registred messages names are also deleted.

See Also

CKMessageManager::AddMessage


CKMessageManager::SendMessageBroadcast

Method CKMessageManager::SendMessageBroadcast

CKMessage* CKMessageManager::SendMessageBroadcast (CKMessageType MsgType,CK_CLASSID id=CKCID_BEOBJECT,CKBeObject *sender=NULL)
CKMessage* CKMessageManager::SendMessageBroadcast(int MsgType,CK_CLASSID cid,CKBeObject *sender)

Broadcasts the message for a class of objects.

Parameters

Input argument id | Class id of the objects which are to receive the messages.
Input argument MsgType | Type of the message
Input argument sender | Sender object

Returns

The CKMessage that was created or an error code otherwise.

Remarks

Adds the given message to the message manager's message queue, which will be dequeued at the next call to CKMessageManager::Process. These function are basically shortcuts to the CKMessageManager::SendMessage method. The CKSendMessageSingle function creates a message for a single destination, that it enqueues. The CKSendMessageGroup function creates a message for a list of destinations, that it enqueues The CKSendMessageBroadcast function creates a message for a class hierarchy, that it enqueues

See Also

CKMessageManager::SendMessage


CKMessageManager::SendMessageGroup

Method CKMessageManager::SendMessageGroup

CKMessage* CKMessageManager::SendMessageGroup (CKMessageType MsgType,CKGroup* group,CKBeObject *sender=NULL)
CKMessage* CKMessageManager::SendMessageGroup (int MsgType,CKGroup* group,CKBeObject *sender)

Sends message to a group of objects.

Parameters

Input argument MsgType | Type of the message
Input argument group | Group of object
Input argument sender | Sender object

Returns

The CKMessage that was created or an error code otherwise.

Remarks

+Adds the given message to the message manager's message queue, which will be dequeued at the next call to CKMessageManager::Process. +These function are basically shortcuts to the CKMessageManager::SendMessage method. +The CKSendMessageSingle function creates a message for a single destination, that it enqueues. +The CKSendMessageGroup function creates a message for a list of destinations, that it enqueues +The CKSendMessageBroadcast function creates a message for a class hierarchy, that it enqueues

See Also

CKMessageManager::SendMessage


CKMessageManager::SendMessageSingle

Method CKMessageManager::SendMessageSingle

CKMessage* CKMessageManager::SendMessageSingle (CKMessageType MsgType,CKBeObject *dest,CKBeObject *sender=NULL)
CKMessage* CKMessageManager::SendMessageSingle (int MsgType,CKBeObject *dest,CKBeObject *sender)

Sends message to a single object.

Parameters

Input argument MsgType | Type of the message
Input argument dest | Destination object
Input argument sender | Sender object

Returns

The CKMessage that was created or an error code otherwise.

Remarks

Adds the given message to the message manager's message queue, which will be dequeued at the next call to CKMessageManager::Process. These function are basically shortcuts to the CKMessageManager::SendMessage method. The CKSendMessageSingle function creates a message for a single destination,that it enqueues. The CKSendMessageGroup function creates a message for a list of destinations,that it enqueues The CKSendMessageBroadcast function creates a message for a class hierarchy,that it enqueues

See Also

CKMessageManager::SendMessage


CKParameterManager

Class CKParameterManager

Parameter and operation types management

CKBaseManager
Show brief derivation trees

CKParameterManager

CKBaseManager
Show full derivation trees

CKParameterManager

Remarks

There is only one instance of the CKParameterManager per context, which can be accessed using the CKContext::GetParameterManager global function. It manages the list of parameter types, and the list of operation types. It gives access to the creation and registration of new operations, and overwriting of existing operations.

Operations are subdivided into families, where members of a family of operations all perform the same kind of operations on different types of parameters. For example, you can add floats and also imagine adding 3D entities. In order to define a new operation type, its family should first be registered, then its function should be declared. When a family is unregistered, all the operations of that family are unregistered too. In all cases the name argument is provided as a conveniency for debugging and display purposes.

Groups

Parameter Types Management
Method GetParameterSize | Size taken by parameters of a given type
Method GetParameterTypeDescription | Returns the description for a given parameter type
Method GetParameterTypesCount | Returns the number of registred parameter types
Method IsDerivedFrom | Check the derivation between 2 parameter types
Method IsTypeCompatible | Check the compatibility between 2 parameter types
Method ParameterGuidToName | GUID to Parameter type name conversion
Method ParameterGuidToType | GUID to CKParameterType conversion
Method ParameterNameToGuid | Parameter type name to CKGUID conversion
Method ParameterNameToType | Parameter type name to CKParameterType conversion
Method ParameterTypeToGuid | CKParameterType to CKGUID conversion
Method ParameterTypeToName | CKParameterType to parameter type name conversion
Method RegisterParameterType | Register a new parameter type
Method TypeToClassID | GUID to CK_CLASSID conversions
Method UnRegisterParameterType | Unregister a parameter type
Parameter Operation Type Management
Method GetAvailableOperationsDesc | Returns all the posssible combinations for a given operation family.
Method GetOperationFunction | Returns a function for a given parameter operation and parameter types.
Method GetParameterOperationCount | returns the number of currently registred operation families.
Method OperationCodeToGuid | Conversion Operation Code to Operation GUID
Method OperationCodeToName | Conversion Operation Code to Operation Name
Method OperationGuidToCode | Conversion Operation GUID to Operation Code
Method OperationGuidToName | Conversion Operation GUID to Operation Name
Method OperationNameToCode | Conversion Operation Name to Operation Code
Method OperationNameToGuid | Conversion Operation Name to Operation GUID
Method RegisterOperationType | Operation registration
Method UnRegisterOperationFunction | Removes a function for a given parameter operation.
Method UnRegisterOperationType | Unregisters all the operations with that GUID.
Special parameter types
Method ChangeEnumDeclaration | Changes the declaration of an Enum Type
Method ChangeFlagsDeclaration | Changes the declaration of a Flags Type
Method RegisterNewEnum | Registers a new parameter type of Enum Type
Method RegisterNewFlags | Registers a new parameter type of Flags Type
Method RegisterNewStructure | Registers a new parameter type of Structure Type
Operations
Method ChangeParametersGuid |
Method GetEnumBuildString | returns the build string of an Enum Type
Method GetFlagBuildString | returns the build string of an flag Type
Method RegisterOperationFunction |
Method StartProfile | Starts profiling.
Method StopProfile | Stops profiling.

See Also

CKParameterOperation, CKParameter,CKParameterIn, CKParameterOut,ParameterOperation Types,Pre-Registred Parameter Types


CKParameterManager::GetParameterSize

Method CKParameterManager::GetParameterSize

int CKParameterManager::GetParameterSize(CKParameterType ptype)

Size taken by parameters of a given type

Returns

Size taken by the data of a given parameter type (in byte)

Remarks

Most parameter have a fixed size given by their type. This method returns the size in byte taken by parameters of type ptype.

See Also

CKParameterTypeDesc


CKParameterManager::GetParameterTypeDescription

Method CKParameterManager::GetParameterTypeDescription

CKParameterTypeDesc* CKParameterManager::GetParameterTypeDescription(int type)
CKParameterTypeDesc* CKParameterManager::GetParameterTypeDescription(CKParameterType type)
CKParameterTypeDesc* CKParameterManager::GetParameterTypeDescription(CKGUIDCONSTREF ParameterTypeGuid)

Returns the description for a given parameter type

Parameters

Input argument ParameterTypeGuid | CKGUID of the parameter type to return the description of.
Input argument type | CKParameterType of the parameter type to return the description of.

Returns

NULL if the parameter type is invalid or a valid pointer to a CKParameterTypeDesc structure that contains the description of this parameter type. This return value must not be deleted.

Remarks

This method returns the CKParameterTypeDesc structure describing the format of a given parameter type. See RegisterParameterType method for more detail on the CKParameterTypeDesc structure

See Also

CKParameterTypeDesc,RegisterParameterType


CKParameterManager::GetParameterTypesCount

Method CKParameterManager::GetParameterTypesCount

int CKParameterManager::GetParameterTypesCount()

Returns the number of registred parameter types

Returns

Number of registred parameter types.

See Also

CKParameterTypeDesc,RegisterParameterType


CKParameterManager::IsDerivedFrom

Method CKParameterManager::IsDerivedFrom

CKBOOL CKParameterManager::IsDerivedFrom(CKGUIDCONSTREF guid1,CKGUIDCONSTREF parent)
CKBOOL CKParameterManager::IsDerivedFrom(CKParameterType child,CKParameterType parent)

Check the derivation between 2 parameter types

Parameters

Input argument guid1 | CKGUID of the parameter type we want to check if it derives from parent.
Input argument child | CKParameterType of the parameter type we want to check if it derives from parent.
parent | CKGUID or CKParameterType of the parent parameter type.

Returns

TRUE if parameter type guid1 derives directly or indirectly from parent parameter type.

Remarks

When registring a parameter type it can be declared as derived from a another parameter type and all operations available on the parent type will be available to parameters of the child type.

See Also

IsTypeCompatible


CKParameterManager::IsTypeCompatible

Method CKParameterManager::IsTypeCompatible

CKBOOL CKParameterManager::IsTypeCompatible(CKGUIDCONSTREF guid1,CKGUIDCONSTREF guid2)
CKBOOL CKParameterManager::IsTypeCompatible(CKParameterType Ptype1,CKParameterType Ptype2)

Check the compatibility between 2 parameter types

Parameters

Input argument guid1 | CKGUID of the first parameter type we want to test the compatibility of.
Input argument guid2 | CKGUID of the second parameter type we want to test the compatibility of.
Input argument Ptype1 | CKParameterType of the first parameter type we want to test the compatibility of.
Input argument Ptype2 | CKParameterType of the second parameter type we want to test the compatibility of.

Returns

TRUE if the two parameter types are compatibles.

Remarks

Two parameters are considered compatible is their value can directly been copied without any conversion. For example a float parameter and a percentage are compatible as their inner storage is the same

See Also

IsDerivedFrom


CKParameterManager::ParameterGuidToName

Method CKParameterManager::ParameterGuidToName

CKSTRING CKParameterManager::ParameterGuidToName(CKGUIDCONSTREF guid)

GUID to Parameter type name conversion

Remarks

These methods give access to the correspondance between parameter types index, name and GUID. A certain number of parameter types are available by default. Reference to a parameter type can be done by its GUID or by its index (CKParameterType) in the global parameter table. The index acees is provided for optimization reasons. Also, parameter type may have a name, which is provided as a conveniency for debugging and display usage.

See Also

ParameterGuidToType,ParameterNameToType,ParameterNameToGuid,ParameterTypeToGuid,ParameterTypeToName


CKParameterManager::ParameterGuidToType

Method CKParameterManager::ParameterGuidToType

CKParameterType CKParameterManager::ParameterGuidToType(CKGUIDCONSTREF guid)

GUID to CKParameterType conversion

Remarks

These methods give access to the correspondance between parameter types index, name and GUID. A certain number of parameter types are available by default. Reference to a parameter type can be done by its GUID or by its index (CKParameterType) in the global parameter table. The index acees is provided for optimization reasons. Also, parameter type may have a name, which is provided as a conveniency for debugging and display usage.

See Also

ParameterGuidToName,ParameterNameToType,ParameterNameToGuid,ParameterTypeToGuid,ParameterTypeToName


CKParameterManager::ParameterNameToGuid

Method CKParameterManager::ParameterNameToGuid

CKGUID CKParameterManager::ParameterNameToGuid(CKSTRING name)

Parameter type name to CKGUID conversion

Remarks

These methods give access to the correspondance between parameter types index, name and GUID. A certain number of parameter types are available by default. Reference to a parameter type can be done by its GUID or by its index (CKParameterType) in the global parameter table. The index acees is provided for optimization reasons. Also, parameter type may have a name, which is provided as a conveniency for debugging and display usage.

See Also

ParameterGuidToType,ParameterGuidToName,ParameterNameToType,ParameterTypeToGuid,ParameterTypeToName


CKParameterManager::ParameterNameToType

Method CKParameterManager::ParameterNameToType

CKParameterType CKParameterManager::ParameterNameToType(CKSTRING name)

Parameter type name to CKParameterType conversion

Remarks

These methods give access to the correspondance between parameter types index, name and GUID. A certain number of parameter types are available by default. Reference to a parameter type can be done by its GUID or by its index (CKParameterType) in the global parameter table. The index acees is provided for optimization reasons. Also, parameter type may have a name, which is provided as a conveniency for debugging and display usage.

See Also

ParameterGuidToType,ParameterGuidToName,ParameterNameToGuid,ParameterTypeToGuid,ParameterTypeToName


CKParameterManager::ParameterTypeToGuid

Method CKParameterManager::ParameterTypeToGuid

CKGUID CKParameterManager::ParameterTypeToGuid(CKParameterType ptype)

CKParameterType to CKGUID conversion

Remarks

These methods give access to the correspondance between parameter types index, name and GUID. A certain number of parameter types are available by default. Reference to a parameter type can be done by its GUID or by its index (CKParameterType) in the global parameter table. The index acees is provided for optimization reasons. Also, parameter type may have a name, which is provided as a conveniency for debugging and display usage.

See Also

ParameterGuidToType,ParameterGuidToName,ParameterNameToType,ParameterNameToGuid,ParameterTypeToName


CKParameterManager::ParameterTypeToName

Method CKParameterManager::ParameterTypeToName

CKSTRING CKParameterManager::ParameterTypeToName(CKParameterType type)
CKSTRING CKParameterManager::ParameterTypeToName(int type)

CKParameterType to parameter type name conversion

Remarks

These methods give access to the correspondance between parameter types index, name and GUID. A certain number of parameter types are available by default. Reference to a parameter type can be done by its GUID or by its index (CKParameterType) in the global parameter table. The index acees is provided for optimization reasons. Also, parameter type may have a name, which is provided as a conveniency for debugging and display usage.

See Also

ParameterGuidToType,ParameterGuidToName,ParameterNameToType,ParameterNameToGuid,ParameterTypeToGuid


CKParameterManager::RegisterParameterType

Method CKParameterManager::RegisterParameterType

CKERROR CKParameterManager::RegisterParameterType(CKParameterTypeDesc *param_type)

Register a new parameter type

Returns

Value | Meaning
CKERR_INVALIDPARAMETERTYPE | if the parameter type already exists
CK_OK | if successful...

Remarks

This method declare a new parameter type. the CKParameterTypeDesc structure must contain all the information about the newly created parameter type. See Creating New Parameter Types for more information on how to create a new parameter type.

See Also

Creating New Parameter Types,CKParameterTypeDesc,UnRegisterParameterType


CKParameterManager::TypeToClassID

Method CKParameterManager::TypeToClassID

CK_CLASSID CKParameterManager::TypeToClassID(CKParameterType ptype)
CK_CLASSID CKParameterManager::GuidToClassID(CKGUIDCONSTREF guid)
CKGUID CKParameterManager::ClassIDToGuid(CK_CLASSID cid)
CKParameterType CKParameterManager::ClassIDToType(CK_CLASSID cid)

GUID to CK_CLASSID conversions

Returns

Class Identifier associated withi this parameter type or 0.

Remarks

Almost every CK.. class as a corresponding parameter type, parameter using one this type always contain a CK_ID of the object. These methods convert a GUID or CKParameterType to the corresponding Class identifier if the parameter correspond to a specific class or 0 otherwise.

See Also

CKParameterTypeDesc


CKParameterManager::UnRegisterParameterType

Method CKParameterManager::UnRegisterParameterType

CKERROR CKParameterManager::UnRegisterParameterType(CKGUIDCONSTREF guid)

Unregister a parameter type

Parameters

Input argument guid

CKGUID of the parameter type to unregister.

Returns

CK_OK if successful or CKERR_INVALIDPARAMETER if the parameter did not exist.

Remarks

Every existing parameter that are using this parameter type become invalid. All parameter types that were created as derived from this parameter type will be also unregistred

See Also

RegisterParameterType


CKParameterManager::GetAvailableOperationsDesc

Method CKParameterManager::GetAvailableOperationsDesc

int CKParameterManager::GetAvailableOperationsDesc(const CKGUID &opguid,
CKParameterOut *res,
CKParameterIn *p1,
CKParameterIn *p2,
CKOperationDesc *list)

Returns all the posssible combinations for a given operation family.

Parameters

Input argument opguid | GUID of the parameter operation which combination should be returned
Input argument res | NULL if all parameter types should be explored or a valid CKParameterOut pointer to filter the returned list according to the return value type.
Input argument p1 | NULL if all parameter types should be explored or a valid CKParameterIn pointer to filter the returned list according to the first parameter type.
Input argument p2 | NULL if all parameter types should be explored or a valid CKParameterIn pointer to filter the returned list according to the second parameter type.
Input argument list | An array of CKOperationDesc that will be filled with the list

Remarks

+This method fills a list of CKOperationDesc structure that contains a description +This method is to be used in two steps. The first time with list as a NULL parameter, the return value is the number of combination found given the input parameters. The method can then be called with a list with sufficient memory allocated to store the result combinations. (sizeof(CKOperationDesc) * nb combinations found.

See Also

GetParameterOperationCount


CKParameterManager::GetOperationFunction

Method CKParameterManager::GetOperationFunction

CK_PARAMETEROPERATION CKParameterManager::GetOperationFunction(CKGUIDREF opguid,
CKGUIDREF type_paramres,
CKGUIDREF type_param1,
CKGUIDREF type_param2 )

Returns a function for a given parameter operation and parameter types.

Parameters

Input argument opguid | CKGUID of the operation which function should be returned for the following parameters types.
Input argument type_paramres | CKGUID of the result parameter.
Input argument type_param1 | CKGUID of the first input parameter
Input argument type_param2 | CKGUID of the second input parameter

See Also

Creation of new Parameter Operations,RegisterOperationFunction


CKParameterManager::GetParameterOperationCount

Method CKParameterManager::GetParameterOperationCount

int CKParameterManager::GetParameterOperationCount()

returns the number of currently registred operation families.

Remarks

Operation codes (CKOperationType) are integer ranged between 0 and GetParameterOperationCount

See Also

OperationCodeToGuid,OperationCodeToName,RegisterOperationType


CKParameterManager::OperationCodeToGuid

Method CKParameterManager::OperationCodeToGuid

CKGUID CKParameterManager::OperationCodeToGuid(CKOperationType opcode)

Conversion Operation Code to Operation GUID

Remarks

All operations are stacked in a global operation family type table. Access to operations using the index of the operation type (CKOperationType) in the table may be more efficient than with the CKGUID or by name. Many methods provide mapping of the type CKGUID to the CKOperationType or name. In any case, the name of an operation type is provided as a conveniency for debugging and display purposes. OperationCodeToGuid: returns the CKGUID of the operation type at the given index OperationCodeToName: returns the name of the operation family type at the given index OperationGuidToName: returns the name of the operation family type OperationGuidToCode: returns the index of the given operation family type OperationNameToGuid: returns the CKGUID of the operation family type OperationNameToCode: returns the index of the given operation family type

See Also

ParameterOperation Types,GetParameterOperationCount


CKParameterManager::OperationCodeToName

Method CKParameterManager::OperationCodeToName

CKSTRING CKParameterManager::OperationCodeToName(CKOperationType opcode)

Conversion Operation Code to Operation Name

Remarks

All operations are stacked in a global operation family type table. Access to operations using the index of the operation type (CKOperationType) in the table may be more efficient than with the CKGUID or by name. Many methods provide mapping of the type CKGUID to the CKOperationType or name. In any case, the name of an operation type is provided as a conveniency for debugging and display purposes. OperationCodeToGuid: returns the CKGUID of the operation type at the given index OperationCodeToName: returns the name of the operation family type at the given index OperationGuidToName: returns the name of the operation family type OperationGuidToCode: returns the index of the given operation family type OperationNameToGuid: returns the CKGUID of the operation family type OperationNameToCode: returns the index of the given operation family type

See Also

ParameterOperation Types,GetParameterOperationCount


CKParameterManager::OperationGuidToCode

Method CKParameterManager::OperationGuidToCode

int CKParameterManager::OperationGuidToCode(CKGUIDCONSTREF guid)

Conversion Operation GUID to Operation Code

Remarks

All operations are stacked in a global operation family type table. Access to operations using the index of the operation type (CKOperationType) in the table may be more efficient than with the CKGUID or by name. Many methods provide mapping of the type CKGUID to the CKOperationType or name. In any case, the name of an operation type is provided as a conveniency for debugging and display purposes. OperationCodeToGuid: returns the CKGUID of the operation type at the given index OperationCodeToName: returns the name of the operation family type at the given index OperationGuidToName: returns the name of the operation family type OperationGuidToCode: returns the index of the given operation family type OperationNameToGuid: returns the CKGUID of the operation family type OperationNameToCode: returns the index of the given operation family type

See Also

ParameterOperation Types


CKParameterManager::OperationGuidToName

Method CKParameterManager::OperationGuidToName

CKSTRING CKParameterManager::OperationGuidToName(CKGUIDCONSTREF guid)

Conversion Operation GUID to Operation Name

Remarks

All operations are stacked in a global operation family type table. Access to operations using the index of the operation type (CKOperationType) in the table may be more efficient than with the CKGUID or by name. Many methods provide mapping of the type CKGUID to the CKOperationType or name. In any case, the name of an operation type is provided as a conveniency for debugging and display purposes. OperationCodeToGuid: returns the CKGUID of the operation type at the given index OperationCodeToName: returns the name of the operation family type at the given index OperationGuidToName: returns the name of the operation family type OperationGuidToCode: returns the index of the given operation family type OperationNameToGuid: returns the CKGUID of the operation family type OperationNameToCode: returns the index of the given operation family type

See Also

ParameterOperation Types


CKParameterManager::OperationNameToCode

Method CKParameterManager::OperationNameToCode

int CKParameterManager::OperationNameToCode(CKSTRING name)

Conversion Operation Name to Operation Code

Remarks

All operations are stacked in a global operation family type table. Access to operations using the index of the operation type (CKOperationType) in the table may be more efficient than with the CKGUID or by name. Many methods provide mapping of the type CKGUID to the CKOperationType or name. In any case, the name of an operation type is provided as a conveniency for debugging and display purposes. OperationCodeToGuid: returns the CKGUID of the operation type at the given index OperationCodeToName: returns the name of the operation family type at the given index OperationGuidToName: returns the name of the operation family type OperationGuidToCode: returns the index of the given operation family type OperationNameToGuid: returns the CKGUID of the operation family type OperationNameToCode: returns the index of the given operation family type

See Also

ParameterOperation Types


CKParameterManager::OperationNameToGuid

Method CKParameterManager::OperationNameToGuid

CKGUID CKParameterManager::OperationNameToGuid(CKSTRING name)

Conversion Operation Name to Operation GUID

Remarks

All operations are stacked in a global operation family type table. Access to operations using the index of the operation type (CKOperationType) in the table may be more efficient than with the CKGUID or by name. Many methods provide mapping of the type CKGUID to the CKOperationType or name. In any case, the name of an operation type is provided as a conveniency for debugging and display purposes. OperationCodeToGuid: returns the CKGUID of the operation type at the given index OperationCodeToName: returns the name of the operation family type at the given index OperationGuidToName: returns the name of the operation family type OperationGuidToCode: returns the index of the given operation family type OperationNameToGuid: returns the CKGUID of the operation family type OperationNameToCode: returns the index of the given operation family type

See Also

ParameterOperation Types


CKParameterManager::RegisterOperationType

Method CKParameterManager::RegisterOperationType

CKOperationType CKParameterManager::RegisterOperationType(CKGUIDCONSTREF guid,CKSTRING name)

Operation registration

Remarks

RegisterOperationType: Registers an operation family with the given GUID and the given optional name. Returns the index of this new operation family in the global table. This value can be use to later on access to this operation family much faster. RegisterOperationFunction: registers the given functions as applying to the given parameter types for the given operation family GUID. UnRegisterOperationFunction: unregisters the given operation function for the given operation family guid and the given parameter types. GetOperationFunction: returns the function that will be used for the given operation on the given parameter types. GetParameterOperationCount: returns the number of currently registred operation family.

See Also

Creation of new Parameter Operations,UnRegisterOperationType,RegisterOperationFunction,UnRegisterOperationFunction,GetParameterOperationCount


CKParameterManager::UnRegisterOperationFunction

Method CKParameterManager::UnRegisterOperationFunction

CKERROR CKParameterManager::UnRegisterOperationFunction(CKGUIDREF opguid,
CKGUIDREF type_paramres,
CKGUIDREF type_param1,
CKGUIDREF type_param2
)

Removes a function for a given parameter operation.

Parameters

Input argument opguid | CKGUID of the operation which function should be removed for the following parameters types.
Input argument type_paramres | CKGUID of the result parameter.
Input argument type_param1 | CKGUID of the first input parameter
Input argument type_param2 | CKGUID of the second input parameter

See Also

Creation of new Parameter Operations,RegisterOperationFunction,GetOperationFunction


CKParameterManager::UnRegisterOperationType

Method CKParameterManager::UnRegisterOperationType

CKERROR CKParameterManager::UnRegisterOperationType(CKOperationType opcode)
CKERROR CKParameterManager::UnRegisterOperationType(CKGUIDCONSTREF opguid)

Unregisters all the operations with that GUID.

Parameters

Input argument opguid | CKGUID of the operation family to remove.
Input argument opcode | Index of the parameter operation family to remove.

See Also

Creation of new Parameter Operations,RegisterOperationType,GetParameterOperationCount


CKParameterManager::ChangeEnumDeclaration

Method CKParameterManager::ChangeEnumDeclaration

CKERROR CKParameterManager::ChangeEnumDeclaration(CKGUIDCONSTREF EnumGuid,CKSTRING EnumData)

Changes the declaration of an Enum Type

Parameters

Input argument EnumGuid | CKGUID that will identify the m_Flags Parameter Type to change
Input argument EnumData | A string containing the list of element for these m_Flags (eg. “ClipLeft=1,ClipTop=2,ClipRight=4,ClipBottom=8....” )

Returns

Value | Meaning
CK_OK | if successful,CKERR_INVALIDPARAMETER if FlagsData are NULL,
CKERR_INVALIDGUID | if the CKGUID of the parameter type is invalid.

Remarks

+Use this function to change the declaration of an Enum parameter type that was previously created with RegisterNewEnum. +The parameter type derived from CKPGUID_INT, so every operation available on an integer parameter will also be able on the new parameter type.

See Also

CKParameterManager,RegisterNewStructure,RegisterNewEnum


CKParameterManager::ChangeFlagsDeclaration

Method CKParameterManager::ChangeFlagsDeclaration

CKERROR CKParameterManager::ChangeFlagsDeclaration(CKGUIDCONSTREF FlagsGuid,CKSTRING FlagsData)

Changes the declaration of a Flags Type

Parameters

Input argument FlagsGuid | CKGUID that will identify the Flags Parameter Type to change
Input argument FlagsData | A string containing the list of element for these Flags (eg. “ClipLeft=1,ClipTop=2,ClipRight=4,ClipBottom=8....” )

Returns

Value | Meaning
CK_OK | successful
CKERR_INVALIDPARAMETER | FlagsData is NULL,
CKERR_INVALIDGUID | CKGUID of the parameter type is invalid.

Remarks

Use this function to change the declaration of a Flags parameter type. The parameter type derived from CKPGUID_INT, so every operation available on an integer parameter will also be able on a Flags parameter type.

See Also

CKParameterManager,RegisterNewStructure,RegisterNewFlags


CKParameterManager::RegisterNewEnum

Method CKParameterManager::RegisterNewEnum

CKERROR CKParameterManager::RegisterNewEnum(CKGUIDCONSTREF EnumGuid,CKSTRING EnumName,CKSTRING EnumData)

Registers a new parameter type of Enum Type

Parameters

Input argument EnumGuid | CKGUID that will identify the newly created Parameter Type
Input argument EnumName | Name of the new parameter type
Input argument EnumData | A string containing the list of element for this enum (eg. “Monday=1,Tuesday=2” )

Returns

Value | Meaning
CK_OK | if successful
CKERR_INVALIDPARAMETER | if EnumData or EnumName are NULL,
CKERR_INVALIDGUID | if the provided GUID is already in use.

Remarks

Use this function to register a new parameter type that will describes a enumeration. The parameter type is derived from CKPGUID_INT, so every operation available on an integer parameter will also be able on the new parameter type.

See Also

CKParameterManager,RegisterNewStructure


CKParameterManager::RegisterNewFlags

Method CKParameterManager::RegisterNewFlags

CKERROR CKParameterManager::RegisterNewFlags(CKGUIDCONSTREF FlagsGuid,CKSTRING FlagsName,CKSTRING FlagsData)

Registers a new parameter type of Flags Type

Parameters

Input argument FlagsGuid | CKGUID that will identify the newly created Parameter Type
Input argument FlagsName | Name of the new parameter type
Input argument FlagsData | A string containing the list of element for these m_Flags (eg. “ClipLeft=1,ClipTop=2,ClipRight=4,ClipBottom=8....” )

Returns

Value | Meaning
CK_OK | if successful,CKERR_INVALIDPARAMETER if FlagsData or FlagsName are NULL,
CKERR_INVALIDGUID | if the provided GUID is already in use.

Remarks

Use this function to register a new parameter type that will describes m_Flags. The parameter type is derived from CKPGUID_INT, so every operation available on an integer parameter will also be able on the new parameter type.

See Also

CKParameterManager,RegisterNewStructure,RegisterNewEnum,ChangeFlagsDeclaration


CKParameterManager::RegisterNewStructure

Method CKParameterManager::RegisterNewStructure

CKERROR CKParameterManager::RegisterNewStructure(CKGUIDCONSTREF StructGuid,CKSTRING StructName,CKSTRING StructData,...)
CKERROR CKParameterManager::RegisterNewStructure(CKGUIDCONSTREF StructGuid,CKSTRING StructName,CKSTRING StructData,XArray<CKGUID>& ListGuid)

Registers a new parameter type of Structure Type

Parameters

StructGuid | CKGUID that will identify the newly created Parameter Type
StructName | Name of the new parameter type
StructData | A string containing the list of element names (eg. “position,enemy,velocity curve” ) ...: The list of parameter types to use for this structure.

Returns

Value | Meaning
CK_OK | if successful
CKERR_INVALIDPARAMETER | if StructData or StructName are NULL,
CKERR_INVALIDGUID | if the provided GUID is already in use.

Remarks

Use this function to register a new parameter type that will describes a structure. Parameters that will be created using this type will contain a array of CK_ID, each element of this array is the ID of a CKParameterOut of the type precised when the parameter type was declared.

A structure defined in C like this:

typedef struct MyStructure {
    float         Priority;
    VxVector      Position;
    CK_ID         ObstacleId;
} MyStructure;

is equivalent to declare

#define  CKPGUID_MYSTRUCT CKGUID(0x4a893652,0x76e72d5c)
ParameterManager->RegisterNewStructure(CKPGUID_MYSTRUCT,"MyStructure","Priority,Position,Obstacle",CKPGUID_FLOAT,CKPGUID_VECTOR,CKPGUID_3DENTITY);

To retrieve information about a previously registered structure or to acces to members of a structure use the CKStructHelper class.

See Also

CKStructHelper,CKParameterManager,RegisterNewEnum


CKParameterManager::ChangeParametersGuid

Method CKParameterManager::ChangeParametersGuid

CKERROR CKParameterManager::ChangeParametersGuid(CKGUIDCONSTREF iOldGuid,CKGUIDCONSTREF iNewGuid)


CKParameterManager::GetEnumBuildString

Method CKParameterManager::GetEnumBuildString

CKERROR CKParameterManager::GetEnumBuildString(CKParameterType pType,XString& oBuildString)

returns the build string of an Enum Type

Parameters

Input argument pType | CKGUID that will identify the m_Flags Parameter Type to change
Input argument oBuildString | the output string

Returns

CK_OK if successful,CKERR_INVALIDPARAMETER otherwise

See Also

CKParameterManager,RegisterNewStructure,RegisterNewEnum


CKParameterManager::GetFlagBuildString

Method CKParameterManager::GetFlagBuildString

CKERROR CKParameterManager::GetFlagBuildString(CKParameterType pType,XString& oBuildString)

returns the build string of an flag Type

Parameters

Input argument pType | CKGUID that will identify the m_Flags Parameter Type to change
Input argument oBuildString | the output string

Returns

CK_OK if successful,CKERR_INVALIDPARAMETER otherwise

See Also

CKParameterManager,RegisterNewStructure,RegisterNewflag


CKParameterManager::RegisterOperationFunction

Method CKParameterManager::RegisterOperationFunction

CKERROR CKParameterManager::RegisterOperationFunction(CKGUID opguid,CKGUID type_paramres,CKGUID type_param1,CKGUID type_param2,CK_PARAMETEROPERATION op)
#else
CKERROR CKParameterManager::RegisterOperationFunction(CKGUIDREF opguid,
CKGUIDREF type_paramres,
CKGUIDREF type_param1,
CKGUIDREF type_param2,
CK_PARAMETEROPERATION op)

#endif


CKTimeManager

Class CKTimeManager

Story and execution time management

CKBaseManager
Show brief derivation trees

CKTimeManager

CKBaseManager
Show full derivation trees

CKTimeManager

Remarks

The Time manager stores and updates time for the story but also real time.

Each frame the time manager computes the time elapsed since last process loop. This time is then multiplied by the scale factor and clamped to a minimum and maximum value to avoid extreme values which could produces jump in the playback if its time dependant. This delta value is added to the current time to compute the absolute time elapsed since the playback started.

The time as it appears to behaviors can be multiplied by a scale factor and also be clamped to minimum and maximum values.

The CKContext::Pause,Reset,Play automatically call the appropriate functions in CKTimeManager to pause and restart the timers.

Since the time taken to render a scene and execute the scripts can greatly vary from one frame to another, it is recommended to perform time dependant actions rather the frame dependant.

The unique instance of the time manager can be retrieved through the CKContext::GetTimeManager method

Groups

Processing | Time Scaling | Time clamping | Behavioral and frame rate limits | Runtime

Processing
Method GetAbsoluteTime | Returns time elapsed since last call to CKContext::Reset() in milliseconds.
Method GetLastDeltaTime | Returns time elapsed since last frame in milliseconds.
Method GetLastDeltaTimeFree | Returns real time elapsed since last frame in milliseconds.
Method GetMainTickCount | Returns the number of process loop (call to CKContext::Process()) since startup.
Method GetTime | Returns time elapsed since startup in milliseconds.
Method SetLastDeltaTime | Set the DeltaTime for custom use.
Time Scaling
Method GetTimeScaleFactor | Gets the time scaling factor.
Method SetTimeScaleFactor | Sets the time scaling factor.
Time clamping
Method GetMaximumDeltaTime | Gets the maximum delta time.
Method GetMinimumDeltaTime | Gets the minimum delta time.
Method SetMaximumDeltaTime | Sets the maximum delta time.
Method SetMinimumDeltaTime | Sets the minimum delta time.
Behavioral and frame rate limits
Method ChangeLimitOptions | Changes the rendering and behavioral frame rate limits.
Method GetBehavioralRateLimit | Gets the behavioral rate limit
Method GetFrameRateLimit | Gets the frame rate limit
Method GetLimitOptions | Gets the rendering and behavioral frame rate limits.
Method SetBehavioralRateLimit | Sets the behavioral rate limit
Method SetFrameRateLimit | Sets the frame rate limit
Runtime
Method GetTimeToWaitForLimits | Returns the time to wait to respect the time manager limits.

See Also

Time Management,Creating a Standalone Application,CKContext::GetTimeManager


CKTimeManager::GetAbsoluteTime

Method CKTimeManager::GetAbsoluteTime

float CKTimeManager::GetAbsoluteTime()

Returns time elapsed since last call to CKContext::Reset() in milliseconds.

Remarks

The returned time takes scale factors,minimum and maximum values into account.

See Also

GetTime,GetLastDeltaTime,SetLastDeltaTime,SetMinimumDeltaTime,SetMaximumDeltaTime,SetTimeScaleFactor


CKTimeManager::GetLastDeltaTime

Method CKTimeManager::GetLastDeltaTime

float CKTimeManager::GetLastDeltaTime()

Returns time elapsed since last frame in milliseconds.

Remarks

The returned time takes scale factors,minimum and maximum values into account.

See Also

GetTime,GetLastDeltaTime,SetMinimumDeltaTime,SetMaximumDeltaTime,SetTimeScaleFactor


CKTimeManager::GetLastDeltaTimeFree

Method CKTimeManager::GetLastDeltaTimeFree

float CKTimeManager::GetLastDeltaTimeFree()

Returns real time elapsed since last frame in milliseconds.

Remarks

The returned time does NOT takes scale factors,minimum and maximum values into account. The behaviors should not use this function but rather GetLastDeltaTime which takes scale factor into account. Use only this function to be relative to the “real” time. For example if between two frames an action takes a very long time, the GetLastDeltaTime() method will return the maximum allowed delta time (GetMaximumDeltaTime) while this method will return the exact time elapsed.

See Also

GetTime,GetLastDeltaTime,SetLastDeltaTime,SetMinimumDeltaTime,SetMaximumDeltaTime,SetTimeScaleFactor


CKTimeManager::GetMainTickCount

Method CKTimeManager::GetMainTickCount

CKDWORD CKTimeManager::GetMainTickCount()

Returns the number of process loop (call to CKContext::Process()) since startup.

See Also

GetTime,GetAbsoluteTime,GetLastDeltaTime,SetLastDeltaTime


CKTimeManager::GetTime

Method CKTimeManager::GetTime

float CKTimeManager::GetTime()

Returns time elapsed since startup in milliseconds.

Remarks

Use a high-precision timer to return the time elapsed since creation of this context. The returned time does NOT take scale factors,minimum and maximum values into account. The behaviors should not use this function but rather GetAbsoluteTime which takes scale factor into account. Use only this function to be relative to the “real” time.

See Also

GetAbsoluteTime,GetLastDeltaTime,SetLastDeltaTime


CKTimeManager::SetLastDeltaTime

Method CKTimeManager::SetLastDeltaTime

void CKTimeManager::SetLastDeltaTime(float DtSet)

Set the DeltaTime for custom use.

Remarks

+This is usefull for special purposes.

See Also

GetTime,GetLastDeltaTime,SetLastDeltaTime,SetMinimumDeltaTime,SetMaximumDeltaTime,SetTimeScaleFactor


CKTimeManager::GetTimeScaleFactor

Method CKTimeManager::GetTimeScaleFactor

float CKTimeManager::GetTimeScaleFactor()

Gets the time scaling factor.

Returns

Current scale factor by which real time value is multiplied.

Remarks

All time dependant operations in behaviors use the time manager methods, with a scale factor you can simulate a slower of faster time flow.

See Also

GetTime,GetLastDeltaTime,SetLastDeltaTime,SetMinimumDeltaTime,SetMaximumDeltaTime,SetTimeScaleFactor


CKTimeManager::SetTimeScaleFactor

Method CKTimeManager::SetTimeScaleFactor

void CKTimeManager::SetTimeScaleFactor(float mulfactor)

Sets the time scaling factor.

Parameters

Input argument mulfactor

A scale factor by which real time value will be multiplied.

Remarks

All time dependant operations in behaviors use the time manager methods, with a scale factor you can simulate a slower of faster time flow.

See Also

GetTime,GetLastDeltaTime,SetLastDeltaTime,SetMinimumDeltaTime,SetMaximumDeltaTime,GetTimeScaleFactor


CKTimeManager::GetMaximumDeltaTime

Method CKTimeManager::GetMaximumDeltaTime

float CKTimeManager::GetMaximumDeltaTime()

Gets the maximum delta time.

Remarks

Each frame the time manager computes the time elapsed since last process loop. This time is then multiplied by the scale factor. This time are also be clamped to a minimum and maximum value to avoid extreme values. Default maximum delta time = 200 millisecond.

See Also

GetMinimumDeltaTime,SetMaximumDeltaTime


CKTimeManager::GetMinimumDeltaTime

Method CKTimeManager::GetMinimumDeltaTime

float CKTimeManager::GetMinimumDeltaTime()

Gets the minimum delta time.

Remarks

Each frame the time manager computes the time elapsed since last process loop. This time is then multiplied by the scale factor. This time are also be clamped to a minimum and maximum value to avoid extreme values. Default minimum delta time = 1 millisecond.

See Also

SetMinimumDeltaTime,GetMaximumDeltaTime


CKTimeManager::SetMaximumDeltaTime

Method CKTimeManager::SetMaximumDeltaTime

void CKTimeManager::SetMaximumDeltaTime(float DtMax)

Sets the maximum delta time.

Parameters

Input argument DtMax

Maximum value for the delta time in milliseconds.

Remarks

Each frame the time manager computes the time elapsed since last process loop. This time is then multiplied by the scale factor. This time are also be clamped to a minimum and maximum value to avoid extreme values. Default maximum delta time = 200 millisecond.

See Also

SetMinimumDeltaTime,GetMaximumDeltaTime


CKTimeManager::SetMinimumDeltaTime

Method CKTimeManager::SetMinimumDeltaTime

void CKTimeManager::SetMinimumDeltaTime(float DtMin)

Sets the minimum delta time.

Parameters

DtMax: Minimum value for the delta time in milliseconds.

Remarks

Each frame the time manager computes the time elapsed since last process loop. This time is then multiplied by the scale factor. This time are also be clamped to a minimum and maximum value to avoid extreme values. Default minimum delta time = 1 millisecond.

See Also

SetMaximumDeltaTime,GetMinimumDeltaTime


CKTimeManager::ChangeLimitOptions

Method CKTimeManager::ChangeLimitOptions

void CKTimeManager::ChangeLimitOptions(CK_FRAMERATE_LIMITS FpsOptions,CK_FRAMERATE_LIMITS BehOptions=CK_RATE_NOP)

Changes the rendering and behavioral frame rate limits.

Parameters

Input argument FpsOptions | CK_FRAMERATE_SYNC to synchronize to screen refresh rate (Render function will wait for vertical blank signal),CK_FRAMERATE_FREE to render at the maximum possible rate or CK_FRAMERATE_LIMIT to set a maximum frame rate.
Input argument BehOptions | CK_BEHRATE_SYNC to synchronise the process loop with rendering (a behavioral processing is done before each rendering) or CK_BEHRATE_LIMIT to set a maximum behavioral rate.

Remarks

If the frame or behavioral rate is limited, the limits can be set by the SetFrameRateLimit or SetBehavioralRateLimit methods.

See Also

CK_FRAMERATE_LIMITS,SetBehavioralRateLimit,SetFrameRateLimit,GetLimitOptions


CKTimeManager::GetBehavioralRateLimit

Method CKTimeManager::GetBehavioralRateLimit

float CKTimeManager::GetBehavioralRateLimit()

Gets the behavioral rate limit

Returns

Maximum process loops per second.

Remarks

This value is only used when the behavioral rate is limited (GetLimitOptions() & CK_BEHRATE_LIMIT)

See Also

SetBehavioralRateLimit,GetLimitOptions,ChangeLimitOptions


CKTimeManager::GetFrameRateLimit

Method CKTimeManager::GetFrameRateLimit

float CKTimeManager::GetFrameRateLimit()

Gets the frame rate limit

Returns

Maximum render loops per second.

Remarks

This value is only used when the frame rate is limited (GetLimitOptions() & CK_FRAMERATE_LIMIT)

See Also

SetFrameRateLimit,GetLimitOptions,ChangeLimitOptions


CKTimeManager::GetLimitOptions

Method CKTimeManager::GetLimitOptions

CKDWORD CKTimeManager::GetLimitOptions()

Gets the rendering and behavioral frame rate limits.

Remarks

Returns a combination of CK_FRAMERATE_LIMITS flags specifying the behavioral and frame rate limits.

See Also

CK_FRAMERATE_LIMITS,ChangeLimitOptions


CKTimeManager::SetBehavioralRateLimit

Method CKTimeManager::SetBehavioralRateLimit

void CKTimeManager::SetBehavioralRateLimit(float BRLimit)

Sets the behavioral rate limit

Parameters

Input argument BRLimit

Maximum process loops per second.

Remarks

This value is only used when the behavioral rate is limited (GetLimitOptions() & CK_BEHRATE_LIMIT)

See Also

GetBehavioralRateLimit,GetLimitOptions,ChangeLimitOptions


CKTimeManager::SetFrameRateLimit

Method CKTimeManager::SetFrameRateLimit

void CKTimeManager::SetFrameRateLimit(float FRLimit)

Sets the frame rate limit

Parameters

Input argument FRLimit

Maximum render loops per second.

Remarks

This value is only used when the frame rate is limited (GetLimitOptions() & CK_FRAMERATE_LIMIT)

See Also

GetFrameRateLimit,GetLimitOptions,ChangeLimitOptions


CKTimeManager::GetTimeToWaitForLimits

Method CKTimeManager::GetTimeToWaitForLimits

void CKTimeManager::GetTimeToWaitForLimits(float& TimeBeforeRender,float& TimeBeforeBeh)
void CKTimeManager::ResetChronos(CKBOOL RenderChrono,CKBOOL BehavioralChrono)

Returns the time to wait to respect the time manager limits.

Parameters

Input argument TimeBeforeRender | Time in milliseconds to wait before performing a rendering.
Input argument TimeBeforeBeh | Time in milliseconds to wait before performing a process loop.

Remarks

This method returns the time to wait in milliseconds to perfom a rendering or a process loop so that the time manager limits are respected. If the rendering or the behavioral process are not limited to given frame rate the method returns 0 values.

Example

This is a standard loop that takes potential frame rate limitats
into account

   CKTimeManager* TheTimeManager = TheContext->GetTimeManager();
   while(1) {
           float TimeBeforeRender=0,TimeBeforeBeh=0;

Ask the time manager the time to wait before
doing a render and a process
if the time is positive we keep on looping
without doing anything
           TheTimeManager->GetTimeToWaitForLimits(TimeBeforeRender,TimeBeforeBeh);

           BOOL DoBehaviors    = (TimeBeforeBeh <=0);
           BOOL DoRender       = (TimeBeforeRender  <=0);

If a rendering or a behavioral process is done
we restart the chronos for the next iteration
           TheTimeManager->ResetChronos(DoRender,DoBehaviors);

           if (DoBehaviors)    TheCKContext->Process();
           if (DoRender)       TheRenderContext->Render();
   }

See Also

Creating a Standalone Application


Parameters

Parameter related classes

Class CKParameter | Base class for output and local parameter
Class CKParameterIn | Input parameters
Class CKParameterLocal | Local parameter providing a value
Class CKParameterOperation | Performing operations on parameters
Class CKParameterOut | Output parameter providing a value
Class CKStructHelper | Helper class to access a parameter of type structure.

See Also

Behavior Engine


CKParameter

CKParameterLocal

CKParameterVariable

CKParameterOut

CKObject
Show full derivation trees

CKParameter

Subclasses

CKParameterFS, CKParameterLocal, and CKParameterOut

Remarks

The type of the parameter defines the type of the data provided. These types are maintained by the parameter manager. It defines the size of the buffer to use, and also decides what can be plugged onto the output parameter. To have the list and definition of predefined parameter types see CKParameterManager.

The class id of CKParameter is CKCID_PARAMETER.

Groups

Operations
Virtual Method Method CheckClass | Virtual added for Fixed Size parameter support
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Owner
Method GetOwner | Gets the owner of the output parameter
Virtual Method Method SetOwner | Sets the owner of the output parameter
Parameter Type
Method GetGUID | Gets the GUID of the parameter type.
Method GetParameterClassID | Gets the Class ID of the parameter type.
Method GetType | Gets the parameter type
Method IsCompatibleWith | Checks whether given parameter is compatible with current parameter type.
Method SetType | Changes the parameter type
Value
Virtual Method Method CopyValue | Copies the content of a parameter to this parameter.
Method GetDataSize | Gets the size of the data stored by the parameter.
Virtual Method Method GetReadDataPtr | Returns a pointer to the data.
Virtual Method Method GetStringValue | Gets the string representation of the parameter value.
Virtual Method Method GetValue | Gets the value of the parameter.
Virtual Method Method GetWriteDataPtr | Returns a pointer to the data.
Virtual Method Method SetStringValue | Sets the value of the parameter using a string.
Virtual Method Method SetValue | Sets the value of the parameter.

See Also

CKBehavior, CKParameterIn, CKParameterOperation


CKParameter::CheckClass

Virtual Method Method CKParameter::CheckClass

virtual void CKParameter::CheckClass(CKParameterTypeDesc* iType)

Remarks

Virtual added for Fixed Size parameter support


CKParameter::GetOwner

Method CKParameter::GetOwner

CKObject *CKParameter::GetOwner()

Gets the owner of the output parameter

Returns

CKObject pointer of the owner of the parameter.

Remarks

The owner if automatically set by the framework in most of the cases. The owner of a parameter can be:

a behavior (output and local parameters) a parameter operation (output parameters) a behavioral object (Attributes) a data array (CKDataArray)

See Also

CKBehavior, CKBeObject,CKDataArray,SetOwner


CKParameter::SetOwner

Virtual Method Method CKParameter::SetOwner

void CKParameter::SetOwner(CKObject *o)

Sets the owner of the output parameter

Parameters

Input argument o

A CKObject pointer to be set as owner of the parameter.

Remarks

The owner if automatically set by the framework in most of the cases. The owner of a parameter can be:

a behavior (output and local parameters) a parameter operation (output parameters) a behavioral object (Attributes) a data array (CKDataArray)

See Also

CKBehavior, CKBeObject,CKDataArray,GetOwner


CKParameter::GetGUID

Method CKParameter::GetGUID

CKGUID CKParameter::GetGUID()

Gets the GUID of the parameter type.

Returns

GUID of the parameter type.

Remarks

Each parameter has a type, which determines the size of the data, the conversion functions, etc... The parameters types are maintained by the parameter manager. They are refered to by index (CKParameterType) or by GUID.

See Also

Pre-Registred Parameter Types,GetType,SetGUID,IsCompatibleWith


CKParameter::GetParameterClassID

Method CKParameter::GetParameterClassID

CK_CLASSID CKParameter::GetParameterClassID()

Gets the Class ID of the parameter type.

Returns

Class ID of the parameter type.

Remarks

Some specific type of parameters contain a CK_ID of CKObject or derived classes. This method returns 0 if it's not the case otherwise the return value is the CK_CLASSID associated with the parameter type.

See Also

Pre-Registred Parameter Types,CKParameterManager


CKParameter::GetType

Method CKParameter::GetType

CKParameterType CKParameter::GetType()

Gets the parameter type

Returns

Parameter type.

Remarks

Each parameter has a type, which determines the size of the data, the conversion functions, etc... The parameters types are maintained by the parameter manager. They are refered to by index (CKParameterType) for faster access or by GUID.

See Also

Pre-Registred Parameter Types,GetGUID,SetType,IsCompatibleWith


CKParameter::IsCompatibleWith

Method CKParameter::IsCompatibleWith

CKBOOL CKParameter::IsCompatibleWith(CKParameter* param)

Checks whether given parameter is compatible with current parameter type.

Parameters

Input argument param

A CKParameter Pointer.

Returns

Value | Meaning
TRUE | if the given parameter type is compatible with current parameter type,
FALSE | otherwise.

Remarks

Each parameter has a type, which determines the size of the data, the conversion functions, etc... The parameters types are maintained by the parameter manager. Two parameters are compatible if their types derive one from another. From example a percentage parameter type (CKPGUID_PERCENTAGE) derives from the float parameter type (CKPGUID_FLOAT) and are compatible (they store their value the same way). Only compatible parameters can be destination of a given parameter.

See Also

Pre-Registred Parameter Types,GetType,SetType


CKParameter::SetType

Method CKParameter::SetType

void CKParameter::SetType(CKParameterType type)
void CKParameter::SetGUID(CKGUID guid)

Changes the parameter type

Parameters

Input argument type

New parameter type for this parameter.

Remarks

Warning ! Changing the type of a parameter does not destroy its links to incompatible destinations. Changing the type of a parameter without checking its links to other parameters may cause unpredictable results.

See Also

Pre-Registred Parameter Types,GetType,SetGUID,IsCompatibleWith


CKParameter::CopyValue

Virtual Method Method CKParameter::CopyValue

CKERROR CKParameter::CopyValue(CKParameter *SourceParam,CKBOOL UpdateParam)

Copies the content of a parameter to this parameter.

Parameters

Input argument SourceParam | A pointer to a CKParameter to copy the value of.
Input argument UpdateParam | In the case of an output parameter of a parameter operation, TRUE if the operation should be evaluated before copying the value.

Returns

Value | Meaning
CK_OK | if successful
CKERR_INVALIDPARAMETERTYPE | if parameter types are incompatible

Remarks

This function checks the types of the source and destination parameters before copying the content. It also ensures to call the correct copy function according to the parameter type.

See Also

SetValue,GetValue


CKParameter::GetDataSize

Method CKParameter::GetDataSize

int CKParameter::GetDataSize()

Gets the size of the data stored by the parameter.

Returns

Size in bytes of the data stored.

Remarks

This returned size depends on the parameter type. Most parameter types used a predefined and fixed size to store their value, but certain types can have a variable size (string,buffer).

See Also

Pre-Registred Parameter Types ,GetValue, SetValue,GetReadDataPtr


CKParameter::GetReadDataPtr

Virtual Method Method CKParameter::GetReadDataPtr

void *CKParameter::GetReadDataPtr(CKBOOL update)

Returns a pointer to the data.

Returns

A pointer to the storage buffer

Remarks

These methods give access to the data of the parameter by pointer. You should be cautious when you use these methods, especially you should call CKParameterOut::DataChanged if you have modified the data in order to propagate the modification down the destination chain when using a CKParameterOut. The GetValue method copies the content of the parameter buffer inside a user allocated buffer so it is fastest to use this method when accessing large parameters such as strings or buffer. GetDataSize returns the size in bytes of the returned buffer.

Reads the value of string parameter char* StringValue = (char *) StringParam->GetReadDataPtr();

See Also

Pre-Registred Parameter Types ,GetValue, GetWriteDataPtr,SetValue,GetDataSize


CKParameter::GetStringValue

Virtual Method Method CKParameter::GetStringValue

int CKParameter::GetStringValue(CKSTRING stringValue, CKBOOL update)

Gets the string representation of the parameter value.

Parameters

Input argument stringValue | CKSTRING to store Destination string.
Input argument update | In the case of an output parameter of a parameter operation, TRUE if the operation should be evaluated before copying the value.

Returns

The size of the needed buffer for the string.

Remarks

+If the given string is NULL, the method returns the number of bytes to allocate for the string.

See Also

SetStringValue


CKParameter::GetValue

Virtual Method Method CKParameter::GetValue

CKObject* CKParameter::GetValueObject(CKBOOL update)
CKERROR CKParameter::GetValue(void *buf,CKBOOL update)

Gets the value of the parameter.

Parameters

Input argument buf

A pointer to a buffer where the value is to be copied.

Remarks

DO NOT USE SetValue() and GetValue() to copy from one parameter to another if you are not sure of the type of parameter you are copying instead use CopyValue. GetValue copies the content of the parameter buffer to buf, it can be more convenient to use GetReadDataPtr to access variable size parameter like string or buffers.

Gets the value of a CKObject parameter (CKPGUID_OBJECT) CK_ID ObjectID; CKObject* Object; ObjectParam->GetValue(&ObjectID); Object= CKContext->GetObject(ObjectID);

you can now directly use Object = ObjectParam->GetValueObject();

Gets the value of a integer parameter (CKPGUID_INT) int iValue; ObjectParam->GetValue(&iValue);

Gets the value of a float parameter (CKPGUID_FLOAT) float fValue; ObjectParam->GetValue(&fValue); //or fValue = *(float *)ObjectParam->GetReadDataPtr();

See Also

Pre-Registred Parameter Types,SetValue,GetDataSize, GetWriteDataPtr, CopyValue


CKParameter::GetWriteDataPtr

Virtual Method Method CKParameter::GetWriteDataPtr

void *CKParameter::GetWriteDataPtr()

Returns a pointer to the data.

Returns

A pointer to the storage buffer

Remarks

These methods give access to the data of the parameter by pointer. You should be cautious when you use these methods, especially you should call CKParameterOut::DataChanged if you have modified the data in order to propagate the modification down the destination chain when using a CKParameterOut. The GetValue method copies the content of the parameter buffer inside a user allocated buffer so it is fastest to use this method when accessing large parameters such as strings or buffer. GetDataSize returns the size in bytes of the returned buffer. The GetWriteDataPtr and GetReadDataPtr but should be used accordingly to the intent (reading or writing) in case this hint could be used by the engine.

Reads the value of string parameter char* StringValue = (char *) StringParam->GetReadDataPtr();

See Also

Pre-Registred Parameter Types ,GetValue, SetValue,GetReadDataPtr,GetDataSize


CKParameter::SetStringValue

Virtual Method Method CKParameter::SetStringValue

CKERROR CKParameter::SetStringValue(CKSTRING stringValue)

Sets the value of the parameter using a string.

Returns

CK_OK if successful,an error code otherwise.

Remarks

Most parameter types know how to convert their data to and from a string. SetStringValue converts the given string into a data and changes the data. Propagates the changes down the destination chain is the parameter is a CKParameterOut.

See Also

GetStringValue


CKParameter::SetValue

Virtual Method Method CKParameter::SetValue

CKERROR CKParameter::SetValue( const void *buf,int size)

Sets the value of the parameter.

Parameters

Input argument buf | A pointer to value to be set
Input argument size | Integer specifying the size of the value or 0 to use the default size of the parameter.

Returns

CK_OK if successful, error code otherwise.

Remarks

For variable size parameter the size must be given. This copies the given data into the data of the parameter. In the case of a CKParameterOut, it automatically propagates the modifications down the destinations chain, so the call to DataChanged is not needed. DO NOT USE SetValue() and GetValue() to copy from one parameter to another if you are not sure of the type of parameter you are copying instead use CopyValue.

Sets the value of a string parameter (CKPGUID_STRING) char string[] = “My value”; StringParam->SetValue(string,strlen(string)+1);

Sets the value of a CKObject parameter (CKPGUID_OBJECT) CK_ID ObjectID = CKOBJID(MyObject); ObjectParam->SetValue(&ObjectID);

Sets the value of a integer parameter (CKPGUID_INT) int iValue = 15; ObjectParam->SetValue(&iValue);

Sets the value of a float parameter (CKPGUID_FLOAT) float fValue = 15; ObjectParam->SetValue(&fValue);

See Also

Pre-Registred Parameter Types,GetValue,GetDataSize, GetWriteDataPtr, CopyValue


CKParameterIn

Class CKParameterIn

Input parameters

CKObject
Show brief derivation trees

CKParameterIn

CKObject
Show full derivation trees

CKParameterIn

Remarks

Input parameters allow behaviors to receive values from other behaviors or operations. They have a type defining the type a data they expect.

Data is retrieved from an input parameter using the GetReadDataPtr or GetValue methods.

An input parameter never owns its data, it always gets it from another parameter, whether in, out or local (which is a subset of out parameters). So data really is retrieved from the first output parameter found in the chain of input parameters, named thus the Real Source. This real source of data may be accessed through the GetRealSource method.

The input paramter may be plugged directly into an output parameter from which it will get its data. This parameter is thus called a DirectSource. This souce can be set using the SetDirectSource method and accessed using GetDirectSource method.

It may also be plugged into another input parameter coming from the enclosing behavior. This input parameter from the enclosing behavior may be shared by many parameters from inside the behavior. The method to use to plug the input parameter to such a shared input is ShareSourceWith.

The input parameter can only be plugged into a parameter of a compatible type.

A CKParameterIn is created with CKBehavior::CreateInputParameter or CKBehavior::InsertInputParameter.You can also use CKContext::CreateParameterIn though this is probably rare.

The class id of CKParameterIn is CKCID_PARAMETERIN.

Groups

Operations
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetDirectSource | Returns the direct source of the input parameter.
Method GetGUID | Returns the GUID of the input parameter type.
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method GetOwner | Gets the owner of the CKParameterIn.
Method GetReadDataPtr | Retrieves a pointer to the buffer that contain the value.
Method GetRealSource | Returns the real source of data of the input parameter
Method GetSharedSource | returns the shared source of the input parameter.
Method GetType | Returns the type of the input parameter
Method GetValue | Copies the input parameter's value into the given buffer
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Method SetDirectSource | Sets the new direct source for the input parameter.
Method SetOwner | Sets the owner of the CKParameterIn.
Method SetType | Sets the type of the input parameter.
Method ShareSourceWith | Shares the CKParameterIn with another one.

See Also

CKBehavior, CKParameterOut, CKParameterOperation


CKParameterIn::GetDirectSource

Method CKParameterIn::GetDirectSource

CKParameter* CKParameterIn::GetDirectSource()

Returns the direct source of the input parameter.

Returns

A pointer to the CKParameter that stores the data for this input parameter or NULL if has no direct source.

Remarks

If the input parameter is plugged into an output parameter, from which it will get its data, this output parameter is called the direct source. An input parameter must have either a direct source or a shared source, it cannot have both.

See Also

GetRealSource,SetDirectSource,ShareSourceWith


CKParameterIn::GetGUID

Method CKParameterIn::GetGUID

CKGUID CKParameterIn::GetGUID()

Returns the GUID of the input parameter type.

Returns

Returns the GUID of the type of the input parameter.

See Also

CKParameterIn::GetType,CKParameterManager


CKParameterIn::GetOwner

Method CKParameterIn::GetOwner

CKObject *CKParameterIn::GetOwner()

Gets the owner of the CKParameterIn.

Returns

A pointer to the CKObject that owns this input parameter usually a CKBehavior or a CKParameterOperation

Remarks

The owner of the parameter is the object with wich the parameter will be saved. Typically, the owner is a parameter operation of a behavior to which it is an input ( or the internal behavior if the parameter is exported).

See Also

CKParameterIn::SetOwner


CKParameterIn::GetReadDataPtr

Method CKParameterIn::GetReadDataPtr

void *CKParameterIn::GetReadDataPtr()

Retrieves a pointer to the buffer that contain the value.

Returns

A pointer to the data.

Remarks

+The real pointer to the value is returned. +This pointer must not be destroyed. +Using this method can faster than GetValue especially for big parameters where a memcpy could be avoided.

See Also

GetValue, GetLastUpdate


CKParameterIn::GetRealSource

Method CKParameterIn::GetRealSource

CKParameter* CKParameterIn::GetRealSource()

Returns the real source of data of the input parameter

Returns

A pointer to the CKParameter that stores the data for this input parameter.

Remarks

+If the input parameter gets its value from a shared source, the shared source being an input parameter, it itself gets its value from another source. By walking up the source chain, the real source is the first parameter that is not an input parameter. This is what GetRealSource does. It returns the real source from which the input gets its value. This real source is of course an output parameter.

+If the input parameter has a direct source, the real source is the direct source.

See Also

ShareSourceWith


CKParameterIn::GetSharedSource

Method CKParameterIn::GetSharedSource

CKParameterIn* CKParameterIn::GetSharedSource()

returns the shared source of the input parameter.

Returns

A pointer of the shared CKParameterIn if any, NULL otherwise.

See Also

ShareSourceWith, GetRealSource


CKParameterIn::GetType

Method CKParameterIn::GetType

CKParameterType CKParameterIn::GetType()

Returns the type of the input parameter

Returns

Returns the index of the type of the input parameter. These types are maintained by the parameter manager.

See Also

CKParameterIn::GetGUID,CKParameterManager


CKParameterIn::GetValue

Method CKParameterIn::GetValue

CKERROR CKParameterIn::GetValue(void *buf)

Copies the input parameter's value into the given buffer

Returns

CK_OK if success

Remarks

+Retrieves the value of the input parameter and copies it into the given buffer. +The buffer must have been allocated to the correct size +The value is retrieved using the usual system: if data has been modified since the last time it was fetched, the chain of inputs is walked up until an output parameter is found

See Also

GetReadDataPtr, GetLastUpdate


CKParameterIn::SetDirectSource

Method CKParameterIn::SetDirectSource

CKERROR CKParameterIn::SetDirectSource(CKParameter* param)

Sets the new direct source for the input parameter.

Parameters

Input argument param

A pointer to the CKParameterOut (Local) that will give the value.

Returns

CK_OK if successful, an error code otherwise

Remarks

If the input parameter is plugged into an output parameter, from which it will get its data, this output parameter is called the direct source. An input parameter must have either a direct source or a shared source, it cannot have both.

See Also

ShareSourceWith


CKParameterIn::SetOwner

Method CKParameterIn::SetOwner

void CKParameterIn::SetOwner(CKObject *o)

Sets the owner of the CKParameterIn.

Remarks

You normally shouldn't change the owner of a CKParameterIn this function being automatically by the framework.

See Also

CKParameterIn::GetOwner


CKParameterIn::SetType

Method CKParameterIn::SetType

void CKParameterIn::SetType(CKParameterType type,CKBOOL UpdateSource,CKSTRING NewName)
void CKParameterIn::SetGUID(CKGUID guid,CKBOOL UpdateSource,CKSTRING NewName)

Sets the type of the input parameter.

Parameters

type | UpateSource: Should the linked parameter be changed too?
NewName | new name of the CKParameterIn.

Remarks

This method is really useful when used inside behavior with settings that can make the type of an input parameter change. You can directly change the value of the source parameter by setting UpateSource to TRUE

See Also

SetGUID,CKParameterOut::SetType,CKParameterManager


CKParameterIn::ShareSourceWith

Method CKParameterIn::ShareSourceWith

CKERROR CKParameterIn::ShareSourceWith(CKParameterIn *param)

Shares the CKParameterIn with another one.

Parameters

Input argument param

CKParameterIn to share with

Returns

CK_OK if successful, CKERR_INCOMPATIBLEPARAMETERS if parameters are incompatibles

Remarks

The input parameter may get its value from another input parameter if the later is part of the enclosing behavior. This source may be also used by other input parameters, which is the reason for its name.

There are thus two ways for an input parameter to get its value from a data source existing outside its enclosing behavior: creating an input parameter of the enclosing behavior and sharing it with many input parameters of the enclosing behavior's graph of sub-behaviors, or exporting the input parameter of a sub-behavior. Whether or not sharing is needed should decide wich solution to use.

The shared source being an input parameter, it itself gets its value from another source. By walking up the source chain, the real source is the first parameter that is not an input parameter. The real source can be accessed using the GetRealSource method.

The shared source must have the same type of parameter than the target parameter. The target input parameter cannot have both a direct source and a shared source.

See Also

GetSharedSource, GetRealSource


CKParameterLocal

Class CKParameterLocal

Local parameter providing a value

CKObject

CKParameter
Show brief derivation trees

CKParameterLocal

CKParameterVariable

CKObject

CKParameter
Show full derivation trees

CKParameterLocal

Subclasses

CKParameterLocalFS, and CKParameterVariable

Remarks

A CKParameterLocal derives directly from CKParameterOut and differs only by its class ID, it provides no additional methods.

A CKParameterLocal is created with CKBehavior::CreateLocalParameter or CKContext::CreateParameterLocal.

The class id of CKParameterLocal is CKCID_PARAMETERLOCAL.

Groups

Operations
Method CheckClass | Virtual added for Fixed Size parameter support
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Owner
Method GetOwner | Gets the owner of the output parameter
Virtual Method Method SetOwner | Sets the owner of the output parameter
Value
Virtual Method Method CopyValue | Copies the content of a parameter to this parameter.
Method GetDataSize | Gets the size of the data stored by the parameter.
Virtual Method Method GetReadDataPtr | Returns a pointer to the data.
Virtual Method Method GetStringValue | Gets the string representation of the parameter value.
Virtual Method Method GetValue | Gets the value of the parameter.
Virtual Method Method GetWriteDataPtr | Returns a pointer to the data.
Virtual Method Method SetStringValue | Sets the value of the parameter using a string.
Virtual Method Method SetValue | Sets the value of the parameter.

See Also

CKParameterOut


CKParameterLocal::CheckClass

Method CKParameterLocal::CheckClass

void CKParameterLocal::CheckClass(CKParameterTypeDesc* iType)

Remarks

Virtual added for Fixed Size parameter support


CKParameterLocal::SetOwner

Virtual Method Method CKParameterLocal::SetOwner

virtual void CKParameterLocal::SetOwner(CKObject *o)

Sets the owner of the output parameter

Parameters

o

A CKObject pointer to be set as owner of the parameter.

Remarks

The owner if automatically set by the framework in most of the cases. The owner of a parameter can be:

a behavior (output and local parameters) a parameter operation (output parameters) a behavioral object (Attributes) a data array (CKDataArray)

See Also

CKBehavior, CKBeObject,CKDataArray,GetOwner


CKParameterLocal::CopyValue

Virtual Method Method CKParameterLocal::CopyValue

virtual CKERROR CKParameterLocal::CopyValue(CKParameter *param,CKBOOL UpdateParam=TRUE)

Copies the content of a parameter to this parameter.

Parameters

UpdateParam

In the case of an output parameter of a parameter operation, TRUE if the operation should be evaluated before copying the value.

Returns

Value | Meaning
CK_OK | if successful
CKERR_INVALIDPARAMETERTYPE | if parameter types are incompatible

Remarks

This function checks the types of the source and destination parameters before copying the content. It also ensures to call the correct copy function according to the parameter type.

See Also

SetValue,GetValue


CKParameterLocal::GetWriteDataPtr

Virtual Method Method CKParameterLocal::GetWriteDataPtr

virtual void * CKParameterLocal::GetWriteDataPtr()

Returns a pointer to the data.

Returns

A pointer to the storage buffer

Remarks

These methods give access to the data of the parameter by pointer. You should be cautious when you use these methods, especially you should call CKParameterOut::DataChanged if you have modified the data in order to propagate the modification down the destination chain when using a CKParameterOut. The GetValue method copies the content of the parameter buffer inside a user allocated buffer so it is fastest to use this method when accessing large parameters such as strings or buffer. GetDataSize returns the size in bytes of the returned buffer. The GetWriteDataPtr and GetReadDataPtr but should be used accordingly to the intent (reading or writing) in case this hint could be used by the engine.

Reads the value of string parameter char* StringValue = (char *) StringParam->GetReadDataPtr();

See Also

Pre-Registred Parameter Types ,GetValue, SetValue,GetReadDataPtr,GetDataSize


CKParameterLocal::SetStringValue

Virtual Method Method CKParameterLocal::SetStringValue

virtual CKERROR CKParameterLocal::SetStringValue(CKSTRING Value)

Sets the value of the parameter using a string.

Returns

CK_OK if successful,an error code otherwise.

Remarks

Most parameter types know how to convert their data to and from a string. SetStringValue converts the given string into a data and changes the data. Propagates the changes down the destination chain is the parameter is a CKParameterOut.

See Also

GetStringValue


CKParameterLocal::SetValue

Virtual Method Method CKParameterLocal::SetValue

virtual CKERROR CKParameterLocal::SetValue(const void *buf,int size = 0)

Sets the value of the parameter.

Parameters

buf | A pointer to value to be set
size | Integer specifying the size of the value or 0 to use the default size of the parameter.

Returns

CK_OK if successful, error code otherwise.

Remarks

For variable size parameter the size must be given. This copies the given data into the data of the parameter. In the case of a CKParameterOut, it automatically propagates the modifications down the destinations chain, so the call to DataChanged is not needed. DO NOT USE SetValue() and GetValue() to copy from one parameter to another if you are not sure of the type of parameter you are copying instead use CopyValue.

Sets the value of a string parameter (CKPGUID_STRING) char string[] = “My value”; StringParam->SetValue(string,strlen(string)+1);

Sets the value of a CKObject parameter (CKPGUID_OBJECT) CK_ID ObjectID = CKOBJID(MyObject); ObjectParam->SetValue(&ObjectID);

Sets the value of a integer parameter (CKPGUID_INT) int iValue = 15; ObjectParam->SetValue(&iValue);

Sets the value of a float parameter (CKPGUID_FLOAT) float fValue = 15; ObjectParam->SetValue(&fValue);

See Also

Pre-Registred Parameter Types,GetValue,GetDataSize, GetWriteDataPtr, CopyValue


CKParameterOperation

Class CKParameterOperation

Performing operations on parameters

CKObject
Show brief derivation trees

CKParameterOperation

CKObject
Show full derivation trees

CKParameterOperation

Remarks

An operation encapsulates a C++ function that applies on zero, one or two input parameters, and outputs one parameter. Certain operations are predefined in Virtools and you can define your own. The function is called only when necessary (GetValue on the output parameter for example).

All the operation's characteristics are defined by the CKParameterManager, and by the GUID of the operation. You can defined your own operation with CKParameterManager::RegisterOperationType and your own operation function with CKParameterManager::RegisterOperationFunction.

An operation has zero, one or two input parameters that it owns. These parameters can be plugged into output parameters to retrieve their value for example. The output parameter is also owned by the operation, and is used to make the result of the operation available to the rest of the graph. One can access the parameters with the GetInParameter1, GetInParameter2 and GetOutParameter methods.

The execution of the operation is automatically done when needed. You can force it by using the DoOperation method. In any case, the operation checks the update times of the inputs parameters and only does the computation if necessary.

The class id of CKParameterOperation is CKCID_PARAMETEROPERATION.

Groups

Operations
Method DoOperation | Forces the execution of an operation
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetInParameter1 | Accessing the first input parameter of the operation
Method GetInParameter2 | Accessing the second input parameter of the operation
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method GetOperationGuid | Returns the GUID of the operation
Method GetOutParameter | Accessing the output parameter of the operation
Method GetOwner | Returns the owner behavior.
Method Reconstruct | Reconstructs the operation.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Method SetOwner | Owner management

See Also

CKParameterManager, CKParameterOut, CKParameterIn, CKBehaviorPrototype,ParameterOperation Types


CKParameterOperation::DoOperation

Method CKParameterOperation::DoOperation

CKERROR CKParameterOperation::DoOperation()

Forces the execution of an operation

Returns

CK_OK if successful or CKERR_NOTINITIALIZED if no function was available for the operation.

Remarks

This methods should rarely be used as it is automatically called by the system when needed. You may need to call it however to force the execution of the operation at a certain time. It updates the output parameter with the result of the operation.

See Also

Reconstruct


CKParameterOperation::GetInParameter1

Method CKParameterOperation::GetInParameter1

CKParameterIn* CKParameterOperation::GetInParameter1()

Accessing the first input parameter of the operation

Returns

A pointer to the first input parameter.

Remarks

The parameters of the operation are created with the operation, and are owned by it. These methods give access to these parameters.

See Also

GetInParameter2,GetOutParameter


CKParameterOperation::GetInParameter2

Method CKParameterOperation::GetInParameter2

CKParameterIn* CKParameterOperation::GetInParameter2()

Accessing the second input parameter of the operation

Returns

A pointer to the second input parameter.

Remarks

The parameters of the operation are created with the operation, and are owned by it. These methods give access to these parameters.

See Also

GetInParameter1,GetOutParameter


CKParameterOperation::GetOperationGuid

Method CKParameterOperation::GetOperationGuid

CKGUID CKParameterOperation::GetOperationGuid()

Returns the GUID of the operation

Returns

CKGUID identifying the operation family for this operation.

Remarks

A operation GUID identify the type of operation family this operation belongs to (like addition,multiplication,etc..).

See Also

Reconstruct,CKParameterManager,ParameterOperation Types


CKParameterOperation::GetOutParameter

Method CKParameterOperation::GetOutParameter

CKParameterOut* CKParameterOperation::GetOutParameter()

Accessing the output parameter of the operation

Returns

A pointer to the output parameter.

Remarks

The parameters of the operation are created with the operation, and are owned by it. These methods give access to these parameters.

See Also

GetInParameter1,GetInParameter2


CKParameterOperation::GetOwner

Method CKParameterOperation::GetOwner

CKBehavior* CKParameterOperation::GetOwner()

Returns the owner behavior.

Returns

A pointer to the CKBehavior that owns this parameter operation.

Remarks

The owner is usually the behavior which owns the graph of which the operation is part of.

See Also

CKBehavior::AddParameterOperation


CKParameterOperation::Reconstruct

Method CKParameterOperation::Reconstruct

void CKParameterOperation::Reconstruct(CKSTRING Name,CKGUID opguid,CKGUID ResGuid, CKGUID p1Guid, CKGUID p2Guid)

Reconstructs the operation.

Remarks

This methods reconstruct the operation by recreating its input and ouput parameters and finding the appropriate function for execution.

See Also

GetOperationGuid,ParameterOperation Types


CKParameterOperation::SetOwner

Method CKParameterOperation::SetOwner

void CKParameterOperation::SetOwner(CKBehavior* beh)

Owner management

Remarks

The owner is usually the behavior which owns the graph of which the operation is part of.

See Also

CKBehavior::AddParameterOperation


CKParameterOut

Class CKParameterOut

Output parameter providing a value

CKObject

CKParameter
Show brief derivation trees

CKParameterOut

CKObject

CKParameter
Show full derivation trees

CKParameterOut

Subclasses

CKParameterOutFS

Remarks

The type of the parameter defines the type of the data provided. These types are maintained by the parameter manager. It defines the size of the buffer to use, and also decides what can be plugged onto the output parameter. To have the list and definition of predefined parameter types see CKParameterManager.

An output parameter may have destinations to which it pushes the data each time it is changed. These destinations are other output parameters, which for example provide their value out of the enclosing behavior, or local parameters which provide values to other parts of the graph of sub-behaviors. These destinations are managed using the AddDestination and related methods. When the data of the output parameter changes, it pushes the new value down to its destinations.

An output parameter will probably also be plugged into input parameters. These input parameters will pull the value from the output parameter when needed.

An output parameter usually knows how to write its data from and to a string. This is useful for display and debugging purposes. When you define a new type of parameter, you can specify the function that converts to and from strings.

An output parameter can also have an edition window. When you define a new type of parameter, you can specify the function that will create the edition window when needed by the interface.

A CKParameterOut is created with CKBehavior::CreateOutputParameter or CKContext::CreateCKParameterOut.

The class id of CKParameterOut is CKCID_PARAMETEROUT.

Groups

Operations
Method AddDestination | Adds a destination parameter.
Virtual Method Method CheckClass | Virtual added for Fixed Size parameter support
Method DataChanged | Forces the propagation of the data down the destination chain.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetDestination | Returns the Nth destination parameter.
Method GetDestinationCount | Returns number of destination parameters.
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method RemoveAllDestinations | Removes the all destinations from the list.
Method RemoveDestination | Removes the given destination from the destinations list.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Value
Virtual Method Method CopyValue | Copies the content of a parameter to this parameter.
Method GetDataSize | Gets the size of the data stored by the parameter.
Virtual Method Method GetReadDataPtr | Returns a pointer to the data.
Virtual Method Method GetStringValue | Gets the string representation of the parameter value.
Virtual Method Method GetValue | Gets the value of the parameter.
Virtual Method Method GetWriteDataPtr | Returns a pointer to the data.
Virtual Method Method SetStringValue | Sets the value of the parameter using a string.
Virtual Method Method SetValue | Sets the value of the parameter.

See Also

CKBehavior, CKParameterIn, CKParameterOperation


CKParameterOut::AddDestination

Method CKParameterOut::AddDestination

CKERROR CKParameterOut::AddDestination(CKParameter* param,CKBOOL CheckType)

Adds a destination parameter.

Parameters

Input argument param | A pointer to CKParameter to add as a destination of this parameter.
Input argument CheckType | TRUE to check if the two parameters use compatible types.

Returns

Value | Meaning
CK_OK | if successful
CKERR_INVALIDPARAMETER | if param was NULL
CKERR_INCOMPATIBLEPARAMETERS | if param is not compatible with this parameter.
CKERR_ALREADYPRESENT | if param is already adestination of this parameter.

Remarks

The destinations are all the parameters to which the data of this output parameter should be propagated when changed.

See Also

RemoveAllDestinations,GetDestinationCount,GetDestination


CKParameterOut::DataChanged

Method CKParameterOut::DataChanged

void CKParameterOut::DataChanged()

Forces the propagation of the data down the destination chain.

Remarks

When the content of a parameter is changed after a call CKParameter::GetWriteDataPtr this method must be called to propagate the new value to the destination parameters.

See Also

CKParameter::GetWriteDataPtr


CKParameterOut::GetDestination

Method CKParameterOut::GetDestination

CKParameter* CKParameterOut::GetDestination(int pos)

Returns the Nth destination parameter.

Parameters

Input argument pos

Index of the Destination parameter to be returned.

Returns

Pointer to destination parameter.

Remarks

The destinations are all the parameters to which the data of this output parameter should be propagated when changed.

See Also

AddDestination,RemoveAllDestinations,GetDestinationCount,GetDestination


CKParameterOut::GetDestinationCount

Method CKParameterOut::GetDestinationCount

int CKParameterOut::GetDestinationCount()

Returns number of destination parameters.

Returns

Number of destinations.

Remarks

The destinations are all the parameters to which the data of this output parameter should be propagated when changed.

See Also

AddDestination,RemoveAllDestinations,GetDestinationCount,GetDestination


CKParameterOut::RemoveAllDestinations

Method CKParameterOut::RemoveAllDestinations

void CKParameterOut::RemoveAllDestinations()

Removes the all destinations from the list.

Remarks

The destinations are all the parameters to which the data of this output parameter should be propagated when changed.

See Also

AddDestination,RemoveDestination,GetDestinationCount,GetDestination


CKParameterOut::RemoveDestination

Method CKParameterOut::RemoveDestination

void CKParameterOut::RemoveDestination(CKParameter* param)

Removes the given destination from the destinations list.

Parameters

Input argument param

Destination parameter to be removed.

Remarks

The destinations are all the parameters to which the data of this output parameter should be propagated when changed.

See Also

AddDestination,RemoveAllDestinations,GetDestinationCount,GetDestination


CKParameterOut::CopyValue

Virtual Method Method CKParameterOut::CopyValue

virtual CKERROR CKParameterOut::CopyValue(CKParameter *param,CKBOOL UpdateParam=TRUE)

Copies the content of a parameter to this parameter.

Parameters

UpdateParam

In the case of an output parameter of a parameter operation, TRUE if the operation should be evaluated before copying the value.

Returns

Value | Meaning
CK_OK | if successful
CKERR_INVALIDPARAMETERTYPE | if parameter types are incompatible

Remarks

This function checks the types of the source and destination parameters before copying the content. It also ensures to call the correct copy function according to the parameter type.

See Also

SetValue,GetValue


CKParameterOut::GetReadDataPtr

Virtual Method Method CKParameterOut::GetReadDataPtr

virtual void* CKParameterOut::GetReadDataPtr(CKBOOL update = TRUE)

Returns a pointer to the data.

Returns

A pointer to the storage buffer

Remarks

These methods give access to the data of the parameter by pointer. You should be cautious when you use these methods, especially you should call CKParameterOut::DataChanged if you have modified the data in order to propagate the modification down the destination chain when using a CKParameterOut. The GetValue method copies the content of the parameter buffer inside a user allocated buffer so it is fastest to use this method when accessing large parameters such as strings or buffer. GetDataSize returns the size in bytes of the returned buffer.

Reads the value of string parameter char* StringValue = (char *) StringParam->GetReadDataPtr();

See Also

Pre-Registred Parameter Types ,GetValue, GetWriteDataPtr,SetValue,GetDataSize


CKParameterOut::GetStringValue

Virtual Method Method CKParameterOut::GetStringValue

virtual int CKParameterOut::GetStringValue(CKSTRING Value,CKBOOL update = TRUE)

Gets the string representation of the parameter value.

Parameters

update

In the case of an output parameter of a parameter operation, TRUE if the operation should be evaluated before copying the value.

Returns

The size of the needed buffer for the string.

Remarks

+If the given string is NULL, the method returns the number of bytes to allocate for the string.

See Also

SetStringValue


CKParameterOut::GetValue

Virtual Method Method CKParameterOut::GetValue

virtual CKERROR CKParameterOut::GetValue(void *buf, CKBOOL update = TRUE)

Gets the value of the parameter.

Parameters

buf

A pointer to a buffer where the value is to be copied.

Remarks

DO NOT USE SetValue() and GetValue() to copy from one parameter to another if you are not sure of the type of parameter you are copying instead use CopyValue. GetValue copies the content of the parameter buffer to buf, it can be more convenient to use GetReadDataPtr to access variable size parameter like string or buffers.

Gets the value of a CKObject parameter (CKPGUID_OBJECT) CK_ID ObjectID; CKObject* Object; ObjectParam->GetValue(&ObjectID); Object= CKContext->GetObject(ObjectID);

you can now directly use Object = ObjectParam->GetValueObject();

Gets the value of a integer parameter (CKPGUID_INT) int iValue; ObjectParam->GetValue(&iValue);

Gets the value of a float parameter (CKPGUID_FLOAT) float fValue; ObjectParam->GetValue(&fValue); //or fValue = *(float *)ObjectParam->GetReadDataPtr();

See Also

Pre-Registred Parameter Types,SetValue,GetDataSize, GetWriteDataPtr, CopyValue


CKParameterOut::SetValue

Virtual Method Method CKParameterOut::SetValue

virtual CKERROR CKParameterOut::SetValue(const void *buf,int size = 0)

Sets the value of the parameter.

Parameters

buf | A pointer to value to be set
size | Integer specifying the size of the value or 0 to use the default size of the parameter.

Returns

CK_OK if successful, error code otherwise.

Remarks

For variable size parameter the size must be given. This copies the given data into the data of the parameter. In the case of a CKParameterOut, it automatically propagates the modifications down the destinations chain, so the call to DataChanged is not needed. DO NOT USE SetValue() and GetValue() to copy from one parameter to another if you are not sure of the type of parameter you are copying instead use CopyValue.

Sets the value of a string parameter (CKPGUID_STRING) char string[] = “My value”; StringParam->SetValue(string,strlen(string)+1);

Sets the value of a CKObject parameter (CKPGUID_OBJECT) CK_ID ObjectID = CKOBJID(MyObject); ObjectParam->SetValue(&ObjectID);

Sets the value of a integer parameter (CKPGUID_INT) int iValue = 15; ObjectParam->SetValue(&iValue);

Sets the value of a float parameter (CKPGUID_FLOAT) float fValue = 15; ObjectParam->SetValue(&fValue);

See Also

Pre-Registred Parameter Types,GetValue,GetDataSize, GetWriteDataPtr, CopyValue


CKStructHelper

Class CKStructHelper

Helper class to access a parameter of type structure.

Remarks

New parameter types can be created like structures with the CKParameterManager::RegisterNewStructure method, this class provides method to easily access a structure members.

A structure defined in C like this:

typedef struct MyStructure
{
    float       Priority;
    VxVector    Position;
    CK_ID       ObstacleId;
} MyStructure;

is equivalent to declare

#define  CKPGUID_MYSTRUCT CKGUID(0x4a893652,0x76e72d5c)
ParameterManager->RegisterNewStructure(CKPGUID_MYSTRUCT,"MyStructure","Priority,Position,Obstacle",CKPGUID_FLOAT,CKPGUID_VECTOR,CKPGUID_3DENTITY);

then the CKStructHelper can help to have a description of this structure later :

CKStructHelper  StructDesc(Context,CKPGUID_MYSTRUCT);
int Count = StructDesc.GetMemberCount();
for (int i=0;i<Count;++i) {
    StructDesc.GetMemberName(i);  // Priority,Position,Obstacle
    StructDesc.GetMemberGUID(i);  // CKPGUID_FLOAT,CKPGUID_VECTOR,CKPGUID_3DENTITY
}

or it can be use to access the sub-members of a parameter of the type CKPGUID_MYSTRUCT for example:

CKStructHelper MyStruct(param);

Access sub-members
float         Priority;
VxVector      Position;
CK_ID         ObstacleId;

MyStruct[0]->GetValue(&Priority);
MyStruct[1]->GetValue(&Position);
MyStruct[2]->GetValue(&ObstacleId);

Groups

Constructors
Method CKStructHelper | Constructs a new instance of the CKStructHelper class
Operators
Method operator[] | Returns a member of this structure as a parameter
Operations
Method GetMemberCount | Returns the number of members in the structure
Method GetMemberGUID | Returns the parameter type of a member of the structure
Method GetMemberName | Returns the name of a number in the structure

See Also

RegisterNewStructure,


CKStructHelper::CKStructHelper

Method CKStructHelper::CKStructHelper

CKStructHelper::CKStructHelper(CKContext* ctx,CKGUID PGuid,CK_ID* Data)
CKStructHelper::CKStructHelper(CKContext* ctx,CKParameterType PType,CK_ID* Data)
CKStructHelper::CKStructHelper(CKParameter* Param, CKBOOL Update)

Constructs a new instance of the CKStructHelper class

Parameters

Input argument PGuid | A CKGUID giving the structure parameter type previously declared with CKParameterManager::RegisterNewStructure
ctx | A pointer to the CKContext.
Input argument PType | Parameter Type previously declared with CKParameterManager::RegisterNewStructure
Data | A pointer to an array of CK_ID , this is usually the value returned by a CKParameter::GetReadDataPtr but can be ignored this class is only used to get information of a given parameter type (GetMemberCount,GetMemberName and GetMemberGUID)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKStructHelper::operator[]

Method CKStructHelper::operator[]

CKParameter* CKStructHelper::operator[] (int i)

Returns a member of this structure as a parameter

Parameters

Input argument i

Index of the member to return.

Returns

A pointer to a CKParameter that holds the ith member.

Remarks

This method does not perform any check concerning the validty of the given index, it is the user responsability to ensure it is below GetMemberCount

See Also

GetMemberGUID,GetMemberName,GetMemberCount


CKStructHelper::GetMemberCount

Method CKStructHelper::GetMemberCount

int CKStructHelper::GetMemberCount()

Returns the number of members in the structure

Remarks

See CKStructHelper for more details on the usage of this class.

See Also

CKStructHelper::CKStructHelper,GetMemberGUID,GetMemberName,CKParameterManager::RegisterNewStructure


CKStructHelper::GetMemberGUID

Method CKStructHelper::GetMemberGUID

CKGUID CKStructHelper::GetMemberGUID(int Pos)

Returns the parameter type of a member of the structure

Remarks

This methods returns the type of the Pos th member of the structure as declared in CKParameterManager::RegisterNewStructure See CKStructHelper for more details on the usage of this class.

See Also

CKStructHelper::CKStructHelper,GetMemberCount,GetMemberName,CKParameterManager::RegisterNewStructure


CKStructHelper::GetMemberName

Method CKStructHelper::GetMemberName

char* CKStructHelper::GetMemberName(int Pos)

Returns the name of a number in the structure

Remarks

This methods returns the name of the Pos th member of the structure as declared in CKParameterManager::RegisterNewStructure See CKStructHelper for more details on the usage of this class.

See Also

CKStructHelper::CKStructHelper,GetMemberGUID,GetMemberCount,CKParameterManager::RegisterNewStructure


CKFileExtensionShort

Class CKFileExtensionShort

Groups

Data Members
Member Variable m_ExtShort | Members secret
Constructors
Method CKFileExtensionShort | Ctor
Coercion Operators
Method cast operator | Description: Converts to another type. This converts the current object to a particular type.
Comparison Operators
Method operator== | Description: Equality Operator


CKFileExtensionShort::m_ExtShort

Member Variable CKFileExtensionShort::m_ExtShort

char CKFileExtensionShort::m_ExtShort[4]

Remarks

Members secret


CKFileExtensionShort::CKFileExtensionShort

Method CKFileExtensionShort::CKFileExtensionShort

CKFileExtensionShort::CKFileExtensionShort()
CKFileExtensionShort::CKFileExtensionShort(char* s)

Remarks

Ctor


CKFileExtensionShort::cast operator

Method CKFileExtensionShort::cast operator

CKFileExtensionShort::operator char*()
CKFileExtensionShort::operator const char*()

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


CKFileExtensionShort::operator==

Method CKFileExtensionShort::operator==

int CKFileExtensionShort::operator==(const CKFileExtensionShort& s)

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


CKGUID

Class CKGUID

Groups

Constructors
Method CKGUID

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKGUID::CKGUID

Method CKGUID::CKGUID

explicit CKGUID::CKGUID(CKDWORD gd1=0,CKDWORD gd2=0)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CloudAttributeDescription

Class CloudAttributeDescription

Attributes on points

Remarks

Every points can store attributes on it. By default 4 types of attribute are defined (not necessarily used): A color , normal , intensity and render group. This attributes can be integer or float values. For integer the number of bits used to store the value can be specified in the BitsPerValue member thus allowing efficient storage.

Groups

Data Members
Member Variable BitsPerValue | Number of bits taken by the value
Member Variable Flags | Reserved
Member Variable Name | Name of the attribute
Member Variable ValueType | Type of the value stored Can be ATTRIBUT_INT , ATTRIBUT_FLOAT , ATTRIBUT_COLOR (A 16 bit 565 color) or ATTRIBUT_NORMAL (A 16 bit compressed normal)

See Also

CK3dPointCloud


CloudAttributeDescription::BitsPerValue

Member Variable CloudAttributeDescription::BitsPerValue

int CloudAttributeDescription::BitsPerValue

Number of bits taken by the value

Remarks

This value is only used when using an ATTRIBUT_INT or ATTRIBUT_ENUM storage. If this not given (0) 32 bits will be used for each value.


CloudAttributeDescription::Flags

Member Variable CloudAttributeDescription::Flags

DWORD CloudAttributeDescription::Flags

Remarks

Reserved


CloudAttributeDescription::Name

Member Variable CloudAttributeDescription::Name

XString CloudAttributeDescription::Name

Remarks

Name of the attribute


CloudAttributeDescription::ValueType

Member Variable CloudAttributeDescription::ValueType

AttValueType CloudAttributeDescription::ValueType

Remarks

Type of the value stored Can be ATTRIBUT_INT , ATTRIBUT_FLOAT , ATTRIBUT_COLOR (A 16 bit 565 color) or ATTRIBUT_NORMAL (A 16 bit compressed normal)


CloudIterator

Class CloudIterator

An iterator to iterate on a cloud of points.

Remarks

It can be used to iterate the octree that is used to store the data. This tree is made up of node that contain up to 8 children nodes

One can ask an iterator from the tree root node (See CK3dPointCloud::GetRootIterator) and then iterate using Depth first (NextNode) or custom (ToChildByIndex) iteration.

Warning: Only a single iterator should be created at a time on a single CK3dPointCloud.

Groups

Node Type
Pure Virtual Method Method IsLeaf | Return TRUE if the iterator is on a tree leaf.
Pure Virtual Method Method IsNode | Return TRUE if the iterator is on a tree node.
Iteration
Pure Virtual Method Method GetChildrenCount | Return the number of children of the current node
Pure Virtual Method Method IsChildHere | Return if a child exists for one of the 8 possible branches of a node.
Pure Virtual Method Method NextNode | Advance the iterator to the next element (node or leaf) in a Depth First order.
Pure Virtual Method Method NextPoint | Advance the iterator to the next point
Pure Virtual Method Method ToChildByBranch | Advance the iterator down to a children given its position in the 8 possible branches.
Pure Virtual Method Method ToChildByIndex | Advance the iterator down to the iChildIndex children
Pure Virtual Method Method ToParent | Move this iterator back the parent node
Information
Pure Virtual Method Method GetBox | Return the current node bounding box in cloud local coordinates (as visible in the 3D view).
Pure Virtual Method Method GetRealBox | Return the current node bounding box in cloud local coordinates (as in the original .asc file).
Point Data
Pure Virtual Method Method GetCurrentPointIndex | Returns the global index of the currently iterated point.
Pure Virtual Method Method GetCurrentPointPosition | Returns the position of the currently iterated point (as visible in the 3D view).
Pure Virtual Method Method GetCurrentPointRealPosition | Returns the position of the currently iterated point (as it was stored in the .asc file).

See Also

CK3dPointCloud


CloudIterator::IsLeaf

Pure Virtual Method Method CloudIterator::IsLeaf

virtual XBOOL CloudIterator::IsLeaf()

Return TRUE if the iterator is on a tree leaf.


CloudIterator::IsNode

Pure Virtual Method Method CloudIterator::IsNode

virtual XBOOL CloudIterator::IsNode()

Return TRUE if the iterator is on a tree node.


CloudIterator::GetChildrenCount

Pure Virtual Method Method CloudIterator::GetChildrenCount

virtual int CloudIterator::GetChildrenCount()

Return the number of children of the current node


CloudIterator::IsChildHere

Pure Virtual Method Method CloudIterator::IsChildHere

virtual XBOOL CloudIterator::IsChildHere(int iBranchIndex)

Return if a child exists for one of the 8 possible branches of a node.


CloudIterator::NextNode

Pure Virtual Method Method CloudIterator::NextNode

virtual XBOOL CloudIterator::NextNode()

Advance the iterator to the next element (node or leaf) in a Depth First order.


CloudIterator::NextPoint

Pure Virtual Method Method CloudIterator::NextPoint

virtual XBOOL CloudIterator::NextPoint()

Advance the iterator to the next point


CloudIterator::ToChildByBranch

Pure Virtual Method Method CloudIterator::ToChildByBranch

virtual XBOOL CloudIterator::ToChildByBranch(int iBranchIndex)

Advance the iterator down to a children given its position in the 8 possible branches.

Returns

TRUE if sucessful, FALSE if no child exist.


CloudIterator::ToChildByIndex

Pure Virtual Method Method CloudIterator::ToChildByIndex

virtual XBOOL CloudIterator::ToChildByIndex(int iChildIndex)

Advance the iterator down to the iChildIndex children

Returns

TRUE if sucessful, FALSE if no child exist.


CloudIterator::ToParent

Pure Virtual Method Method CloudIterator::ToParent

virtual XBOOL CloudIterator::ToParent()

Move this iterator back the parent node

Returns

TRUE if sucessful, FALSE if there the iterator is on tree root.


CloudIterator::GetBox

Pure Virtual Method Method CloudIterator::GetBox

virtual void CloudIterator::GetBox(VxBbox& oBox)

Return the current node bounding box in cloud local coordinates (as visible in the 3D view).


CloudIterator::GetRealBox

Pure Virtual Method Method CloudIterator::GetRealBox

virtual void CloudIterator::GetRealBox(VxBbox& oBox)

Return the current node bounding box in cloud local coordinates (as in the original .asc file).


CloudIterator::GetCurrentPointIndex

Pure Virtual Method Method CloudIterator::GetCurrentPointIndex

virtual int CloudIterator::GetCurrentPointIndex()

Returns the global index of the currently iterated point.


CloudIterator::GetCurrentPointPosition

Pure Virtual Method Method CloudIterator::GetCurrentPointPosition

virtual VxVector CloudIterator::GetCurrentPointPosition()

Returns the position of the currently iterated point (as visible in the 3D view).


CloudIterator::GetCurrentPointRealPosition

Pure Virtual Method Method CloudIterator::GetCurrentPointRealPosition

virtual VxVector CloudIterator::GetCurrentPointRealPosition()

Returns the position of the currently iterated point (as it was stored in the .asc file).


CloudSelection

Class CloudSelection

An iterator to iterate on a cloud of points.

Groups

Data Members
Member Variable m_DisplayMaterial
Member Variable m_DisplayMesh
Member Variable m_Flags
Member Variable m_MaxSize
Member Variable m_Name
Operations
Pure Virtual Method Method ClearSelection
Pure Virtual Method Method EnableLighting
Pure Virtual Method Method GetDisplayMaterial
Pure Virtual Method Method GetDisplayMesh
Pure Virtual Method Method GetDrawMode
Pure Virtual Method Method GetMaximumPointCount
Pure Virtual Method Method GetName
Pure Virtual Method Method GetPointCount
Pure Virtual Method Method GetPointOriginalIndex
Pure Virtual Method Method GetPointPosition
Pure Virtual Method Method IsLightingEnabled
Pure Virtual Method Method IsUsingMaterialColor
Pure Virtual Method Method IsVisible
Pure Virtual Method Method SetDisplayMaterial
Pure Virtual Method Method SetDisplayMesh
Pure Virtual Method Method SetDrawMode
Pure Virtual Method Method SetMaximumPointCount
Pure Virtual Method Method SetName
Pure Virtual Method Method SetVisible
Pure Virtual Method Method UseMaterialColor
Type Definitions
Enumerated Type EDrawMode
Enumerated Type Flags

See Also

CK3dPointCloud


CloudSelection::m_DisplayMaterial

Member Variable CloudSelection::m_DisplayMaterial

CKMaterial* CloudSelection::m_DisplayMaterial


CloudSelection::m_DisplayMesh

Member Variable CloudSelection::m_DisplayMesh

CKMesh* CloudSelection::m_DisplayMesh


CloudSelection::m_Flags

Member Variable CloudSelection::m_Flags

int CloudSelection::m_Flags


CloudSelection::m_MaxSize

Member Variable CloudSelection::m_MaxSize

int CloudSelection::m_MaxSize


CloudSelection::m_Name

Member Variable CloudSelection::m_Name

XString CloudSelection::m_Name


CloudSelection::ClearSelection

Pure Virtual Method Method CloudSelection::ClearSelection

virtual void CloudSelection::ClearSelection()


CloudSelection::EnableLighting

Pure Virtual Method Method CloudSelection::EnableLighting

virtual void CloudSelection::EnableLighting(CKBOOL iEnable = TRUE)


CloudSelection::GetDisplayMaterial

Pure Virtual Method Method CloudSelection::GetDisplayMaterial

virtual CKMaterial* CloudSelection::GetDisplayMaterial() const


CloudSelection::GetDisplayMesh

Pure Virtual Method Method CloudSelection::GetDisplayMesh

virtual CKMesh* CloudSelection::GetDisplayMesh() const


CloudSelection::GetDrawMode

Pure Virtual Method Method CloudSelection::GetDrawMode

virtual int CloudSelection::GetDrawMode() const


CloudSelection::GetMaximumPointCount

Pure Virtual Method Method CloudSelection::GetMaximumPointCount

virtual int CloudSelection::GetMaximumPointCount() const


CloudSelection::GetName

Pure Virtual Method Method CloudSelection::GetName

virtual const XString& CloudSelection::GetName() const


CloudSelection::GetPointCount

Pure Virtual Method Method CloudSelection::GetPointCount

virtual int CloudSelection::GetPointCount() const


CloudSelection::GetPointOriginalIndex

Pure Virtual Method Method CloudSelection::GetPointOriginalIndex

virtual int CloudSelection::GetPointOriginalIndex(int iPointIndex) const


CloudSelection::GetPointPosition

Pure Virtual Method Method CloudSelection::GetPointPosition

virtual const VxVector& CloudSelection::GetPointPosition(int iPointIndex) const


CloudSelection::IsLightingEnabled

Pure Virtual Method Method CloudSelection::IsLightingEnabled

virtual CKBOOL CloudSelection::IsLightingEnabled() const


CloudSelection::IsUsingMaterialColor

Pure Virtual Method Method CloudSelection::IsUsingMaterialColor

virtual CKBOOL CloudSelection::IsUsingMaterialColor() const


CloudSelection::IsVisible

Pure Virtual Method Method CloudSelection::IsVisible

virtual CKBOOL CloudSelection::IsVisible() const


CloudSelection::SetDisplayMaterial

Pure Virtual Method Method CloudSelection::SetDisplayMaterial

virtual void CloudSelection::SetDisplayMaterial(CKMaterial* iMaterial)


CloudSelection::SetDisplayMesh

Pure Virtual Method Method CloudSelection::SetDisplayMesh

virtual void CloudSelection::SetDisplayMesh(CKMesh* iMesh)


CloudSelection::SetDrawMode

Pure Virtual Method Method CloudSelection::SetDrawMode

virtual void CloudSelection::SetDrawMode(int iMode)


CloudSelection::SetMaximumPointCount

Pure Virtual Method Method CloudSelection::SetMaximumPointCount

virtual void CloudSelection::SetMaximumPointCount(int iMaxPointCount)


CloudSelection::SetName

Pure Virtual Method Method CloudSelection::SetName

virtual void CloudSelection::SetName(const XString& iName)


CloudSelection::SetVisible

Pure Virtual Method Method CloudSelection::SetVisible

virtual void CloudSelection::SetVisible(CKBOOL IsVisible)


CloudSelection::UseMaterialColor

Pure Virtual Method Method CloudSelection::UseMaterialColor

virtual void CloudSelection::UseMaterialColor(CKBOOL iUse)


CloudSelection::EDrawMode

Enumerated Type CloudSelection::EDrawMode

enum EDrawMode {
ePoint = 0,
eSprites = 1,
ePrimitive = 2,
}

Members

ePoint
ePrimitive
eSprites


CloudSelection::Flags

Enumerated Type CloudSelection::Flags

enum Flags {
eLighting = 1<<4,
eVBUptodate = 1<<5,
eVisible = 1<<6,
eUseMatColor = 1<<7,
}

Members

eLighting
eUseMatColor
eVBUptodate
eVisible


Render Engine

Render Engine related classes

Animation classes | Animation related classes
Class CK2dEntity | Base class for 2D objects.
Class CK3dEntity | 3D objects with behaviors
Class CK3dObject | Base class for 3D objects with geometry
Class CK3dPointCloud | Cloud of 3D points.
Class CKBodyPart | Class for 3D objects being part of a character.
Class CKCamera | Camera
Class CKCharacter | Representation of character
Class CKCollisionManager | Collision management
Class CKCurve | Representation of a 3D curve
Class CKCurvePoint | Class describing curve control point (tangent and TCB parameters )
Class CKFloorManager | Floors management
Class CKGrid | Class for Grids
Class CKGridManager | Grids Management
Class CKLayer | Grid layer class.
Class CKLight | Class for lights
Class CKMaterial | Color and texture settings for objects.
Class CKMesh | Representation of the geometry of a 3D object
Class CKPatchMesh | Representation of the geometry of a 3Dobject using bezier patches.
Class CKPlace | Group of 3D entities.
Class CKRenderContext | Managing device for rendering
Class CKRenderManager | Manages all rendering contexts.
Class CKRenderObject | Base class for CKObjects that can be rendered in a CKRenderContext (3D and 2D)
Class CKSkin | Skin
Class CKSkinBoneData | Bone information in a Skin
Class CKSkinVertexData | Vertex information in a Skin
Class CKSprite | Sprite Class.
Class CKSprite3D | Sprite with 3d position and orientation.
Class CKSpriteText | Text Only sprites.
Class CKTargetCamera | A camera with a target
Class CKTargetLight | A light with a target
Class CKTexture | Class for managing textures applied to objects.
Class CKVertexBuffer | Vertex buffer class.
Shaders and Effects | Shader Management
Point Clouds | Management of clouds of 3D points.

See Also

Classes


Animation classes

Animation related classes

Animation controllers | Base animation controllers and key structures.
Class CKAnimation | Base Class for character animations or group of object animations.
Class CKKeyedAnimation | Group of object animations.
Class CKKinematicChain | Kinematic Chain for Inverse Kinematic
Class CKObjectAnimation | Animation of a 3d Object.

See Also

Render Engine


Animation controllers

+ The animation of an object can be driven by several different controllers (position,rotation,scale,morph) using different types of interpolation (linear,TCB,Bezier). + According to the type of interpolation the keyframe data use different types of keys (see Animation Keys). But the process of adding or removing keys is always the same using CKAnimController.

Animation Keys | List of animation keys structures. This section presents the differents classes used to store animation keys according to the type of interpolation used (Linear,TCB,Bezier)
Class CKAnimController | Base animation controller class.
Class CKMorphController | Morph controller class.

See Also

Animation classes


Animation Keys

List of animation keys structures. This section presents the differents classes used to store animation keys according to the type of interpolation used (Linear,TCB,Bezier)

Class CKBezierFloatKey | Bezier Float Key
Class CKBezierPositionKey | Bezier Position Key
Class CKFloatKey | Linear Float Key
Class CKKey | Base class for animation keys.
Class CKMorphKey | Morph Key
Class CKPositionKey | Linear Position Key
Class CKRotationKey | Linear Rotation Key
Class CKTCBFloatKey | TCB Float Key
Class CKTCBPositionKey | TCB Position Key
Class CKTCBRotationKey | TCB Rotation Key

See Also

Animation controllers


CKBezierFloatKey

Class CKBezierFloatKey

Bezier Float Key

CKKey

CKFloatKey
Show brief derivation trees

CKBezierFloatKey

CKKey

CKFloatKey
Show full derivation trees

CKBezierFloatKey

Remarks

This class defines a Bezier float key which contains incoming and ougoing derivative for the key. The key also contain a CKBezierKeyFlags which defines how the incoming and outgoing tangents are computed. For example if the incoming tangent mode is set to BEZIER_KEY_TANGENTS we will use the In vector as incoming tangent otherwise the incoming tangent will be automatically computed according to the given mode.

class CKBezierKeyFlags { CKBEZIERKEY_FLAGS GetInTangentMode(); CKBEZIERKEY_FLAGS GetOutTangentMode(); void SetInTangentMode(CKBEZIERKEY_FLAGS f); void SetOutTangentMode(CKBEZIERKEY_FLAGS f); }

typedef enum CKBEZIERKEY_FLAGS {
BEZIER_KEY_AUTOSMOOTH   = 0x0001,   // compute smooth tangents
BEZIER_KEY_LINEAR       = 0x0002,   // linear to/from pt
BEZIER_KEY_STEP         = 0x0004,   // step to/from pt
BEZIER_KEY_FAST         = 0x0008,   // Fast Tangent
BEZIER_KEY_SLOW         = 0x0010,   // 0 Tangent
BEZIER_KEY_TANGENTS     = 0x0020,   // Use tangent value (In or Out)
} CKBEZIERKEY_FLAGS;

Groups

Data Members
Member Variable Flags | Flags specifying how incoming and outgoing tangents are computed.
Member Variable In | Incoming Derivative.
Member Variable Out | Outgoing Derivative.
Member Variable TimeStep | Time of this key
Member Variable Value | Position info for this key.
Constructors
Method CKBezierFloatKey | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method GetFlags | Returns the tangents computation mode.
Method GetTime | Returns the time for this key.
Method GetValue | Returns the position value for this key.
Method SetTime | Sets the time for this key.
Method SetValue | Sets the position value for this key.

See Also

CKKey,CKFloatKey,CKTCBFloatKey


CKBezierFloatKey::Flags

Member Variable CKBezierFloatKey::Flags

CKBezierKeyFlags CKBezierFloatKey::Flags

Remarks

Flags specifying how incoming and outgoing tangents are computed.


CKBezierFloatKey::In

Member Variable CKBezierFloatKey::In

float CKBezierFloatKey::In

Remarks

Incoming Derivative.


CKBezierFloatKey::Out

Member Variable CKBezierFloatKey::Out

float CKBezierFloatKey::Out

Remarks

Outgoing Derivative.


CKBezierFloatKey::CKBezierFloatKey

Method CKBezierFloatKey::CKBezierFloatKey

CKBezierFloatKey::CKBezierFloatKey()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKBezierFloatKey::GetFlags

Method CKBezierFloatKey::GetFlags

CKBezierKeyFlags& CKBezierFloatKey::GetFlags()

Returns the tangents computation mode.


CKBezierPositionKey

Class CKBezierPositionKey

Bezier Position Key

CKKey

CKPositionKey
Show brief derivation trees

CKBezierPositionKey

CKKey

CKPositionKey
Show full derivation trees

CKBezierPositionKey

Remarks

This class defines a Bezier position key which contains incoming and ougoing tangent vectors for the key. The key also contain a CKBezierKeyFlags which defines how the incoming and outgoing tangents are computed. For example if the incoming tangent mode is set to BEZIER_KEY_TANGENTS we will use the In vector as incoming tangent otherwise the incoming tangent will be automatically computed according to the given mode.

class CKBezierKeyFlags {
    CKBEZIERKEY_FLAGS GetInTangentMode();
    CKBEZIERKEY_FLAGS GetOutTangentMode();
    void SetInTangentMode(CKBEZIERKEY_FLAGS f);
    void SetOutTangentMode(CKBEZIERKEY_FLAGS f);
}

typedef enum CKBEZIERKEY_FLAGS {
    BEZIER_KEY_AUTOSMOOTH   = 0x0001,   // compute smooth tangents
    BEZIER_KEY_LINEAR       = 0x0002,   // linear to/from pt
    BEZIER_KEY_STEP         = 0x0004,   // step to/from pt
    BEZIER_KEY_FAST         = 0x0008,   // Fast Tangent
    BEZIER_KEY_SLOW         = 0x0010,   // 0 Tangent
    BEZIER_KEY_TANGENTS     = 0x0020,   // Use tangent value (In or Out)
} CKBEZIERKEY_FLAGS;

Groups

Data Members
Member Variable Flags | Flags specifying how incoming and outgoing tangents are computed.
Member Variable In | Incoming tangent vector.
Member Variable Out | Outgoing tangent vector.
Member Variable Pos | Position info for this key.
Member Variable TimeStep | Time of this key
Constructors
Method CKBezierPositionKey | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method GetFlags | Returns the tangents computation mode.
Method GetPosition | Returns the position value for this key.
Method GetTime | Returns the time for this key.
Method SetPosition | Sets the position value for this key.
Method SetTime | Sets the time for this key.

See Also

CKKey,CKPositionKey,CKTCBPositionKey


CKBezierPositionKey::Flags

Member Variable CKBezierPositionKey::Flags

CKBezierKeyFlags CKBezierPositionKey::Flags

Remarks

Flags specifying how incoming and outgoing tangents are computed.


CKBezierPositionKey::In

Member Variable CKBezierPositionKey::In

VxVector CKBezierPositionKey::In

Remarks

Incoming tangent vector.


CKBezierPositionKey::Out

Member Variable CKBezierPositionKey::Out

VxVector CKBezierPositionKey::Out

Remarks

Outgoing tangent vector.


CKBezierPositionKey::CKBezierPositionKey

Method CKBezierPositionKey::CKBezierPositionKey

CKBezierPositionKey::CKBezierPositionKey()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKBezierPositionKey::GetFlags

Method CKBezierPositionKey::GetFlags

CKBezierKeyFlags& CKBezierPositionKey::GetFlags()

Returns the tangents computation mode.


CKFloatKey

Class CKFloatKey

Linear Float Key

CKKey
Show brief derivation trees

CKFloatKey

CKBezierFloatKey

CKTCBFloatKey

CKKey
Show full derivation trees

CKFloatKey

Subclasses

CKBezierFloatKey, and CKTCBFloatKey

Remarks

A simple float animation.

Groups

Data Members
Member Variable TimeStep | Time of this key
Member Variable Value | Position info for this key.
Operations
Method GetTime | Returns the time for this key.
Method GetValue | Returns the position value for this key.
Method SetTime | Sets the time for this key.
Method SetValue | Sets the position value for this key.

See Also

CKKey,CKRotationKey,CKTCBPositionKey,CKBezierPositionKey


CKFloatKey::Value

Member Variable CKFloatKey::Value

float CKFloatKey::Value

Remarks

Position info for this key.


CKFloatKey::GetValue

Method CKFloatKey::GetValue

float CKFloatKey::GetValue() const

Returns the position value for this key.


CKFloatKey::SetValue

Method CKFloatKey::SetValue

void CKFloatKey::SetValue(float value)

Sets the position value for this key.


CKKey

Class CKKey

Base class for animation keys.

Subclasses

CKFloatKey, CKMorphKey, CKPositionKey, and CKRotationKey

Remarks

This is the base class for all animation key. It contains only the time at which the key occurs.

Groups

Data Members
Member Variable TimeStep | Time of this key
Operations
Method GetTime | Returns the time for this key.
Method SetTime | Sets the time for this key.

See Also

CKObjectAnimation,CKAnimController,CKPositionKey,CKRotationKey,CKTCBPositionKey,CKTCBRotationKey


CKKey::TimeStep

Member Variable CKKey::TimeStep

float CKKey::TimeStep

Remarks

Time of this key


CKKey::GetTime

Method CKKey::GetTime

float CKKey::GetTime()

Returns the time for this key.


CKKey::SetTime

Method CKKey::SetTime

void CKKey::SetTime(float t)

Sets the time for this key.


CKMorphKey

Class CKMorphKey

Morph Key

CKKey
Show brief derivation trees

CKMorphKey

CKKey
Show full derivation trees

CKMorphKey

Remarks

A Morph key contains a list of vertex for a given time but can also contain normal information. If normal are also stored, they used a VxCompressedVector (1 DWORD) per normal. The number of vertices in a key is stored by its owner CKMorphController.(CKMorphController::SetMorphVertexCount)

Groups

Data Members
Member Variable NormArray | List of vertex normals
Member Variable PosArray | List of vertex positions
Member Variable TimeStep | Time of this key
Constructors
Method CKMorphKey | Description: Builds an instance of the object This builds an instance of the object out of its parameters.

See Also

CKKey,CKRotationKey,CKTCBPositionKey,CKBezierPositionKey


CKMorphKey::NormArray

Member Variable CKMorphKey::NormArray

VxCompressedVector* CKMorphKey::NormArray

Remarks

List of vertex normals


CKMorphKey::PosArray

Member Variable CKMorphKey::PosArray

VxVector* CKMorphKey::PosArray

Remarks

List of vertex positions


CKMorphKey::CKMorphKey

Method CKMorphKey::CKMorphKey

CKMorphKey::CKMorphKey(float Time=0)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKPositionKey

Class CKPositionKey

Linear Position Key

CKKey
Show brief derivation trees

CKPositionKey

CKBezierPositionKey

CKTCBPositionKey

CKKey
Show full derivation trees

CKPositionKey

Subclasses

CKBezierPositionKey, and CKTCBPositionKey

Remarks

This is the base class for all position keys. It contains only a VxVector with the position information.

Groups

Data Members
Member Variable Pos | Position info for this key.
Member Variable TimeStep | Time of this key
Operations
Method GetPosition | Returns the position value for this key.
Method GetTime | Returns the time for this key.
Method SetPosition | Sets the position value for this key.
Method SetTime | Sets the time for this key.

See Also

CKKey,CKRotationKey,CKTCBPositionKey,CKBezierPositionKey


CKPositionKey::Pos

Member Variable CKPositionKey::Pos

VxVector CKPositionKey::Pos

Remarks

Position info for this key.


CKPositionKey::GetPosition

Method CKPositionKey::GetPosition

const VxVector& CKPositionKey::GetPosition()

Returns the position value for this key.


CKPositionKey::SetPosition

Method CKPositionKey::SetPosition

void CKPositionKey::SetPosition(const VxVector& pos)

Sets the position value for this key.


CKRotationKey

Class CKRotationKey

Linear Rotation Key

CKKey
Show brief derivation trees

CKRotationKey

CKTCBRotationKey

CKKey
Show full derivation trees

CKRotationKey

Subclasses

CKTCBRotationKey

Remarks

This is the base class for all rotation keys. It contains only a VxQuaternion with the rotation information.

Groups

Data Members
Member Variable Rot | Rotation info for this key.
Member Variable TimeStep | Time of this key
Operations
Method GetRotation | Returns the rotation value for this key.
Method GetTime | Returns the time for this key.
Method SetRotation | Sets the rotation value for this key.
Method SetTime | Sets the time for this key.

See Also

CKKey,CKPositionKey,CKTCBRotationKey


CKRotationKey::Rot

Member Variable CKRotationKey::Rot

VxQuaternion CKRotationKey::Rot

Remarks

Rotation info for this key.


CKRotationKey::GetRotation

Method CKRotationKey::GetRotation

const VxQuaternion& CKRotationKey::GetRotation()

Returns the rotation value for this key.


CKRotationKey::SetRotation

Method CKRotationKey::SetRotation

void CKRotationKey::SetRotation(const VxQuaternion& rot)

Sets the rotation value for this key.


CKTCBFloatKey

Class CKTCBFloatKey

TCB Float Key

CKKey

CKFloatKey
Show brief derivation trees

CKTCBFloatKey

CKKey

CKFloatKey
Show full derivation trees

CKTCBFloatKey

Remarks

This class defines a TCB float key which contains tension,continuity,bias for the key. easeto and easefrom parameters defines the respectively incoming and outgoing accelerations.

Groups

Data Members
Member Variable bias |
Member Variable continuity |
Member Variable easefrom |
Member Variable easeto |
Member Variable tension |
Member Variable TimeStep | Time of this key
Member Variable Value | Position info for this key.

See Also

CKKey,CKFloatKey


CKTCBFloatKey::bias

Member Variable CKTCBFloatKey::bias

float tension,continuity,CKTCBFloatKey::bias;


CKTCBFloatKey::continuity

Member Variable CKTCBFloatKey::continuity

float tension,CKTCBFloatKey::continuity,bias;


CKTCBFloatKey::easefrom

Member Variable CKTCBFloatKey::easefrom

float easeto,CKTCBFloatKey::easefrom;


CKTCBFloatKey::easeto

Member Variable CKTCBFloatKey::easeto

float CKTCBFloatKey::easeto,easefrom;


CKTCBFloatKey::tension

Member Variable CKTCBFloatKey::tension

float CKTCBFloatKey::tension,continuity,bias;


CKTCBPositionKey

Class CKTCBPositionKey

TCB Position Key

CKKey

CKPositionKey
Show brief derivation trees

CKTCBPositionKey

CKKey

CKPositionKey
Show full derivation trees

CKTCBPositionKey

Remarks

This class defines a TCB position key which contains tension,continuity,bias for the key. easeto and easefrom parameters defines the respectively incoming and outgoing accelerations.

Groups

Data Members
Member Variable bias |
Member Variable continuity |
Member Variable easefrom |
Member Variable easeto |
Member Variable Pos | Position info for this key.
Member Variable tension |
Member Variable TimeStep | Time of this key

See Also

CKKey,CKPositionKey,CKTCBRotationKey,CKBezierPositionKey


CKTCBPositionKey::bias

Member Variable CKTCBPositionKey::bias

float tension,continuity,CKTCBPositionKey::bias;


CKTCBPositionKey::continuity

Member Variable CKTCBPositionKey::continuity

float tension,CKTCBPositionKey::continuity,bias;


CKTCBPositionKey::easefrom

Member Variable CKTCBPositionKey::easefrom

float easeto,CKTCBPositionKey::easefrom;


CKTCBPositionKey::easeto

Member Variable CKTCBPositionKey::easeto

float CKTCBPositionKey::easeto,easefrom;


CKTCBPositionKey::tension

Member Variable CKTCBPositionKey::tension

float CKTCBPositionKey::tension,continuity,bias;


CKTCBRotationKey

Class CKTCBRotationKey

TCB Rotation Key

CKKey

CKRotationKey
Show brief derivation trees

CKTCBRotationKey

CKKey

CKRotationKey
Show full derivation trees

CKTCBRotationKey

Remarks

This class defines a TCB rotation key which contains tension,continuity,bias for the key. easeto and easefrom parameters defines the respectively incoming and outgoing accelerations.

Groups

Data Members
Member Variable bias |
Member Variable continuity |
Member Variable easefrom |
Member Variable easeto |
Member Variable Rot | Rotation info for this key.
Member Variable tension |
Member Variable TimeStep | Time of this key
Constructors
Method CKTCBRotationKey | Description: Builds an instance of the object This builds an instance of the object out of its parameters.

See Also

CKKey,CKRotationKey,CKTCBPositionKey,CKBezierPositionKey


CKTCBRotationKey::bias

Member Variable CKTCBRotationKey::bias

float tension,continuity,CKTCBRotationKey::bias;


CKTCBRotationKey::continuity

Member Variable CKTCBRotationKey::continuity

float tension,CKTCBRotationKey::continuity,bias;


CKTCBRotationKey::easefrom

Member Variable CKTCBRotationKey::easefrom

float easeto,CKTCBRotationKey::easefrom;


CKTCBRotationKey::easeto

Member Variable CKTCBRotationKey::easeto

float CKTCBRotationKey::easeto,easefrom;


CKTCBRotationKey::tension

Member Variable CKTCBRotationKey::tension

float CKTCBRotationKey::tension,continuity,bias;


CKTCBRotationKey::CKTCBRotationKey

Method CKTCBRotationKey::CKTCBRotationKey

CKTCBRotationKey::CKTCBRotationKey()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKAnimController

Class CKAnimController

Base animation controller class.

VxPoolObject
Show brief derivation trees

CKAnimController

CKMorphController

VxPoolObject
Show full derivation trees

CKAnimController

Subclasses

CKMorphController

Remarks

All the animation controllers derives from this class. It provides the base methods to add,remove keys, save them to a memory buffer and perform the interpolation. The interpolation methods are automatically called by the framework when using animations.

Groups

Keys
Pure Virtual Method Method AddKey | Adds a key to this controller.
Pure Virtual Method Method GetKey | Retuns a given key
Method GetKeyCount | Returns the number of keys of this controller.
Pure Virtual Method Method RemoveKey | Removes a given key from the list.
Interpolation
Pure Virtual Method Method Evaluate | Evaluates the result of the controller at a given time.
Streaming
Pure Virtual Method Method DumpKeysTo | Stores all controller data in a memory buffer.
Pure Virtual Method Method ReadKeysFrom | Reads controller data from a memory buffer.
Operations
Method GetLength | Returns the time length of this controller.
Method GetType | Returns the CKANIMATION_CONTROLLER type of this controller.
Method SetLength | Sets the time length of this controller.

See Also

Animation Keys,CKMorphController


CKAnimController::AddKey

Pure Virtual Method Method CKAnimController::AddKey

virtual int CKAnimController::AddKey(CKKey* key)

Adds a key to this controller.

Parameters

Input argument key

A pointer to a CKKey (derived class) that contain the information.

Returns

Index of the generated key.

Remarks

+The type of key depends on both the type of the controller (Position,Rotation,Scale,etc..) and the type of interpolation used (linear,TCB,Bezier). +The keys added by this method are automatically sorted by increasing time value so there is not a specific order in which keys should be added. +Since keys can be re-ordered when AddKey is called the returned index is only valid until next call to AddKey.

See Also

Animation Keys,GetKey,GetKeyCount


CKAnimController::GetKey

Pure Virtual Method Method CKAnimController::GetKey

virtual CKKey* CKAnimController::GetKey(int index)

Retuns a given key

Parameters

Input argument index

Index of the key to be returned.

Returns

A pointer to the 'index'th key.

Remarks

+The type of returned key depends on both the type of the controller (Position,Rotation,Scale,etc..) and the type of interpolation used (linear,TCB,Bezier). +The returned pointer must not be deleted nor should its time value be modified but its content value (position,scale,tangents,etc...) can be changed.

See Also

Animation Keys,GetKeyCount


CKAnimController::GetKeyCount

Method CKAnimController::GetKeyCount

int CKAnimController::GetKeyCount()

Returns the number of keys of this controller.

See Also

GetKey


CKAnimController::RemoveKey

Pure Virtual Method Method CKAnimController::RemoveKey

virtual void CKAnimController::RemoveKey(int index)

Removes a given key from the list.

Parameters

Input argument index

Index of the key to be deleted.

See Also

Animation Keys,AddKey,GetKeyCount


CKAnimController::Evaluate

Pure Virtual Method Method CKAnimController::Evaluate

virtual CKBOOL CKAnimController::Evaluate(float TimeStep,void* res)

Evaluates the result of the controller at a given time.

Parameters

Input argument TimeStep | Time at which the interpolation should be done.
Input argument res | See Remarks.

Returns

TRUE if successful, FALSE otherwise (no keys for example).

Remarks

According to the type of controller res is a pointer to:

A VxVector for position and scale controllers A VxQuaternion for rotation and off axis scale controllers. This method can not be called in this version for morph controllers (See CKMorphController)

See Also

AddKey


CKAnimController::DumpKeysTo

Pure Virtual Method Method CKAnimController::DumpKeysTo

virtual int CKAnimController::DumpKeysTo(void* Buffer)

Stores all controller data in a memory buffer.

Parameters

Input argument Buffer

A pointer to the memory buffer where the controller data should be stored.

Returns

Size in bytes of the data written (or needed) to Buffer.

Remarks

Call this method in two steps:

First with Buffer set to NULL, so that the method will return the needed size to allocate for buffer. Then with a valid pointer to a memory buffer allocated with a least the returned size.

See Also

ReadKeysFrom


CKAnimController::ReadKeysFrom

Pure Virtual Method Method CKAnimController::ReadKeysFrom

virtual int CKAnimController::ReadKeysFrom(void* Buffer)

Reads controller data from a memory buffer.

Parameters

Input argument Buffer

A pointer to the memory buffer that was previously written DumpKeysTo.

Returns

Size in bytes of the data read from Buffer.

See Also

DumpKeysTo


CKAnimController::GetLength

Method CKAnimController::GetLength

float CKAnimController::GetLength()

Returns the time length of this controller.


CKAnimController::GetType

Method CKAnimController::GetType

CKDWORD CKAnimController::GetType()

Returns the CKANIMATION_CONTROLLER type of this controller.


CKAnimController::SetLength

Method CKAnimController::SetLength

void CKAnimController::SetLength(float l)

Sets the time length of this controller.


CKMorphController

Class CKMorphController

Morph controller class.

VxPoolObject

CKAnimController
Show brief derivation trees

CKMorphController

VxPoolObject

CKAnimController
Show full derivation trees

CKMorphController

Remarks

A Morph controller contains a list of morph keys (CKMorphKey) and perfoms linear interpolation between these keys to get the final result.

Groups

Keys
Pure Virtual Method Method AddKey | Adds a morph key.
Pure Virtual Method Method GetKey | Retuns a given key
Method GetKeyCount | Returns the number of keys of this controller.
Pure Virtual Method Method RemoveKey | Removes a given key from the list.
Interpolation
Pure Virtual Method Method Evaluate | Evaluates the vertex position at a given time
Operations
Method GetLength | Returns the time length of this controller.
Method GetType | Returns the CKANIMATION_CONTROLLER type of this controller.
Method SetLength | Sets the time length of this controller.
Pure Virtual Method Method SetMorphVertexCount | Sets the number of vertices per key.

See Also

Animation Keys,CKAnimController


CKMorphController::AddKey

Pure Virtual Method Method CKMorphController::AddKey

virtual int CKMorphController::AddKey(float TimeStep,CKBOOL AllocateNormals)
virtual int CKMorphController::AddKey(CKKey* key,CKBOOL AllocateNormals)
virtual int CKMorphController::AddKey(CKKey* key)

Adds a morph key.

Parameters

Input argument TimeStep | Time value for the key to generate.
AllocateNormals | TRUE if the new key should contain normal information.
key | A pointer to a CKMorphKey that contains the vertex positions.

Returns

Index of the generated key.

Remarks

+The type of key depends on both the type of the controller (Position,Rotation,Scale,etc..) and the type of interpolation used (linear,TCB,Bezier). +The keys added by this method are automatically sorted by increasing time value so there is not a specific order in which keys should be added. +Since keys can be re-ordered when AddKey is called the returned index is only valid until next call to AddKey.

See Also

CKMorphKey.


CKMorphController::Evaluate

Pure Virtual Method Method CKMorphController::Evaluate

virtual CKBOOL CKMorphController::Evaluate(float TimeStep,int VertexCount,void* VertexPtr,CKDWORD VertexStride,VxCompressedVector* NormalPtr)

Evaluates the vertex position at a given time

Parameters

Input argument TimeStep | Time value at which interpolation should be done.
Input argument VertexPtr | A pointer to positions that will be filled.
Input argument VertexStride | Amount in bytes between each position in VertexPtr.
Input argument NormalPtr | A pointer to an array of VxCompressedVector that will be filled with the resulting normals.

Returns

TRUE if successful, FALSE otherwise (no keys for example).

Remarks

According to the type of controller res is a pointer to:

A VxVector for position and scale controllers A VxQuaternion for rotation and off axis scale controllers. This method can not be called in this version for morph controllers (See CKMorphController)

See Also

AddKey


CKMorphController::SetMorphVertexCount

Pure Virtual Method Method CKMorphController::SetMorphVertexCount

virtual void CKMorphController::SetMorphVertexCount(int count)

Sets the number of vertices per key.


CKAnimation

CKKeyedAnimation

CKObject

CKSceneObject
Show full derivation trees

CKAnimation

Subclasses

CKKeyedAnimation

Remarks

CKAnimation is a virtual class that provides the base methods used for character animations. Miscellaneous flags are accessible to specify whereas the animation should be played at a fixed framerate, if the character should align its orientation with the orientation of the root contained in the animation. For more details about characters and their animation management see CKCharacter.

An Animation may be maded up of two other blended animations, the resulting animation depends on a float factor between 0 and 1. If 0 the merged animation is equal to the first animation and if 1 it is equal to the second. A factor of 0.5 gives a smooth blending between the two initial animations. One can use this to create a universal grab animation for example maded up of 4 initial animations ( grab right,grab left,grab high,grab low) then according to where the grabbing occurs we calculate the two merge factors (right-left,low-high) so that the resulting animation grab at the right place.

For a character, animation transitions often occur. These transitions may be brutal or smooth using motion warping. Motion warping creates on the fly a transition animation between the current character animation and the desired animation.

An animation has a length which can be time dependend or not. For example an animation of 60 frames can be played at a fixed frame rate (eg with LinkToFrameRate(TRUE,60) the animation will be played in exactly 1 second (60 frame per second)) or can be completly process dependendant in which case the animation is played at 1 frame per (behavior+render) process which is never sure to give a constant speed according to what is on screen.

The class id of CKAnimation is CKCID_ANIMATION.

Groups

Stepping Along | Settings | Animation Blending | Character Animations | Animation blending | Cast operator | Transition Animation

Stepping Along
Pure Virtual Method Method GetFrame | Returns the current position of the animation.
Pure Virtual Method Method GetLength | Returns the total length.
Pure Virtual Method Method GetNextFrame | Returns the expected next frame.
Pure Virtual Method Method GetStep | Returns the current progression of the animation.
Pure Virtual Method Method SetCurrentStep | Sets the current progression.
Pure Virtual Method Method SetFrame | Sets the current position of animation
Pure Virtual Method Method SetLength | Sets the total length of the animation.
Pure Virtual Method Method SetStep | Sets the current progression of the animation
Settings
Pure Virtual Method Method GetFlags | Returns the animation flags.
Pure Virtual Method Method GetLinkedFrameRate | Returns the linked frame rate value.
Pure Virtual Method Method IsLinkedToFrameRate | Checks whether the animation is linked to frame rate.
Pure Virtual Method Method LinkToFrameRate | Links the play back of the animation to the frame rate.
Pure Virtual Method Method SetCanBeInterrupt | Forces the animation to be played entirely.
Pure Virtual Method Method SetFlags | Sets the animation flags.
Animation Blending
Character Animations
Virtual Method Method CenterAnimation | Recenter the animation data.
Pure Virtual Method Method GetCharacter | Returns the owner character of the animation.
Pure Virtual Method Method GetRootEntity | Returns the root entity of the animation.
Pure Virtual Method Method SetCharacterOrientation | Sets whether the character should take orientation from this animation.
Pure Virtual Method Method SetSecondaryAnimationMode | Sets the transition mode for secondary animations.
Pure Virtual Method Method SetTransitionMode | Sets the transition mode for primary animations.
Animation blending
Virtual Method Method CreateMergedAnimation | Blend another animation with the current animation.
Virtual Method Method GetMergeFactor | Returns the blending factor of blended animation.
Virtual Method Method IsMerged | Checks if the animation is blended or not.
Virtual Method Method SetMergeFactor | Sets the blending factor of blended animation.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Transition Animation
Virtual Method Method CreateTransition | Creates this animation as a transition between two others.

See Also

CKKeyedAnimation,CKCharacter,Using Animations,Using Characters


CKAnimation::GetFrame

Pure Virtual Method Method CKAnimation::GetFrame

virtual float CKAnimation::GetFrame()

Returns the current position of the animation.

Returns

Current Frame

See Also

SetStep,GetStep,SetFrame,Getlength


CKAnimation::GetLength

Pure Virtual Method Method CKAnimation::GetLength

virtual float CKAnimation::GetLength()

Returns the total length.

Returns

Length of the animation.

See Also

SetLength,GetFrame,SetStep,SetFrame


CKAnimation::GetNextFrame

Pure Virtual Method Method CKAnimation::GetNextFrame

virtual float CKAnimation::GetNextFrame(float delta_t)

Returns the expected next frame.

Parameters

Input argument delta_t

Time in milliseconds to next process.

Returns

Espected next frame if delta_t milliseconds elapse.

Remarks

According to the animation settings (Linked to frame rate,etc..) the return value is the expected next frame of animation if delta_t milliseconds elapse.

See Also

SetStep,GetFrame,SetFrame,Getlength


CKAnimation::GetStep

Pure Virtual Method Method CKAnimation::GetStep

virtual float CKAnimation::GetStep()

Returns the current progression of the animation.

Returns

Current progression of the animation between 0..1, this value is equivalent to GetFrame()/GetLength()

See Also

SetStep,GetFrame,SetFrame,GetNextFrame,Getlength


CKAnimation::SetCurrentStep

Pure Virtual Method Method CKAnimation::SetCurrentStep

virtual void CKAnimation::SetCurrentStep(float Step)

Sets the current progression.

Remarks

This methods only sets the current progression without actually applying the animation to the concerned entities.

See Also

SetStep


CKAnimation::SetFrame

Pure Virtual Method Method CKAnimation::SetFrame

virtual void CKAnimation::SetFrame(float frame)

Sets the current position of animation

Parameters

Input argument frame

A float between 0 and the length of the animation specifying the current position

Remarks

Calling this method sets the position/orientation/scale of all the entities concerned by this animation.

See Also

SetStep,GetFrame,GetStep,GetNextFrame,Getlength


CKAnimation::SetLength

Pure Virtual Method Method CKAnimation::SetLength

virtual void CKAnimation::SetLength(float nbframe)

Sets the total length of the animation.

Parameters

Input argument nbframe

Length in number of frames of the animation.

Remarks

Changing the length of an animation does not rescale it. For example changing the length of an animation that was previously 40 frames long to 60 frames will only results in nothing happening in the last 20 frames.

See Also

GetLength,SetFrame,SetStep


CKAnimation::SetStep

Pure Virtual Method Method CKAnimation::SetStep

virtual void CKAnimation::SetStep(float step)

Sets the current progression of the animation

Parameters

Input argument step

A float in the range 0..1.

Remarks

SetStep(f) is equivalent to SetFrame(f*GetLength());

See Also

SetStep,GetFrame,GetStep,GetNextFrame,Getlength,SetCurrentStep


CKAnimation::GetFlags

Pure Virtual Method Method CKAnimation::GetFlags

virtual CKDWORD CKAnimation::GetFlags()

Returns the animation flags.

Returns

CK_ANIMATION_FLAGS Flags set for the animation.

Remarks

Most of the flags can be directly asked or set by te appropriate method of CKAnimation.

See Also

SetFlags,CK_ANIMATION_FLAGS


CKAnimation::GetLinkedFrameRate

Pure Virtual Method Method CKAnimation::GetLinkedFrameRate

virtual float CKAnimation::GetLinkedFrameRate()

Returns the linked frame rate value.

Returns

Value of the frame rate for the animation.

Remarks

The returned value indicates the speed at which the animation will be played.

See Also

LinkToFrameRate, IsLinkedToFrameRate


CKAnimation::IsLinkedToFrameRate

Pure Virtual Method Method CKAnimation::IsLinkedToFrameRate

virtual CKBOOL CKAnimation::IsLinkedToFrameRate()

Checks whether the animation is linked to frame rate.

Returns

TRUE if the animation is linked to a given frame rate.

See Also

LinkToFrameRate, GetLinkedFrameRate


CKAnimation::LinkToFrameRate

Pure Virtual Method Method CKAnimation::LinkToFrameRate

virtual void CKAnimation::LinkToFrameRate(CKBOOL link,float fps=30.0f)

Links the play back of the animation to the frame rate.

Parameters

Input argument link | TRUE if animation is linked to frame rate, FALSE otherwise.
Input argument fps | Frame rate per second.

Remarks

+Once an animation is linked to a given frame rate it will be played at the speed given by fps otherwise the default behavior is to play the animation at 1 frame per behavior process which is never sure to be at constant speed. +This method sets or removes the CKANIMATION_LINKTOFRAMERAT flag.

See Also

GetLinkedFrameRate, IsLinkedToFrameRate,GetFlags


CKAnimation::SetCanBeInterrupt

Pure Virtual Method Method CKAnimation::SetCanBeInterrupt

virtual void CKAnimation::SetCanBeInterrupt(CKBOOL can=TRUE)
virtual CKBOOL CKAnimation::CanBeInterrupt()

Forces the animation to be played entirely.

Parameters

Input argument can

TRUE indicates that animation can be interrupted, FALSE indicates that it cannot be interrupted.

Remarks

When dealing with character animations, there are often transitions between an animation and another for example stand,walk,run etc.. but some animations need to be played entirely to be correct such as jump animation for example. Setting this flags ensures no animations can be launched on a character while this one is playing. This method sets or removes the CKANIMATION_CANBEBREAK flag.

See Also

SetFlags,CKCharacter::SetNextActiveAnimation


CKAnimation::SetFlags

Pure Virtual Method Method CKAnimation::SetFlags

virtual void CKAnimation::SetFlags(CKDWORD flags)

Sets the animation flags.

Parameters

Input argument flags

CK_ANIMATION_FLAGS Flags to be set.

Remarks

Most of the flags can be directly asked or set by te appropriate method of CKAnimation.

See Also

GetFlags,CK_ANIMATION_FLAGS


CKAnimation::CenterAnimation

Virtual Method Method CKAnimation::CenterAnimation

virtual void CKAnimation::CenterAnimation(float fram)

Recenter the animation data.

Remarks

Replacement

This method translates the animation data for the root entity so that, at the given fram, the local position of the root is (0,0,0).


CKAnimation::GetCharacter

Pure Virtual Method Method CKAnimation::GetCharacter

virtual CKCharacter *CKAnimation::GetCharacter()

Returns the owner character of the animation.

Returns

A pointer to the character.

Remarks

If an animation is not assigned to a character it is called a global animation.


CKAnimation::GetRootEntity

Pure Virtual Method Method CKAnimation::GetRootEntity

virtual CK3dEntity* CKAnimation::GetRootEntity()

Returns the root entity of the animation.

Returns

A pointer to root entity.

Remarks

When dealing with character animations there must always be one and only one root object that will be used to identify character movements.


CKAnimation::SetCharacterOrientation

Pure Virtual Method Method CKAnimation::SetCharacterOrientation

virtual void CKAnimation::SetCharacterOrientation(CKBOOL orient=TRUE)
virtual CKBOOL CKAnimation::DoesCharacterTakeOrientation()

Sets whether the character should take orientation from this animation.

Parameters

Input argument orient

TRUE sets charater takes orientation, FALSE otherwise.

Remarks

When a animation modifies the orientation of the root entity for example a animation to turn a character to the left you need to set this flag to the character to force it to realign itself with the root entity at the end of the animation otherwise it will keep its current orientation. This method sets or removes the CKANIMATION_ALIGNORIENTATION flag

See Also

SetFlags


CKAnimation::SetSecondaryAnimationMode

Pure Virtual Method Method CKAnimation::SetSecondaryAnimationMode

virtual void CKAnimation::SetSecondaryAnimationMode(CK_SECONDARYANIMATION_FLAGS mode)
virtual CK_SECONDARYANIMATION_FLAGS CKAnimation::GetSecondaryAnimationMode()

Sets the transition mode for secondary animations.

Parameters

Input argument mode

Transition mode to be set.

Remarks

When an animation is to used as a secondary animation on a character the play options (One Shot,Loop,Loop N times,Warping) can be given at play time (CKCharacter::PlaySecondaryAnimation) or set to the animation using this method in which case when playing the secondary animation with CKCharacter::PlaySecondaryAnimation use CKSECONDARYANIMATION_FROMANIMATION.

See Also

GetSecondaryAnimationMode, CKCharacter::PlaySecondaryAnimation,CK_SECONDARYANIMATION_FLAGS


CKAnimation::SetTransitionMode

Pure Virtual Method Method CKAnimation::SetTransitionMode

virtual void CKAnimation::SetTransitionMode(CK_ANIMATION_TRANSITION_MODE mode)
virtual CK_ANIMATION_TRANSITION_MODE CKAnimation::GetTransitionMode()

Sets the transition mode for primary animations.

Parameters

Input argument mode

Transition mode to be set.

Remarks

When an animation is to become active on a character the transition options (Warping,break,loop,etc..) can be given at transition time (CKCharacter::SetNextActiveAnimation) or set once to the animation using this method.

See Also

GetTransitionMode, CKCharacter::SetNextActiveAnimation,CK_ANIMATION_TRANSITION_MODE


CKAnimation::CreateMergedAnimation

Virtual Method Method CKAnimation::CreateMergedAnimation

virtual CKAnimation* CKAnimation::CreateMergedAnimation(CKAnimation *anim2,CKBOOL dynamic=FALSE)

Blend another animation with the current animation.

Parameters

Input argument anim2 | A pointer to the animation to be merged with current animation.
Input argument dynamic | If created animation should be dynamic.

Returns

A pointer to the blended animation object.

Remarks

An Animation may be maded up of two other blended animations, the resulting animation depends on a float factor between 0 and 1.

See Also

GetMergeFactor, SetMergeFactor, IsMerged


CKAnimation::GetMergeFactor

Virtual Method Method CKAnimation::GetMergeFactor

virtual float CKAnimation::GetMergeFactor()

Returns the blending factor of blended animation.

Returns

Merging factor of blended animation.

Remarks

An Animation may be maded up of two other blended animations, the resulting animation depends on a float factor between 0 and 1.

See Also

SetMergeFactor, IsMerged, CreateMergedAnimation


CKAnimation::IsMerged

Virtual Method Method CKAnimation::IsMerged

virtual CKBOOL CKAnimation::IsMerged()

Checks if the animation is blended or not.

Returns

Returns TRUE if animation is blended, FALSE otherwise.

Remarks

An Animation may be maded up of two other blended animations, the resulting animation depends on a float factor between 0 and 1.

See Also

GetMergeFactor, SetMergeFactor, CreateMergedAnimation


CKAnimation::SetMergeFactor

Virtual Method Method CKAnimation::SetMergeFactor

virtual void CKAnimation::SetMergeFactor(float factor)

Sets the blending factor of blended animation.

Parameters

Input argument factor

Merging factor of blended animation to be set.

Remarks

If the factor is 0 the animation is equal to the first animation used for creation, if its 1 the animation is equal to the second animation.

See Also

GetMergeFactor, IsMerged, CreateMergedAnimation


CKAnimation::Cast

Static Object Method CKAnimation::Cast

static CKAnimation* CKAnimation::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKAnimation::CreateTransition

Virtual Method Method CKAnimation::CreateTransition

virtual float CKAnimation::CreateTransition(CKAnimation *in,CKAnimation *out,CKDWORD OutTransitionMode,float length=6.0f,float FrameTo=0)

Creates this animation as a transition between two others.

Parameters

Input argument in | A pointer to the first animation.
Input argument out | A pointer to the second animation.
Input argument OutTransitionMode | A CK_ANIMATION_TRANSITION_MODE Transition mode.
Input argument length | Length of transition animation.
Input argument FrameTo | Destination frame in second animation.

Returns

A value indicating the frame on which the next animation will start.

Remarks

This animation will be a transition animation between in and out. The return value is where (in term of number of frame ) to start the next animation. CK_ANIMATION_TRANSITION_MODE precise the type of transition that will done.

See Also

CK_ANIMATION_TRANSITION_MODE


CKKeyedAnimation

Class CKKeyedAnimation

Group of object animations.

CKObject

CKSceneObject

CKAnimation
Show brief derivation trees

CKKeyedAnimation

CKObject

CKSceneObject

CKAnimation
Show full derivation trees

CKKeyedAnimation

Remarks

A KeyedAnimation is a group of CKObjectAnimation. Each of this CKObjectAnimation applies to a CKdEntity and contain keyframes (Time,Position,Orientation,Scale or Morph) that give the entity movement along time.

The class id of CKKeyedAnimation is CKCID_KEYEDANIMATION.

Groups

Operations
Virtual Method Method AddAnimation | Adds an Object Animation .
Static Object Method Cast | Dynamic Cast method (returns NULL if the object can't be casted)
Virtual Method Method Clear | Removes all ObjectAnimations.
Virtual Method Method GetAnimation | Retrieves an ObjectAnimation entry from its index or entity.
Virtual Method Method GetAnimationCount | Gets the number of Object Animations.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Virtual Method Method RemoveAnimation | Removes an Object Animation.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Virtual Method Method UpdateRoot |

See Also

CKObjectAnimation,CKCharacter


CKKeyedAnimation::AddAnimation

Virtual Method Method CKKeyedAnimation::AddAnimation

virtual CKERROR CKKeyedAnimation::AddAnimation(CKObjectAnimation *anim) CK_PURE

Adds an Object Animation .

Parameters

Input argument anim

A Pointer to CKObjectAnimation to add.

Returns

CK_OK if successful, error code otherwise.

See Also

CKObjectAnimation,CKCharacter


CKKeyedAnimation::Cast

Static Object Method CKKeyedAnimation::Cast

static CKKeyedAnimation* CKKeyedAnimation::Cast(CKObject* iO)

Remarks

Dynamic Cast method (returns NULL if the object can't be casted)


CKKeyedAnimation::Clear

Virtual Method Method CKKeyedAnimation::Clear

virtual void CKKeyedAnimation::Clear() CK_PURE

Removes all ObjectAnimations.

See Also

RemoveAnimation


CKKeyedAnimation::GetAnimation

Virtual Method Method CKKeyedAnimation::GetAnimation

virtual CKObjectAnimation* CKKeyedAnimation::GetAnimation(CK3dEntity *ent) CK_PURE
virtual CKObjectAnimation* CKKeyedAnimation::GetAnimation(int index) CK_PURE

Retrieves an ObjectAnimation entry from its index or entity.

Parameters

Input argument ent | A Pointer to 3d entity from which the ObjectAnimation is to be retrieve.
Input argument index | Index of the ObjectAnimation to be obtained.

Returns

A Pointer to the CKObjectAnimation or NULL if none could be found.

Remarks

Object Animation info contains keyframes data such as Time,Position,Orientation and Scale.

See Also

GetAnimationCount,AddAnimation


CKKeyedAnimation::GetAnimationCount

Virtual Method Method CKKeyedAnimation::GetAnimationCount

virtual int CKKeyedAnimation::GetAnimationCount() CK_PURE

Gets the number of Object Animations.

Returns

Number of ObjectAnimations that are currently available.

See Also

GetAnimation,AddAnimation


CKKeyedAnimation::RemoveAnimation

Virtual Method Method CKKeyedAnimation::RemoveAnimation

virtual CKERROR CKKeyedAnimation::RemoveAnimation(CKObjectAnimation *anim) CK_PURE

Removes an Object Animation.

Parameters

Input argument anim

A Pointer to the CKObjectAnimation to remove.

Returns

CK_OK if successful, error code otherwise.

See Also

AddAnimation,GetAnimationCount,GetAnimation


CKKeyedAnimation::UpdateRoot

Virtual Method Method CKKeyedAnimation::UpdateRoot

virtual void CKKeyedAnimation::UpdateRoot() CK_PURE


CKKinematicChain

Class CKKinematicChain

Kinematic Chain for Inverse Kinematic

CKObject
Show brief derivation trees

CKKinematicChain

CKObject
Show full derivation trees

CKKinematicChain

Remarks

This class provides methods for applying IK to a chain of hierachical bodyparts. To define a KinematicChain you should specify a start effector (parent) and a end effector (child), the chain is defined by all the bodyparts that are between parent and child in the hierarchy. If the two effectors are not linked directly or indirectly via the hierarchy an error occurs.

Once defined you can use KinematicChain methods to make any bodypart of the chain move toward a desired position using IK, that is moving all the bodyparts of the chain according to their joint data so that the designed bodypart position is equal to the desired position.

The class id of CKKinematicChain is CKCID_KINEMATICCHAIN.

Groups

Operations
Pure Virtual Method Method GetChainBodyCount | Returns the number body parts in this chain.
Pure Virtual Method Method GetChainLength | Returns the kinematic chain length.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Pure Virtual Method Method GetEffector | Returns an effector at a given index
Pure Virtual Method Method GetEndEffector | Returns the ending effector of this chain
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Pure Virtual Method Method GetStartEffector | Returns the start effector of this chain.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method SetEndEffector | Sets the ending effector of this chain.
Pure Virtual Method Method SetStartEffector | Sets the start effector of this chain.
Cast operator
Static Object Method Cast | Dynamic cast operator.
IK Solving
Pure Virtual Method Method IKSetEffectorPos | Sets the position of an effector in the kinematic chain.

See Also

CKBodyPart,CKCharacter


CKKinematicChain::GetChainBodyCount

Pure Virtual Method Method CKKinematicChain::GetChainBodyCount

virtual int CKKinematicChain::GetChainBodyCount(CKBodyPart *End=NULL)

Returns the number body parts in this chain.

Parameters

Input argument End

Ending effector of the chain, NULL for the default ending effector

Remarks

Returns the number of bodypart from the starting bodypart to the ending bodypart.

See Also

SetStartEffector, GetChainLength,SetEndEffector


CKKinematicChain::GetChainLength

Pure Virtual Method Method CKKinematicChain::GetChainLength

virtual float CKKinematicChain::GetChainLength(CKBodyPart *End=NULL)

Returns the kinematic chain length.

Parameters

Input argument End

Ending effector of the chain, NULL for the default ending effector.

Remarks

Returns the length of the kinematic chain from the starting bodypart to the ending bodypart.

See Also

SetStartEffector,GetChainBodyCount,SetEndEffector


CKKinematicChain::GetEffector

Pure Virtual Method Method CKKinematicChain::GetEffector

virtual CKBodyPart* CKKinematicChain::GetEffector(int pos)

Returns an effector at a given index

Parameters

Input argument pos

Index of the effector to be obtained.

Remarks

GetEffector(0) returns the start effector and GetEffector(GetChainBodyCount()-1) returns the ending effector.

See Also

GetChainBodyCount


CKKinematicChain::GetEndEffector

Pure Virtual Method Method CKKinematicChain::GetEndEffector

virtual CKBodyPart* CKKinematicChain::GetEndEffector()

Returns the ending effector of this chain

Returns

A CKBodyPart pointer of the end effector.

See Also

GetStartEffector,SetEndEffector


CKKinematicChain::GetStartEffector

Pure Virtual Method Method CKKinematicChain::GetStartEffector

virtual CKBodyPart* CKKinematicChain::GetStartEffector()

Returns the start effector of this chain.

Returns

A CKBodyPart pointer of the start effector.

See Also

SetStartEffector,SetEndEffector


CKKinematicChain::SetEndEffector

Pure Virtual Method Method CKKinematicChain::SetEndEffector

virtual CKERROR CKKinematicChain::SetEndEffector(CKBodyPart*)

Sets the ending effector of this chain.

Parameters

A pointer to the CKBodyPart which will be the end effector of this Kinematic Chain.

Returns

CK_OK if successful, error code otherwise.

See Also

SetStartEffector,GetEndEffector


CKKinematicChain::SetStartEffector

Pure Virtual Method Method CKKinematicChain::SetStartEffector

virtual CKERROR CKKinematicChain::SetStartEffector(CKBodyPart*)

Sets the start effector of this chain.

Parameters

A pointer to the CKBodyPart which will be the start effector of this Kinematic Chain.

Returns

CK_OK if successful, error code otherwise.

See Also

GetStartEffector,SetEndEffector


CKKinematicChain::Cast

Static Object Method CKKinematicChain::Cast

static CKKinematicChain* CKKinematicChain::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKKinematicChain::IKSetEffectorPos

Pure Virtual Method Method CKKinematicChain::IKSetEffectorPos

virtual CKERROR CKKinematicChain::IKSetEffectorPos(VxVector *pos,CK3dEntity *ref=NULL,CKBodyPart *body=NULL)

Sets the position of an effector in the kinematic chain.

Parameters

Input argument pos | A vector representing the targeted position.
Input argument ref | Reference 3D Entity in which pos is given or NULL for world coordinates.
Input argument body | A pointer to BodyPart of the chain that should be moved to pos.

Returns

CK_OK if successful, error code otherwise.

Remarks

This methods moves all the bodyparts from the start effector to body so that body position goes to pos. If body is not specified, the end effector is moved to pos.

See Also

CKBodyPart, CKCharater


CKObjectAnimation

Class CKObjectAnimation

Animation of a 3d Object.

CKObject

CKSceneObject
Show brief derivation trees

CKObjectAnimation

CKObject

CKSceneObject
Show full derivation trees

CKObjectAnimation

Remarks

An ObjectAnimation is made up of keys describing position,orientation or scale at specific times. Animation a 3dObject consists in interpolating between those keys to calculate position/orientation/scale at a given time.

The most frequent use of a CKObjectAnimation is as a part of a CKKeyedAnimation which describes animation for a whole character or for a group of objects.

It contains keyframe data for position,scale and rotation. Each of this data is driven by a given controller which performs the interpolation according to its type (linear,TCB or bezier)

It can also contain keyframe data for morphing in which case a key is the set of vertices (optionnaly normals) to set to the target mesh.

If often occurs that several characters have common animations, to avoid data to be reproduced the common animation can share their keyframe data and only keep target (CK3dEntity) specific data.

Its class id is CKCID_OBJECTANIMATION

Groups

Target 3DEntity | Controllers | Evaluation | Linear keys creation | Data sharing | Misc | Flags | Animation Blending | Cast operator | Stepping Along

Target 3DEntity
Pure Virtual Method Method Get3dEntity | Returns the 3DEntity to which this animation applies
Pure Virtual Method Method Set3dEntity | Sets the 3DEntity to which this animation applies
Controllers
Pure Virtual Method Method CreateController | Creates an animation controller which performs the interpolation according to its type
Pure Virtual Method Method DeleteController | Deletes a controller of specified type.
Pure Virtual Method Method GetBlendShapeController | Gets the nth blend shape controller
Pure Virtual Method Method GetBlendShapeControllerCount | Gets the Number of blend shape controllers. There may be less controllers than blend shape in the target, if all blend shapes are not animated
Pure Virtual Method Method GetBlendShapeControllerTargetBlendShapeName | Gets the name of the blend shape affected by the nth blend shape controller
Pure Virtual Method Method GetMorphController | Gets the Morph controller
Pure Virtual Method Method GetPositionController | Gets the position controller
Pure Virtual Method Method GetRotationController | Gets the rotation controller
Pure Virtual Method Method GetScaleAxisController | Gets the off-axis scale controller
Pure Virtual Method Method GetScaleController | Gets the scale controller
Pure Virtual Method Method HasMorphInfo | Checks whether animation has morph information
Pure Virtual Method Method HasMorphNormalInfo | Checks whether morph has normal information.
Pure Virtual Method Method HasPositionInfo | Checks whether animation has position information.
Pure Virtual Method Method HasRotationInfo | Checks whether animation has rotation information.
Pure Virtual Method Method HasScaleAxisInfo | Checks whether animation has off-axis scale information.
Pure Virtual Method Method HasScaleInfo | Checks whether animation has scale information.
Evaluation
Pure Virtual Method Method EvaluateKeys | Evaluates the keys (rotation, position and scale) at given step
Pure Virtual Method Method EvaluateMorphTarget | Evaluates morph target at given time
Pure Virtual Method Method EvaluatePosition | Evaluates position value at given time
Pure Virtual Method Method EvaluateRotation | Evaluates rotation value at given time
Pure Virtual Method Method EvaluateScale | Evaluates scale value at given time
Pure Virtual Method Method EvaluateScaleAxis | Evaluates scale axis at given time
Linear keys creation
Pure Virtual Method Method AddPositionKey | Adds a linear position key
Pure Virtual Method Method AddRotationKey | Adds rotation key
Pure Virtual Method Method AddScaleAxisKey | Adds off-axis scale key
Pure Virtual Method Method AddScaleKey | Adds scale key
Data sharing
Pure Virtual Method Method Shared | Checks if the animation uses the keyframe data from another animation.
Pure Virtual Method Method ShareDataFrom | Uses the keyframe data from another animation.
Misc
Pure Virtual Method Method ClearAll | Clears all data (Keyframe data + merge info).
Pure Virtual Method Method Clone | Copies an object animation data.
Pure Virtual Method Method Compare | Compares current animation object with a given animation.
Pure Virtual Method Method CreateTransition | Makes this animation a transition animation between two others.
Pure Virtual Method Method GetMorphVertexCount | Gets the number of vertices in morph animation.
Flags
Pure Virtual Method Method GetFlags | Gets specflags of the animation object
Method GetObjectFlags | Returns the current object flags for this object.
Method IsDynamic | Returns if the current object is dynamic (can be deleted or created at runtime).
Method IsToBeDeleted | Returns if the current object is to be deleted.
Method ModifyObjectFlags | Adds or Removes flags for this object.
Pure Virtual Method Method SetFlags | Sets the flags to the animation object
Animation Blending
Pure Virtual Method Method CreateMergedAnimation | Creates a new object animation by blending this animation with another one .
Pure Virtual Method Method GetMergeFactor | Gets merge factor of a blended animation.
Pure Virtual Method Method IsMerged | Checks whether this animation is a blending of two animations
Pure Virtual Method Method SetMergeFactor | Sets merge factor for animation object
Cast operator
Static Object Method Cast | Dynamic cast operator.
Stepping Along
Pure Virtual Method Method GetCurrentStep | Gets the current step of animation.
Pure Virtual Method Method GetLength | Returns the length of the animation.
Pure Virtual Method Method SetLength | Sets te length of the animation.
Pure Virtual Method Method SetStep | Applies the animation to its entity at the given step.

See Also

CKKeyedAnimation


CKObjectAnimation::Get3dEntity

Pure Virtual Method Method CKObjectAnimation::Get3dEntity

virtual CK3dEntity *CKObjectAnimation::Get3dEntity()

Returns the 3DEntity to which this animation applies

Returns

A pointer to the 3dEntity to which this animation applies

See Also

CK3dEntity, Set3dEntity


CKObjectAnimation::Set3dEntity

Pure Virtual Method Method CKObjectAnimation::Set3dEntity

virtual void CKObjectAnimation::Set3dEntity(CK3dEntity *ent)

Sets the 3DEntity to which this animation applies

Parameters

Input argument ent

A pointer to the 3dEntity to which this animation should apply.

See Also

CK3dEntity, Get3dEntity


CKObjectAnimation::CreateController

Pure Virtual Method Method CKObjectAnimation::CreateController

virtual CKAnimController* CKObjectAnimation::CreateController(CKANIMATION_CONTROLLER ControlType, const char* TargetBlendShapeName = NULL)

Creates an animation controller which performs the interpolation according to its type

Parameters

Input argument ControlType | a CKANIMATION_CONTROLLER enum to identify the desired controller type.
Input argument TargetBlendShapeName | If controller is a float controller, give the blend shape name to which that controller must be bound

Returns

The newly created CKAnimController

Remarks

+If a animation controller of the same type already existed, it is deleted and replaced by the newly created. +If no specific type of interpolation is given, a linear controller is created.

See Also

CKAnimController, CKANIMATION_CONTROLLER


CKObjectAnimation::DeleteController

Pure Virtual Method Method CKObjectAnimation::DeleteController

virtual CKBOOL CKObjectAnimation::DeleteController(CKANIMATION_CONTROLLER ControlType, const char* TargetBlendShapeName = NULL)
virtual CKBOOL CKObjectAnimation::DeleteController(CKAnimController *controller)

Deletes a controller of specified type.

Parameters

Input argument ControlType | a CKANIMATION_CONTROLLER enum to identify the controller to delete.
Input argument TargetBlendShapeName | If controller is a float controller, give the blend shape name
Input argument controller | a pointer to the controller to be removed

Returns

TRUE if successful.

Remarks

Only the type of controller (position,rotation,scale,...) in ControlType is used to determine which controller should be deleted.

See Also

CKANIMATION_CONTROLLER,CreateController


CKObjectAnimation::GetBlendShapeController

Pure Virtual Method Method CKObjectAnimation::GetBlendShapeController

virtual CKAnimController* CKObjectAnimation::GetBlendShapeController(int index)

Gets the nth blend shape controller

Returns

A pointer to a CKMorphController or NULL is not available.


CKObjectAnimation::GetBlendShapeControllerCount

Pure Virtual Method Method CKObjectAnimation::GetBlendShapeControllerCount

virtual int CKObjectAnimation::GetBlendShapeControllerCount() const

Gets the Number of blend shape controllers. There may be less controllers than blend shape in the target, if all blend shapes are not animated

Returns

The Number of blend shape controllers


CKObjectAnimation::GetBlendShapeControllerTargetBlendShapeName

Pure Virtual Method Method CKObjectAnimation::GetBlendShapeControllerTargetBlendShapeName

virtual const XString& CKObjectAnimation::GetBlendShapeControllerTargetBlendShapeName(int index) const

Gets the name of the blend shape affected by the nth blend shape controller

Returns

A string


CKObjectAnimation::GetMorphController

Pure Virtual Method Method CKObjectAnimation::GetMorphController

virtual CKMorphController* CKObjectAnimation::GetMorphController()

Gets the Morph controller

Returns

A pointer to a CKMorphController or NULL is not available.

See Also

CKMorphController,CreateController,GetPositionController,GetScaleController,GetRotationController


CKObjectAnimation::GetPositionController

Pure Virtual Method Method CKObjectAnimation::GetPositionController

virtual CKAnimController* CKObjectAnimation::GetPositionController()

Gets the position controller

Returns

A pointer to a CKAnimController or NULL is not available.

See Also

CKAnimController,CreateController,GetScaleController,GetRotationController


CKObjectAnimation::GetRotationController

Pure Virtual Method Method CKObjectAnimation::GetRotationController

virtual CKAnimController* CKObjectAnimation::GetRotationController()

Gets the rotation controller

Returns

A pointer to a CKAnimController or NULL is not available.

See Also

CKAnimController,CreateController,GetPositionController,GetScaleController


CKObjectAnimation::GetScaleAxisController

Pure Virtual Method Method CKObjectAnimation::GetScaleAxisController

virtual CKAnimController* CKObjectAnimation::GetScaleAxisController()

Gets the off-axis scale controller

Returns

A pointer to a CKAnimController or NULL is not available.

See Also

CKAnimController,CreateController,GetPositionController,GetScaleController,GetRotationController


CKObjectAnimation::GetScaleController

Pure Virtual Method Method CKObjectAnimation::GetScaleController

virtual CKAnimController* CKObjectAnimation::GetScaleController()

Gets the scale controller

Returns

A pointer to a CKAnimController or NULL is not available.

See Also

CKAnimController,CreateController,GetPositionController,GetRotationController


CKObjectAnimation::HasMorphInfo

Pure Virtual Method Method CKObjectAnimation::HasMorphInfo

virtual CKBOOL CKObjectAnimation::HasMorphInfo()

Checks whether animation has morph information

Remarks

+For a standard animation this method checks if a Morph controller is available. +If the animation is a merged animation, the method returns TRUE if any one of the merged animations has a morph controller.

See Also

HasMorphNormalInfo,GetMorphController


CKObjectAnimation::HasMorphNormalInfo

Pure Virtual Method Method CKObjectAnimation::HasMorphNormalInfo

virtual CKBOOL CKObjectAnimation::HasMorphNormalInfo()

Checks whether morph has normal information.

Remarks

+For a standard animation this method checks if a Morph controller is available and have normals information. +If the animation is a merged animation, the method returns TRUE if any one of the merged animations has a morph controller with normals information.

See Also

HasMorphInfo,GetMorphController


CKObjectAnimation::HasPositionInfo

Pure Virtual Method Method CKObjectAnimation::HasPositionInfo

virtual CKBOOL CKObjectAnimation::HasPositionInfo()

Checks whether animation has position information.

Remarks

+For a standard animation this method checks if a Position controller is available. +If the animation is a merged animation, the method returns TRUE if any one of the merged animations has Position information.

See Also

HasScaleInfo,HasRotationInfo,GetPositionController


CKObjectAnimation::HasRotationInfo

Pure Virtual Method Method CKObjectAnimation::HasRotationInfo

virtual CKBOOL CKObjectAnimation::HasRotationInfo()

Checks whether animation has rotation information.

Remarks

+For a standard animation this method checks if a Rotation controller is available. +If the animation is a merged animation, the method returns TRUE if any one of the merged animations has Rotation information.

See Also

HasScaleInfo,HasPositionInfo,GetRotationController


CKObjectAnimation::HasScaleAxisInfo

Pure Virtual Method Method CKObjectAnimation::HasScaleAxisInfo

virtual CKBOOL CKObjectAnimation::HasScaleAxisInfo()

Checks whether animation has off-axis scale information.

Remarks

+For a standard animation this method checks if a off-axis scale controller is available. +If the animation is a merged animation, the method returns TRUE if any one of the merged animations has off-axis scale information.

See Also

HasScaleInfo,HasPositionInfo,GetScaleAxisController


CKObjectAnimation::HasScaleInfo

Pure Virtual Method Method CKObjectAnimation::HasScaleInfo

virtual CKBOOL CKObjectAnimation::HasScaleInfo()

Checks whether animation has scale information.

Remarks

+For a standard animation this method checks if a Scale controller is available. +If the animation is a merged animation, the method returns TRUE if any one of the merged animations has Scale information.

See Also

HasPositionInfo,HasRotationInfo,GetScaleController


CKObjectAnimation::EvaluateKeys

Pure Virtual Method Method CKObjectAnimation::EvaluateKeys

virtual CKBOOL CKObjectAnimation::EvaluateKeys(float step,VxQuaternion *rot,VxVector *pos,VxVector *scale,VxQuaternion *ScaleRot=NULL)

Evaluates the keys (rotation, position and scale) at given step

Parameters

Input argument step | Step at which the keys has to be evaluated (in the interval 0..1).
Input argument rot | A VxQuaternion pointer, to be filled with Rotation.
Input argument pos | A VxVector pointer, to be filled with Position.
Input argument scale | A VxVector pointer, to be filled with Scale.
Input argument ScaleRot | A VxQuaternion pointer, to be filled with off-axis Scale.

Returns

TRUE, if successful, FALSE otherwise.

Remarks

+All pointers parameter are optionnal and can be set to NULL is some values are not desired. +This method is a combination of services provided by EvaluatePosition, EvaluateRotation, EvaluateScale, EvaluateScaleAxis.

See Also

EvaluatePosition,EvaluateRotation, EvaluateScale, EvaluateScaleAxis.


CKObjectAnimation::EvaluateMorphTarget

Pure Virtual Method Method CKObjectAnimation::EvaluateMorphTarget

virtual CKBOOL CKObjectAnimation::EvaluateMorphTarget(float Time,int VertexCount,VxVector* Vertices,CKDWORD VStride,VxCompressedVector* Normals)

Evaluates morph target at given time

Parameters

Input argument Time | Time at which the morph target has to be evaluated.
Input argument VertexCount | Number of vertices to be returned.
Input argument Vertices | Vertices to be filled in VxVector.
Input argument VStride | Amount in bytes between positions in the Vertices array.
Input argument Normals | A pointer to a VxCompressedVector array that will be filled with normals.

Returns

TRUE if successful, FALSE otherwise (No morph controller).

See Also

GetMorphController


CKObjectAnimation::EvaluatePosition

Pure Virtual Method Method CKObjectAnimation::EvaluatePosition

virtual CKBOOL CKObjectAnimation::EvaluatePosition(float Time,VxVector& Pos)

Evaluates position value at given time

Parameters

Input argument Time | Time at which the position has to be evaluated.
Input argument Pos | A VxVector, to be filled with the position.

Returns

TRUE if successful, FALSE otherwise (No Position controller).

Remarks

If the animation is merged with another animation, then position is evaluated on the basis of both animations, else the position of the individual animation is evaluated.

See Also

EvaluateScale,EvaluateRotation,EvaluateScaleAxis,EvaluateKeys


CKObjectAnimation::EvaluateRotation

Pure Virtual Method Method CKObjectAnimation::EvaluateRotation

virtual CKBOOL CKObjectAnimation::EvaluateRotation(float Time,VxQuaternion& Rot)

Evaluates rotation value at given time

Parameters

Input argument Time | Time at which the rotation has to be evaluated.
Input argument Rot | A VxQuaternion, to be filled with Rotation vector.

Returns

TRUE if successful, FALSE otherwise (No Rotation controller).

Remarks

If the animation is merged with another animation, then rotation vector is evaluated on the basis of both animations, else the rotation of the individual animation is evaluated.

See Also

EvaluatePosition,EvaluateScale,EvaluateScaleAxis,EvaluateKeys


CKObjectAnimation::EvaluateScale

Pure Virtual Method Method CKObjectAnimation::EvaluateScale

virtual CKBOOL CKObjectAnimation::EvaluateScale(float Time,VxVector& Scl)

Evaluates scale value at given time

Parameters

Input argument Time | Time at which the Scale has to be evaluated.
Input argument Scl | A VxVector to be filled with the Scale value.

Returns

TRUE if successful, FALSE otherwise (No Scale controller).

See Also

EvaluatePosition,EvaluateRotation,EvaluateScaleAxis,EvaluateKeys


CKObjectAnimation::EvaluateScaleAxis

Pure Virtual Method Method CKObjectAnimation::EvaluateScaleAxis

virtual CKBOOL CKObjectAnimation::EvaluateScaleAxis(float Time,VxQuaternion& ScaleAxis)

Evaluates scale axis at given time

Parameters

Input argument Time | Time at which the Scale Axis has to be evaluated.
Input argument ScaleAxis | Scale Axis to be filled in VxQuaternion

Returns

TRUE if successful, FALSE otherwise (No off-axis scale controller).

See Also

EvaluatePosition,EvaluateRotation,EvaluateScale,EvaluateKeys


CKObjectAnimation::AddPositionKey

Pure Virtual Method Method CKObjectAnimation::AddPositionKey

virtual void CKObjectAnimation::AddPositionKey (float TimeStep,VxVector* pos)

Adds a linear position key

Parameters

Input argument TimeStep | Time step at which the new position key has to be added.
Input argument pos | A VxVector pointer specifying the position.

Remarks

+Adds new position key to the Key frame data with the given time step and position +This method automatically creates a linear position controller if it was not available. +This method is left here as a shortcut to create linear keys to use other types of interpolation, create the appropriate controller with CreateController and use the AddKey method on the created CKAnimController.

See Also

CKAnimController,CreateController


CKObjectAnimation::AddRotationKey

Pure Virtual Method Method CKObjectAnimation::AddRotationKey

virtual void CKObjectAnimation::AddRotationKey (float TimeStep,VxQuaternion* rot)

Adds rotation key

Parameters

Input argument TimeStep | Time step at which the new rotation key has to be added.
Input argument rot | A VxQuaternion pointer specifying the rotation.

Remarks

+Adds new rotation key to the Key frame data with the given time step and rotation +This method automatically creates a linear rotation controller if it was not available. +This method is left here as a shortcut to create linear keys to use other types of interpolation, create the appropriate controller with CreateController and use the AddKey method on the created CKAnimController.

See Also

CKAnimController,CreateController,AddPositionKey,AddScaleKey,AddScaleAxisKey


CKObjectAnimation::AddScaleAxisKey

Pure Virtual Method Method CKObjectAnimation::AddScaleAxisKey

virtual void CKObjectAnimation::AddScaleAxisKey (float TimeStep,VxQuaternion* sclaxis)

Adds off-axis scale key

Parameters

Input argument TimeStep | Time step at which the new off-axis scale key has to be added.
Input argument sclaxis | A VxQuaternion pointer specifying the off-axis scale.

Remarks

+Adds new scale axis key to the Key frame data with the given time step and scale axis +This method automatically creates a linear off-axis scale controller if it was not available. +This method is left here as a shortcut to create linear keys to use other types of interpolation, create the appropriate controller with CreateController and use the AddKey method on the created CKAnimController.

See Also

CKAnimController,CreateController,AddPositionKey,AddRotationKey,AddScaleKey


CKObjectAnimation::AddScaleKey

Pure Virtual Method Method CKObjectAnimation::AddScaleKey

virtual void CKObjectAnimation::AddScaleKey (float TimeStep,VxVector* scl)

Adds scale key

Parameters

Input argument TimeStep | Time step at which the new scale key has to be added.
Input argument scl | A VxVector pointer specifying the Scale.

Remarks

+Adds new scale key to the Key frame data with the given time step and scale +This method automatically creates a linear scale controller if it was not available. +This method is left here as a shortcut to create linear keys to use other types of interpolation, create the appropriate controller with CreateController and use the AddKey method on the created CKAnimController.

See Also

CKAnimController,CreateController,AddPositionKey,AddRotationKey,AddScaleAxisKey


CKObjectAnimation::Shared

Pure Virtual Method Method CKObjectAnimation::Shared

virtual CKObjectAnimation* CKObjectAnimation::Shared()

Checks if the animation uses the keyframe data from another animation.

Returns

A pointer to the shared object animation or NULL is this animation uses its own keyframe data.

See Also

ShareDataFrom


CKObjectAnimation::ShareDataFrom

Pure Virtual Method Method CKObjectAnimation::ShareDataFrom

virtual CKBOOL CKObjectAnimation::ShareDataFrom(CKObjectAnimation* anim)

Uses the keyframe data from another animation.

Parameters

Input argument anim

A Pointer to the animation object to use the keyframe data of.

Remarks

+Using this methods deletes all the existing data and controllers to use the same data than anim. +The two animations will only differ in the entity to which they apply.

See Also

Shared


CKObjectAnimation::ClearAll

Pure Virtual Method Method CKObjectAnimation::ClearAll

virtual void CKObjectAnimation::ClearAll()

Clears all data (Keyframe data + merge info).


CKObjectAnimation::Clone

Pure Virtual Method Method CKObjectAnimation::Clone

virtual void CKObjectAnimation::Clone(CKObjectAnimation *anim)

Copies an object animation data.

Parameters

Input argument anim

Pointer to animation object to be copied.


CKObjectAnimation::Compare

Pure Virtual Method Method CKObjectAnimation::Compare

virtual CKBOOL CKObjectAnimation::Compare(CKObjectAnimation* anim,float threshold=0.0f)

Compares current animation object with a given animation.

Parameters

Input argument anim | A Pointer to the animation object to compare.
Input argument threshold | Threshold value.

Returns

TRUE, if both are equal, FALSE otherwise.

Remarks

The threshold is used to determine the accepted error between two vector to say they are equal.

See Also

RCKObjectAnimation


CKObjectAnimation::CreateTransition

Pure Virtual Method Method CKObjectAnimation::CreateTransition

virtual void CKObjectAnimation::CreateTransition(float length,CKObjectAnimation* AnimIn,float StepFrom,CKObjectAnimation * AnimOut,float StepTo,CKBOOL Veloc,CKBOOL DontTurn,CKAnimKey* startingset=NULL)

Makes this animation a transition animation between two others.

Parameters

Input argument length | Length of transition animation.
Input argument AnimIn | A pointer to the first animation.
Input argument StepFrom | Beginning step (0..1) in first animation.
Input argument AnimOut | A pointer to the second animation.
Input argument StepTo | Destination step (0..1) in second animation.
Input argument Veloc | TRUE if Velocity is to be set for the animation, FALSE otherwise.
Input argument DontTurn | if TRUE takes the rotation from out otherwise create a transition from rotation in AnimIn to rotation in AnimOut.
Input argument startingset | this parameter is used internally and should be left to NULL.

Remarks

This methods creates the key frame data to have a transition between AnimIn and AnimOut at the given step.

See Also

RCKObjectAnimation


CKObjectAnimation::GetMorphVertexCount

Pure Virtual Method Method CKObjectAnimation::GetMorphVertexCount

virtual int CKObjectAnimation::GetMorphVertexCount()

Gets the number of vertices in morph animation.

Returns

Number of vertices in a morph key.

Remarks

The number of vertices in the morph animation must be the same than the mesh of the target entity

See Also

CKMorphController::SetMorphVerteCount,Get3dEntity


CKObjectAnimation::GetFlags

Pure Virtual Method Method CKObjectAnimation::GetFlags

virtual CKDWORD CKObjectAnimation::GetFlags()

Gets specflags of the animation object

Returns

A CK_OBJECTANIMATION_FLAGS enumeration combination.

See Also

SetFlags,CK_OBJECTANIMATION_FLAGS


CKObjectAnimation::SetFlags

Pure Virtual Method Method CKObjectAnimation::SetFlags

virtual void CKObjectAnimation::SetFlags(CKDWORD flags)

Sets the flags to the animation object

Parameters

Input argument flags

A CK_OBJECTANIMATION_FLAGS enumeration combination.

See Also

GetFlags,CK_OBJECTANIMATION_FLAGS


CKObjectAnimation::CreateMergedAnimation

Pure Virtual Method Method CKObjectAnimation::CreateMergedAnimation

virtual CKObjectAnimation* CKObjectAnimation::CreateMergedAnimation(CKObjectAnimation *subanim2,CKBOOL Dynamic = FALSE)

Creates a new object animation by blending this animation with another one .

Parameters

Input argument subanim2

Pointer to second animation object.

Returns

A Pointer to the created blended animation, NULL if method failed.

Example

Creates a merged object animation out of two
CKObjectAnimation *Anim1,*Anim2 are supposed to exist and be valid.

   CKObjectAnimation* Merged = Anim1->CreateMergedAnimation(Anim2);

This sets Merged to be the same animation than Anim1
   Merged->SetMergeFactor(0.0f);

This sets Merged to be the same animation than Anim2
   Merged->SetMergeFactor(1.0f);

This sets Merged to be a smooth interpolation between Anim1 and Anim2
   Merged->SetMergeFactor(0.5f);

See Also

IsMerged,SetMergeFactor


CKObjectAnimation::GetMergeFactor

Pure Virtual Method Method CKObjectAnimation::GetMergeFactor

virtual float CKObjectAnimation::GetMergeFactor()

Gets merge factor of a blended animation.

Returns

Merge factor.

Remarks

The merge factor is the amount deciding how much of each source animations is used to produce the blended animation. If the merge factor is 0 this animation is equal to the first animation, if it's 1 it is equal to the second animation , other values result in a smooth interpolation between the two sources animations.

See Also

CreateMergedAnimation,SetMergeFactor,IsMerged,


CKObjectAnimation::IsMerged

Pure Virtual Method Method CKObjectAnimation::IsMerged

virtual CKBOOL CKObjectAnimation::IsMerged()

Checks whether this animation is a blending of two animations

Returns

Value | Meaning
TRUE | if the animation is a composition between two animations,
FALSE | otherwise.

See Also

CreateMergedAnimation,GetMergeFactor


CKObjectAnimation::SetMergeFactor

Pure Virtual Method Method CKObjectAnimation::SetMergeFactor

virtual void CKObjectAnimation::SetMergeFactor(float factor)

Sets merge factor for animation object

Parameters

Input argument factor

Merge factor to be set.

See Also

GetMergeFactor,CreateMergedAnimation


CKObjectAnimation::Cast

Static Object Method CKObjectAnimation::Cast

static CKObjectAnimation* CKObjectAnimation::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKObjectAnimation::GetCurrentStep

Pure Virtual Method Method CKObjectAnimation::GetCurrentStep

virtual float CKObjectAnimation::GetCurrentStep()

Gets the current step of animation.

Returns

current step of animation (0..1).

Remarks

The animation step is the percentage of the current frame on its overal length.

See Also

SetStep


CKObjectAnimation::GetLength

Pure Virtual Method Method CKObjectAnimation::GetLength

virtual float CKObjectAnimation::GetLength()

Returns the length of the animation.

See Also

SetLength,SetFrame


CKObjectAnimation::SetLength

Pure Virtual Method Method CKObjectAnimation::SetLength

virtual void CKObjectAnimation::SetLength(float nbframe)

Sets te length of the animation.

Parameters

Input argument nbframe

Animation length

Remarks

Changing the length of an object animation does not rescale it. For example changing the length of an animation that was previously 40 frames long to 60 frames will only results in nothing happening in the last 20 frames.

See Also

GetLength


CKObjectAnimation::SetStep

Pure Virtual Method Method CKObjectAnimation::SetStep

#define CKANIMATION_FORCESETSTEP 0xFFFFFFFF
virtual CKERROR CKObjectAnimation::SetStep (float step,CKKeyedAnimation *anim=NULL)
virtual CKERROR CKObjectAnimation::SetFrame(float frame,CKKeyedAnimation *anim=NULL)

Applies the animation to its entity at the given step.

Parameters

Input argument step | Step (0..1)
Input argument anim | A pointer to the higher level animation (CKKeyedAnimation) asking to set the current frame.

Remarks

The anim pointer is used to identify the high level animation asking to compute this object animation in case the target entity is the target of another exclusive animation (a character secondary animation for example) See CKBodyPart::GetExclusiveAnimation). It can be set to NULL or CKANIMATION_FORCESETSTEP to force the object animation to be processed even if the entity is flagged as ignoring animations (CK3dEntity::AreAnimationIgnored).

See Also

GetCurrentStep,CKAnimation::SetStep


CK2dEntity

Class CK2dEntity

Base class for 2D objects.

CKObject

CKSceneObject

CKBeObject

CKRenderObject
Show brief derivation trees

CK2dEntity

CKSprite

CKSpriteText

CKObject

CKSceneObject

CKBeObject

CKRenderObject
Show full derivation trees

CK2dEntity

Subclasses

CKSprite

Remarks

This class provides the basic methods used in CKSprite and CKSpriteText to manipulate sprites : Position,Size, Visibility.

2D Entities position and size can be given in two modes : Homogeneous coordinates (SetHomogeneousCoordinates) where the coordinates are in the range (0..1) in which 0 is the left corner of the screen and 1 is the right corner. This mode ensures that whatever the render context size is a sprite will have the same proportional position and size. The other mode is absolute (or screen) coordinates in which the coordinates are given in pixel.

2d Entities are drawn according to their Z order (min Z first up to max Z). The Z order is only used to sort 2dentities among themselves not among 3dentities.

2dEntities can be drawn before 3d entities if they are set as background otherwise they are drawn after 3dEntities.

2dEntities can have material (and texture) associated to them to provide much more functionnalities than sprites but with the limitation of texture sizes (power of 2 dimensions).

The class id of CK2dEntity is CKCID_2DENTITY.

Groups

Size and Position | Cast operator | Cropping | Drawing | Hierarchy | Homogeneous Coordinates | Material | Settings

Size and Position
Virtual Method Method GetHomogeneousRect | Gets the 2d entity rectangle in homogeneous coordinates.
Virtual Method Method GetPosition | Returns the position of 2d entity.
Virtual Method Method GetRect | Gets the 2d entity rectangle in screen coordinates.
Virtual Method Method GetSize | Gets the size of 2d entity.
Virtual Method Method SetHomogeneousRect | Sets the 2d entity rectangle in homogeneous coordinates.
Virtual Method Method SetPosition | Sets the position of 2d entity.
Virtual Method Method SetRect | Sets the 2d entity rectangle in screen coordinates.
Virtual Method Method SetSize | Sets the size of 2d entity.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Cropping
Virtual Method Method GetSourceRect | Gets the cropping rectangle.
Virtual Method Method IsUsingSourceRect | Checks if cropping is enabled or not.
Virtual Method Method SetSourceRect | Sets the cropping rectangle.
Virtual Method Method UseSourceRect | Enables or disables cropping.
Drawing
Virtual Method Method Draw | Draws the 2d entity.
Virtual Method Method Render | Render the 2d entity and its children
Hierarchy
Virtual Method Method GetChild | Returns the child of a 2dEntity
Virtual Method Method GetChildrenCount | Returns the number of children of the 2dEntity
Virtual Method Method GetParent | Returns the parent of a 2dEntity
Virtual Method Method HierarchyParser | Parses the sub hierarchy of an entity.
Virtual Method Method IsRootObject | Checks if the object is root object.
Virtual Method Method SetParent | Sets the parent of a 2dEntity
Homogeneous Coordinates
Virtual Method Method IsHomogeneousCoordinates | Checks whether homogeneous coordinates mode is enabled or not.
Virtual Method Method SetHomogeneousCoordinates | Sets homogeneous coordinates.
Material
Virtual Method Method GetMaterial | Returns the material used to render the 2d entity
Virtual Method Method SetMaterial | Sets the material to use to render the 2d entity
Settings
Virtual Method Method EnableClipToCamera | Forces 2d entity to be clipped by camera viewport.
Virtual Method Method EnableRatioOffset | Sets the origin of sprite position : Viewport or Context
Virtual Method Method GetFlags | Returns the flags of 2d entity.
Virtual Method Method IsBackground | Checks if background property is set.
Virtual Method Method IsClippedToCamera | Checks whether camera clipping is enabled or not.
Virtual Method Method IsClipToParent | Checks if entity is clipped to parent extents.
Virtual Method Method IsPickable | Checks if the 2d entity can be picked.
Virtual Method Method IsRatioOffset | Checks if Ratio offset is enabled
Virtual Method Method ModifyFlags | Modifies the flags of 2d entity.
Virtual Method Method RestoreInitialSize | Restores initial size.
Virtual Method Method SetBackground | Sets the 2d entity background property
Virtual Method Method SetClipToParent | Sets or Clears the clip to parent property
Virtual Method Method SetFlags | Sets the flags for 2d entity.
Virtual Method Method SetPickable | Enables or disables picking of the 2d entity.

See Also

CKSprite,CKSpriteText,Using 2D Entities


CK2dEntity::GetHomogeneousRect

Virtual Method Method CK2dEntity::GetHomogeneousRect

virtual CKERROR CK2dEntity::GetHomogeneousRect(VxRect& rect) CK_PURE

Gets the 2d entity rectangle in homogeneous coordinates.

Parameters

Input argument rect

2d entity rectangle in homogeneous coordinates.

Returns

CK_OK if successful, an error code otherwise

See Also

SetHomogeneousRect,GetRect


CK2dEntity::GetPosition

Virtual Method Method CK2dEntity::GetPosition

virtual CKERROR CK2dEntity::GetPosition(Vx2DVector& vect,CKBOOL hom=FALSE,CK2dEntity* ref=NULL) CK_PURE

Returns the position of 2d entity.

Parameters

Input argument vect | Pointer to Vx2DVector for the entity coordinates, to be filled.
Input argument hom | TRUE to return position in homogeneous coordinates, FALSE for screen coordinates.
Input argument ref | Pointer to the reference 2d entity when screen coordinates are required.

Returns

CK_OK if successful or CKERR_INVALIDPARAMETER otherwise.

Remarks

For homogeneous coordinates, set hom to be TRUE and ref as NULL. For screen cordinates, set hom to be FALSE and ref as pointer to the CK2dEntity (optionnaly).

See Also

SetPosition,GetRect,GetSize


CK2dEntity::GetRect

Virtual Method Method CK2dEntity::GetRect

virtual void CK2dEntity::GetRect(VxRect& rect) CK_PURE

Gets the 2d entity rectangle in screen coordinates.

Parameters

Input argument rect

2d entity rectangle in screen coordinates.

See Also

SetRect,SetHomogeneousRect,GetPosition,GetSize


CK2dEntity::GetSize

Virtual Method Method CK2dEntity::GetSize

virtual CKERROR CK2dEntity::GetSize(Vx2DVector& vect,CKBOOL hom=FALSE) CK_PURE

Gets the size of 2d entity.

Parameters

Input argument vect | Pointer to Vx2DVector for the entity size to be filled.
Input argument hom | TRUE for Homogeneous coordinates mode, FALSE for screen coordinates mode.

Returns

CK_OK if successful or CKERR_INVALIDPARAMETER otherwise.

Remarks

The Vx2DVector argument will return coordinates in pixels or in percentage relative to the screen size, depending on the Homogeneous mode.

See Also

SetSize,GetPosition,GetRect


CK2dEntity::SetHomogeneousRect

Virtual Method Method CK2dEntity::SetHomogeneousRect

virtual CKERROR CK2dEntity::SetHomogeneousRect(const VxRect& rect,CKBOOL KeepChildren = FALSE) CK_PURE

Sets the 2d entity rectangle in homogeneous coordinates.

Parameters

Input argument rect | 2d entity rectangle in homogeneous coordinates.
Input argument KeepChildren | FALSE to update child entities positions, TRUE otherwise.

Returns

CK_OK if successful, an error code otherwise

See Also

GetHomogeneousRect,SetRect


CK2dEntity::SetPosition

Virtual Method Method CK2dEntity::SetPosition

virtual void CK2dEntity::SetPosition(const Vx2DVector& vect,CKBOOL hom=FALSE,CKBOOL KeepChildren = FALSE,CK2dEntity* ref=NULL) CK_PURE

Sets the position of 2d entity.

Parameters

Input argument vect | Pointer to Vx2DVector containing the entity coordinates
Input argument hom | TRUE if given position is in homogeneous coordinates, FALSE for screen coordinates.
Input argument KeepChildren | FALSE to update child entities psoitions, TRUE otherwise.
Input argument ref | Pointer to the reference 2d entity for screen coordinates.

See Also

GetPosition,SetRect,SetSize


CK2dEntity::SetRect

Virtual Method Method CK2dEntity::SetRect

virtual void CK2dEntity::SetRect(const VxRect& rect,CKBOOL KeepChildren = FALSE) CK_PURE

Sets the 2d entity rectangle in screen coordinates.

Parameters

Input argument rect | 2d entity rectangle in screen coordinates.
Input argument KeepChildren | FALSE to update child entities positions, TRUE otherwise.

Remarks

This method directly sets the position and size of the entity.

See Also

GetRect,SetPosition,SetSize


CK2dEntity::SetSize

Virtual Method Method CK2dEntity::SetSize

virtual void CK2dEntity::SetSize(const Vx2DVector& vect,CKBOOL hom=FALSE,CKBOOL KeepChildren = FALSE) CK_PURE

Sets the size of 2d entity.

Parameters

Input argument vect | Pointer to Vx2DVector containing the entity size.
Input argument hom | TRUE for Homogeneous coordinates mode, FALSE for screen coordinates mode.
Input argument KeepChildren | FALSE to update child entities positions, TRUE otherwise.

Remarks

The Vx2DVector is coordinates in pixels or percentage relative to the screen size, depending on the Homogeneous mode.

See Also

GetSize,SetPosition,SetRect.


CK2dEntity::Cast

Static Object Method CK2dEntity::Cast

static CK2dEntity* CK2dEntity::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CK2dEntity* ent = CK2dEntity::Cast(Object);


CK2dEntity::GetSourceRect

Virtual Method Method CK2dEntity::GetSourceRect

virtual void CK2dEntity::GetSourceRect(VxRect& rect) CK_PURE

Gets the cropping rectangle.

Parameters

Input argument rect

2d entity rectangle in screen coordinates.

See Also

SetSourceRect, UseSourceRect, IsUsingSourceRect


CK2dEntity::IsUsingSourceRect

Virtual Method Method CK2dEntity::IsUsingSourceRect

virtual CKBOOL CK2dEntity::IsUsingSourceRect() CK_PURE

Checks if cropping is enabled or not.

Returns

TRUE if cropping is enabled, FALSE otherwise.

Remarks

When cropping is disabled the entire surface of the 2d entity is used to be drawn. If cropping is enabled only the rectangle specified with SetSourceRect will be used.

See Also

SetSourceRect, GetSourceRect, UseSourceRect


CK2dEntity::SetSourceRect

Virtual Method Method CK2dEntity::SetSourceRect

virtual void CK2dEntity::SetSourceRect(VxRect& rect) CK_PURE

Sets the cropping rectangle.

Parameters

Input argument rect

2d entity cropping rectangle in pixels.

Remarks

+Cropping can be used to display only a subpart of a sprite. For example in a 32x32 sprite setting a cropping rectangle of (0,0) - (16,16) will only display the top left corner of the sprite. +Cropping must be enabled with UseSourceRect function for this function to work.

See Also

GetSourceRect, UseSourceRect, IsUsingSourceRect


CK2dEntity::UseSourceRect

Virtual Method Method CK2dEntity::UseSourceRect

virtual void CK2dEntity::UseSourceRect(CKBOOL Use=TRUE) CK_PURE

Enables or disables cropping.

Parameters

Input argument Use

TRUE to enable cropping, FALSE otherwise.

Remarks

+When cropping is disabled the entire surface of the 2d entity is used to be drawn. If cropping is enabled only the rectangle specified with SetSourceRect will be used. +This method sets or removes the CK_2DENTITY_USESRCRECT flag.

See Also

SetSourceRect, GetSourceRect, IsUsingSourceRect


CK2dEntity::Draw

Virtual Method Method CK2dEntity::Draw

virtual CKERROR CK2dEntity::Draw(CKRenderContext* context) CK_PURE

Draws the 2d entity.

Parameters

Input argument context

A pointer to a CKRenderContext on which this entity will be drawn

Returns

CK_OK if successful or an error code otherwise.

Remarks

This methods is automatically called by the Render method. It simply draws the entity on the context without rendering the children or calling the render callbacks.

See Also

Render


CK2dEntity::Render

Virtual Method Method CK2dEntity::Render

virtual CKERROR CK2dEntity::Render(CKRenderContext* context) CK_PURE

Render the 2d entity and its children

Parameters

Input argument context

A pointer to a CKRenderContext on which this entity will be drawn

Returns

CK_OK if successful or an error code otherwise.

Remarks

This methods calls the pre and post render callbacks if there are any and draw the entity calling the Draw method. If the entity has children they are rendered afterwards.

See Also

Draw


CK2dEntity::GetChild

Virtual Method Method CK2dEntity::GetChild

virtual CK2dEntity* CK2dEntity::GetChild(int i) const CK_PURE

Returns the child of a 2dEntity

Parameters

Input argument i

index of the child to return.

Returns

The ith child is available.

See Also

SetParent, GetChildrenCount


CK2dEntity::GetChildrenCount

Virtual Method Method CK2dEntity::GetChildrenCount

virtual int CK2dEntity::GetChildrenCount() const CK_PURE

Returns the number of children of the 2dEntity

Returns

Number of children of the 2dEntity.

See Also

SetParent, GetChild


CK2dEntity::GetParent

Virtual Method Method CK2dEntity::GetParent

virtual CK2dEntity* CK2dEntity::GetParent() const CK_PURE

Returns the parent of a 2dEntity

Returns

The parent of the 2D Entity, NULL if not.

See Also

SetParent


CK2dEntity::HierarchyParser

Virtual Method Method CK2dEntity::HierarchyParser

virtual CK2dEntity* CK2dEntity::HierarchyParser(CK2dEntity* current) const CK_PURE

Parses the sub hierarchy of an entity.

Parameters

Input argument current

Current object in the hierarchy (must start at NULL).

Returns

Child entity.

Remarks

This method enables you to iterate among the complete hierarchy of an entity.

Example

This sample iterates the hierarchy of Entity
and search for a specific mesh...

       CK2dEntity* Child = NULL;
       while (Child = Entity->HierarchyParser(Child)) {
Do something on the child
       }

See Also

GetChildrenCount,GetChildren


CK2dEntity::IsRootObject

Virtual Method Method CK2dEntity::IsRootObject

virtual CKBOOL CK2dEntity::IsRootObject() CK_PURE

Checks if the object is root object.

Returns

TRUE if the entity is root, FALSE otherwise.

Remarks

This method returns TRUE if the entity does not have a parent.


CK2dEntity::SetParent

Virtual Method Method CK2dEntity::SetParent

virtual CKBOOL CK2dEntity::SetParent(CK2dEntity* parent) CK_PURE

Sets the parent of a 2dEntity

Parameters

Input argument parent

New parent of the 2D Entity, NULL to set this entity as a root.

Returns

TRUE if successful.

See Also

GetParent


CK2dEntity::IsHomogeneousCoordinates

Virtual Method Method CK2dEntity::IsHomogeneousCoordinates

virtual CKBOOL CK2dEntity::IsHomogeneousCoordinates() CK_PURE

Checks whether homogeneous coordinates mode is enabled or not.

Returns

TRUE if coordinates are homogeneous, FALSE otherwise.

See Also

SetHomogeneousCoordinates


CK2dEntity::SetHomogeneousCoordinates

Virtual Method Method CK2dEntity::SetHomogeneousCoordinates

virtual void CK2dEntity::SetHomogeneousCoordinates(CKBOOL Coord=TRUE) CK_PURE

Sets homogeneous coordinates.

Parameters

Input argument Coord

TRUE to enable homogeneous coordinates FALSE otherwise.

Remarks

  • In homogeneous coordinates mode the positions are given with coordinates between (0..1) relative to screen space.

  • This method sets or removes the CK_2DENTITY_USEHOMOGENEOUSCOORD flag.

See Also

SetFlags,IsHomogeneousCoordinates,SetPosition,SetSize


CK2dEntity::GetMaterial

Virtual Method Method CK2dEntity::GetMaterial

virtual CKMaterial* CK2dEntity::GetMaterial() CK_PURE

Returns the material used to render the 2d entity

Returns

A pointer to the material used or NULL otherwise.

See Also

SetMaterial


CK2dEntity::SetMaterial

Virtual Method Method CK2dEntity::SetMaterial

virtual void CK2dEntity::SetMaterial(CKMaterial* mat) CK_PURE

Sets the material to use to render the 2d entity

Parameters

Input argument mat

A pointer to the CKMaterial.

Remarks

2D entities can use a material (and its texture) to render as an equivalent of a sprite.

See Also

GetMaterial


CK2dEntity::EnableClipToCamera

Virtual Method Method CK2dEntity::EnableClipToCamera

virtual void CK2dEntity::EnableClipToCamera(CKBOOL Clip=TRUE) CK_PURE

Forces 2d entity to be clipped by camera viewport.

Parameters

Input argument Clip

TRUE to enables clipping, FALSE otherwise.

Remarks

o The camera viewport can be smaller than the rendercontext size according to camera apsect ratio. The default behavior of a 2d entity is to be clipped by the rendercontext size, but enabling this flag can force the entity to be clipped against camera viewport. o This method sets or removes the CK_2DENTITY_CLIPTOCAMERAVIEW flag.

See Also

SetFlags, IsClippedToCamera


CK2dEntity::EnableRatioOffset

Virtual Method Method CK2dEntity::EnableRatioOffset

virtual void CK2dEntity::EnableRatioOffset(CKBOOL Ratio=TRUE) CK_PURE

Sets the origin of sprite position : Viewport or Context

Parameters

Input argument Ratio

TRUE to enable ratio offset.

Remarks

  • When RatioOffset is enabled, the 2d entity position origin is on the top right corner of the camera viewport otherwise it is the top right corner of the render context window.

  • This method sets or removes the CK_2DENTITY_RATIOOFFSET flag.

See Also

SetFlags, IsRatioOffset


CK2dEntity::GetFlags

Virtual Method Method CK2dEntity::GetFlags

virtual CKDWORD CK2dEntity::GetFlags() CK_PURE

Returns the flags of 2d entity.

Returns

CK_2DENTITY_FLAGS Flags of the 2d entity.

Remarks

Most of the flags can be directly set or asked by the appropriate method of CK2dEntity.

See Also

SetFlags, ModifyFlags,CK_2DENTITY_FLAGS


CK2dEntity::IsBackground

Virtual Method Method CK2dEntity::IsBackground

virtual CKBOOL CK2dEntity::IsBackground() CK_PURE

Checks if background property is set.

Returns

TRUE if the entity is rendered before 3d geometry, FALSE otherwise.

Remarks

Background entities are drawn before any 3d geometry.

See Also

SetFlags, SetBackground


CK2dEntity::IsClippedToCamera

Virtual Method Method CK2dEntity::IsClippedToCamera

virtual CKBOOL CK2dEntity::IsClippedToCamera() CK_PURE

Checks whether camera clipping is enabled or not.

Returns

TRUE if clipping is enabled, FALSE otherwise.

Remarks

The camera viewport can be smaller than the rendercontext size according to camera apsect ratio. The default behavior of a 2d entity is to be clipped by the rendercontext size, but enabling this flag can force the entity to be clipped against camera viewport.

See Also

SetFlags, EnableClipToCamera


CK2dEntity::IsClipToParent

Virtual Method Method CK2dEntity::IsClipToParent

virtual CKBOOL CK2dEntity::IsClipToParent() CK_PURE

Checks if entity is clipped to parent extents.

Returns

TRUE if the entity is clipped to its parent extents, FALSE otherwise.

See Also

SetFlags, SetClipToParent


CK2dEntity::IsPickable

Virtual Method Method CK2dEntity::IsPickable

virtual CKBOOL CK2dEntity::IsPickable() CK_PURE

Checks if the 2d entity can be picked.

Returns

TRUE if the 2d Entity can be picked, FALSE otherwise.

See Also

SetPickable,SetFlags


CK2dEntity::IsRatioOffset

Virtual Method Method CK2dEntity::IsRatioOffset

virtual CKBOOL CK2dEntity::IsRatioOffset() CK_PURE

Checks if Ratio offset is enabled

Returns

TRUE if Ratio offset is enabled.

Remarks

When RatioOffset is enabled, the 2d entity position origin is on the top right corner of the camera viewport otherwise it is the top right corner of the render context window.

See Also

SetFlags, EnableRatioOffset


CK2dEntity::ModifyFlags

Virtual Method Method CK2dEntity::ModifyFlags

virtual void CK2dEntity::ModifyFlags(CKDWORD add,CKDWORD remove=0) CK_PURE

Modifies the flags of 2d entity.

Parameters

Input argument add | Flags (CK_2DENTITY_FLAGS) to be added for 2d entity.
Input argument remove | Flags to be removed from 2d entity.

Remarks

Most of the flags can be directly set or asked by the appropriate method of CK2dEntity.

See Also

GetFlags, SetFlags,CK_2DENTITY_FLAGS


CK2dEntity::RestoreInitialSize

Virtual Method Method CK2dEntity::RestoreInitialSize

virtual void CK2dEntity::RestoreInitialSize() CK_PURE

Restores initial size.

Remarks

This method is only implemented for sprite and restore the size of the entity to the size of the bitmap that was used to generate the sprite.


CK2dEntity::SetBackground

Virtual Method Method CK2dEntity::SetBackground

virtual void CK2dEntity::SetBackground(CKBOOL back=TRUE) CK_PURE

Sets the 2d entity background property

Parameters

Input argument back

TRUE to set the entity as a background entity, FALSE otherwise.

Remarks

Background entities are drawn before any 3d geometry. This method sets or removes the CK_2DENTITY_BACKGROUND flag.

See Also

SetFlags, IsBackground


CK2dEntity::SetClipToParent

Virtual Method Method CK2dEntity::SetClipToParent

virtual void CK2dEntity::SetClipToParent(CKBOOL clip=TRUE) CK_PURE

Sets or Clears the clip to parent property

Parameters

back :TRUE to clip the entity to its parent extents.

Remarks

  • If clipping is enabled the entity cannot be rendered outside of the extents of its parent.

  • This method sets or removes the CK_2DENTITY_CLIPTOPARENT flag.

See Also

SetFlags, IsClipToParent


CK2dEntity::SetFlags

Virtual Method Method CK2dEntity::SetFlags

virtual void CK2dEntity::SetFlags(CKDWORD Flags) CK_PURE

Sets the flags for 2d entity.

Parameters

Input argument Flags

A combination of CK_2DENTITY_FLAGS to set to the entity.

Remarks

Most of the flags can be directly set or asked by the appropriate method of CK2dEntity.

See Also

GetFlags, ModifyFlags,CK_2DENTITY_FLAGS


CK2dEntity::SetPickable

Virtual Method Method CK2dEntity::SetPickable

virtual void CK2dEntity::SetPickable(CKBOOL Pick=TRUE) CK_PURE

Enables or disables picking of the 2d entity.

Parameters

Input argument Pick

TRUE to enables picking, FALSE to disable.

Remarks

If picking is disabled, the 2d entity will not be returned by CKRenderContext::Pick function. This methods sets or removes the CK_2DENTITY_NOTPICKABLE flag.

See Also

SetFlags, IsPickable


CK3dEntity

Class CK3dEntity

3D objects with behaviors

CKObject

CKSceneObject

CKBeObject

CKRenderObject
Show brief derivation trees

CK3dEntity

CK3dObject

CKBodyPart

CK3dPointCloud

CKCamera

CKTargetCamera

CKCharacter

CKCurve

CKCurvePoint

CKGrid

CKLight

CKTargetLight

CKPlace

CKSprite3D

CKObject

CKSceneObject

CKBeObject

CKRenderObject
Show full derivation trees

CK3dEntity

Subclasses

CK3dObject, CK3dPointCloud, CKCamera, CKCharacter, CKCurve, CKCurvePoint, CKGrid, CKLight, CKPlace, and CKSprite3D

Remarks

The CK3dEntity class is the base class for all behavioral 3D objects. Basically it inherits its behaviors from CKBeObject. It also provides management for a set of potential meshes, and animations.

In order to be visible a CK3dEntity must be added to the current level through CKLevel::AddObject. or if the Entity should not be referenced in the Level through CKRenderContext::AddObject. Adding a 3dEntity to a Level or Scene automatically adds its meshes to the Level/Scene.

CK3dEntity class provides several functions for specifying position,orientation and scale of the entity plus an acces to local and world matrix.

A CK3dEntity may have several callback functions called before and after rendering and the render function may also be replaced by an user function.

A CK3dEntity is displayed using a mesh, called the current mesh. At creation time, no mesh is defined. A mesh should be provided before any display is done. The current mesh can be changed at any time.

A CK3dEntity also maintains a set of meshes that could be used for displaying. The current mesh does not need to be part of this set. This set may be used for example to store the representation of the 3D entity at different resolutions.

The CK3dEntity maintains a list of CKObjectAnimation, which can be accessed and driven by the behaviors attached to the object. The animations can be undefined if no behavior try to access it. The animations can be changed at any time, even while a behavior is active on it. An CKObjectAnimation may also be part of a CKKeyedAnimation (group of animations used to animate a character)

The CK3dEntity may be visible or not. This has no impact on its behaviors. Running behaviors continue to run even if the entity is hidden.

Its class id is CKCID_3DENTITY

Groups

Position Orientation | Hierarchy | Meshes | Animations | Blend shapes | Bounding Volumes | Cast operator | Flags | Operations | Places | Rendering | Settings | Skinning | Tests | Transformations | Utilities

Position Orientation
Virtual Method Method AddScale | Adds scaling to the entity.
Virtual Method Method ChangeReferential | Changes the referential (pivot) of the entity without moving the vertices.
Virtual Method Method ConstructWorldMatrix | Construct a new world or local matrix for the entity.
Virtual Method Method GetInverseWorldMatrix | Returns the inverse of the world transformation matrix.
Virtual Method Method GetLocalMatrix | Returns the local transformation matrix.
Virtual Method Method GetQuaternion | Returns the quaternion giving the entity orientation.
Virtual Method Method GetScale | Returns the scale of this entity.
Virtual Method Method GetWorldMatrix | Returns the world transformation matrix.
Virtual Method Method LookAt | Changes the orientation of this entity so that it faces a point in space.
Virtual Method Method Rotate | Rotates the entity around an axis.
Virtual Method Method SetLocalMatrix | Sets the local transformation matrix.
Virtual Method Method SetOrientation | Sets the orientation of the entity.
Virtual Method Method SetPosition | Sets the position of the moveable
Virtual Method Method SetQuaternion | Sets the orientation of the entity according to a quaternion.
Virtual Method Method SetScale | Sets the scale factors of the entity.
Virtual Method Method SetWorldMatrix | Sets the world transformation matrix.
Virtual Method Method Translate | Translates the entity.
Hierarchy
Virtual Method Method AddChild | Attaches an entity as child of this entity.
Virtual Method Method AddChildren | Attaches a list of entities as children of this entity.
Virtual Method Method CheckIfSameKindOfHierarchy | Compares the hierarchy of two entities.
Virtual Method Method GetChild | Returns child entity according to its index in children list
Virtual Method Method GetChildrenCount | Returns the number of children entity of this entity.
Virtual Method Method GetParent | Returns the parent entity.
Virtual Method Method HierarchyParser | Parses the sub hierarchy of an entity.
Virtual Method Method RemoveChild | Detaches a child entity from its parent.
Virtual Method Method SetParent | Attaches the entity to a new parent in the scene hierarchy.
Meshes
Virtual Method Method AddMesh | Adds the given mesh to the set of potential meshes
Virtual Method Method GetCurrentMesh | Returns the current mesh.
Virtual Method Method GetMesh | Returns a potential mesh according to its index.
Virtual Method Method GetMeshCount | Returns the number of meshes in this entity.
Virtual Method Method RemoveMesh | Removes the given mesh from the set of potential meshes
Virtual Method Method SetCurrentMesh | Sets the current mesh of this entity.
Animations
Virtual Method Method AddObjectAnimation | Adds an animation to the entity
Virtual Method Method GetObjectAnimation | Returns an animation by its index.
Virtual Method Method GetObjectAnimationCount | Returns the number of object animations on this entity.
Virtual Method Method RemoveObjectAnimation | Removes an animation from the entity
Blend shapes
Virtual Method Method GetBlendShapeWeightByIndex | Set the weight value of a blend shape for the current mesh bound to that 3D entity, or 0 if the blend shape index is invalid, or if no mesh was bound to that entity. The blend shape is identified by its index
Virtual Method Method GetBlendShapeWeightByName | Set the weight value of a blend shape for the current mesh bound to that 3D entity, or 0 if the blend shape name is invalid, or if no mesh was bound to that entity. The blend shape is identified by its name
Virtual Method Method SetBlendShapeWeightByIndex | Set the weight value of a blend shape for the current mesh bound to that 3D entity. The blend shape is identified by its index.
Virtual Method Method SetBlendShapeWeightByName | Set the weight value of a blend shape for the current mesh bound to that 3D entity. The blend shape is identified by its name
Bounding Volumes
Virtual Method Method GetBaryCenter | Returns the barycenter of the current mesh of this entity.
Virtual Method Method GetBoundingBox | Returns the bounding box this entity.
Virtual Method Method GetHierarchicalBox | Returns the hierarchical bounding box of this entity and its children.
Virtual Method Method GetRadius | Returns the radius of the mesh currently used by this moveable.
Virtual Method Method SetBoundingBox | Specify a user bounding box for the entity.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Flags
Method GetObjectFlags | Returns the current object flags for this object.
Method IsDynamic | Returns if the current object is dynamic (can be deleted or created at runtime).
Virtual Method Method IsPickable | Returns the state of picking flag
Method IsToBeDeleted | Returns if the current object is to be deleted.
Method ModifyObjectFlags | Adds or Removes flags for this object.
Operations
Static Object Method Cast | Dynamic Cast method (returns NULL if the object can't be casted)
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Virtual Method Method GetOrientation | Returns the entity orientation axes.
Virtual Method Method GetPosition | Returns the entity position in a given referential.
Pure Virtual Method Method IsInRenderContext | Checks if this render object is referenced in a CKRenderContext.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method SetZOrder | Sets the Z order (priority) for this object.
Places
Virtual Method Method GetReferencePlace | Returns the reference place of this entity
Rendering
Virtual Method Method Render | Renders the entity.
Settings
Virtual Method Method GetFlags | Returns the entity flags
Virtual Method Method GetMoveableFlags | Sets the moveable flags
Virtual Method Method IgnoreAnimations | Excludes this entity from animations.
Virtual Method Method ModifyMoveableFlags | Changes the entity flags
Virtual Method Method SetFlags | Sets the entity flags
Virtual Method Method SetPickable | Sets if the entity should be pickable
Virtual Method Method SetRenderAsTransparent | Makes this entity to be rendered as other transparents objects
Skinning
Virtual Method Method CreateSkin | Creates a skin on this entity.
Virtual Method Method DestroySkin | Removes the skin.
Virtual Method Method GetSkin | Returns the current skin applied to this entity.
Virtual Method Method UpdateSkin | Updates the current mesh according to bones position.
Tests
Virtual Method Method IsAllInsideFrustrum | Returns whether the object is entirely inside the view frustum
Virtual Method Method IsAllOutsideFrustrum | return whether the object is entirely outside the view frustum
Virtual Method Method IsInViewFrustrum | Checks if the moveable and its associated mesh are in view frustrum.
Virtual Method Method IsInViewFrustrumHierarchic | Checks if the moveable and its children are in the view frustrum.
Transformations
Virtual Method Method InverseTransform | Transforms a position from another entity coordinates system into this coordinates system.
Virtual Method Method InverseTransformMany | Transforms vectors from another entity coordinates system into this entity coordinates system.
Virtual Method Method Transform | Transforms a vector given in this coordinates system to another entity coordinates.
Virtual Method Method TransformMany | Transforms vectors from this coordinates system into another entity coordinates system.
Utilities
Virtual Method Method GetLastFrameMatrix | Returns the world matrix of this object as it was last rendering frame.
Virtual Method Method GetRenderExtents | Returns the 2D extents of this entity on screen.
Virtual Method Method RayIntersection | Checks if the entity is intersected by a given ray or segment.

See Also

Using 3D Entities,CKMesh,


CK3dEntity::AddScale

Virtual Method Method CK3dEntity::AddScale

virtual void CK3dEntity::AddScale(const VxVector *Scale,CKBOOL KeepChildren=FALSE,CKBOOL Local=TRUE) CK_PURE
virtual void CK3dEntity::AddScale(float X,float Y,float Z,CKBOOL KeepChildren=FALSE,CKBOOL Local=TRUE) CK_PURE

Adds scaling to the entity.

Parameters

Input argument Scale | A VxVector representing the scale factor for each axis.
KeepChildren | TRUE if NOT applied to children, FALSE otherwise

Remarks

When KeepChildren is set to TRUE, children entities of this object will keep their current position/orientation.

See Also

GetScale, AddScale


CK3dEntity::ChangeReferential

Virtual Method Method CK3dEntity::ChangeReferential

virtual void CK3dEntity::ChangeReferential(CK3dEntity *Ref=NULL) CK_PURE

Changes the referential (pivot) of the entity without moving the vertices.

Parameters

Input argument Ref

Referential in which we would like to transform the vertices. NULL to express them in the world referential.

Remarks

Transforms all the vertices positions and normals of all the meshes of the entity so that their world position stays the same in the new given referential . This method can be used to change the pivot or referential of an entity without moving its vertices.

See Also

SetRenderCallBack


CK3dEntity::ConstructWorldMatrix

Virtual Method Method CK3dEntity::ConstructWorldMatrix

virtual CKBOOL CK3dEntity::ConstructWorldMatrix(const VxVector *Pos,const VxVector *Scale,const VxQuaternion *Quat) CK_PURE
virtual CKBOOL CK3dEntity::ConstructWorldMatrixEx(const VxVector *Pos,const VxVector *Scale,const VxQuaternion *Quat,const VxQuaternion *Shear,float Sign) CK_PURE
virtual CKBOOL CK3dEntity::ConstructLocalMatrix(const VxVector *Pos,const VxVector *Scale,const VxQuaternion *Quat) CK_PURE
virtual CKBOOL CK3dEntity::ConstructLocalMatrixEx(const VxVector *Pos,const VxVector *Scale,const VxQuaternion *Quat,const VxQuaternion *Shear,float Sign) CK_PURE

Construct a new world or local matrix for the entity.

Parameters

Input argument Pos | Entity Position.
Input argument Scale | Scale factors.
Input argument Quat | Moveable orientation Shear: Scaling referential

Returns

TRUE if successful.

Remarks

ConstructWorldMatrixEx and ConstructLocaldMatrixEx may generate not orthogonal matrices due to the shear information resulting in deformations.

See Also

SetPosition, SetScale, SetQuaternion


CK3dEntity::GetInverseWorldMatrix

Virtual Method Method CK3dEntity::GetInverseWorldMatrix

virtual const VxMatrix& CK3dEntity::GetInverseWorldMatrix() const CK_PURE

Returns the inverse of the world transformation matrix.

Returns

A reference to the inverse world matrix.

See Also

SetWorldMatrix, GetWorldMatrix, GetLocalMatrix, SetLocalMatrix


CK3dEntity::GetLocalMatrix

Virtual Method Method CK3dEntity::GetLocalMatrix

virtual const VxMatrix& CK3dEntity::GetLocalMatrix() const CK_PURE

Returns the local transformation matrix.

Returns

A reference to the local matrix.

Remarks

+The local transformation matrix gives the position/orientation/scale of the object relatively to its parent entity. If the entity does not have a parent its local matrix is equal to its world matrix.

See Also

SetWorldMatrix,GetWorldMatrix,SetLocalMatrix,GetInverseWorldMatrix


CK3dEntity::GetQuaternion

Virtual Method Method CK3dEntity::GetQuaternion

virtual void CK3dEntity::GetQuaternion(VxQuaternion *Quat,CK3dEntity *Ref=NULL) CK_PURE

Returns the quaternion giving the entity orientation.

Parameters

Input argument Quat | A VxQuaternion that will receive the entity orientation.
Input argument Ref | The referential entity.

Remarks

If referential is NULL, the quaternion defines an orientation relative to the world otherwise the orientation is relative to the moveable Ref referential.

See Also

VxQuaternion,SetQuaternion,SetOrientation


CK3dEntity::GetScale

Virtual Method Method CK3dEntity::GetScale

virtual void CK3dEntity::GetScale(VxVector *Scale, CKBOOL Local=TRUE) CK_PURE

Returns the scale of this entity.

Parameters

Input argument Scale | A pointer to a VxVector that will be filled with the scale factors for each axis.
Input argument Local | TRUE to get local axes scale (Default), FALSE to get world axes scale.


CK3dEntity::GetWorldMatrix

Virtual Method Method CK3dEntity::GetWorldMatrix

virtual const VxMatrix& CK3dEntity::GetWorldMatrix() const CK_PURE

Returns the world transformation matrix.

Returns

A reference to the world matrix.

Remarks

The world transformation matrix gives the position/orientation/scale of the object relatively to the world coordinate system.If the entity does not have a parent its local matrix is equal to its world matrix.

See Also

SetLocalMatrix,GetLocalMatrix,GetWorldMatrix,GetInverseWorldMatrix


CK3dEntity::LookAt

Virtual Method Method CK3dEntity::LookAt

virtual void CK3dEntity::LookAt(const VxVector *Pos,CK3dEntity *Ref=NULL,CKBOOL KeepChildren=FALSE) CK_PURE

Changes the orientation of this entity so that it faces a point in space.

Parameters

Input argument Pos | A VxVector which gives the position of the point to look at.
Input argument Ref | The referential entity in which Pos is given.
Input argument KeepChildren | TRUE if NOT applied to children, FALSE otherwise

Remarks

  • If referential is NULL, the position is defined in world coordinates, otherwise the position is defined in the moveable Ref referential.

  • When KeepChildren is set to TRUE, children entities of this object will keep their current position.

See Also

SetOrientation, GetOrientation


CK3dEntity::Rotate

Virtual Method Method CK3dEntity::Rotate

virtual void CK3dEntity::Rotate(const VxVector *Axis,float Angle,CK3dEntity *Ref = NULL,CKBOOL KeepChildren=FALSE) CK_PURE
virtual void CK3dEntity::Rotate(float X,float Y,float Z,float Angle,CK3dEntity *Ref = NULL,CKBOOL KeepChildren=FALSE) CK_PURE

Rotates the entity around an axis.

Parameters

Input argument Axis | A VxVector defining the axis around which to rotate.
Angle | Angle of rotation.
Ref | The referential entity.
KeepChildren | TRUE if NOT applied to children, FALSE otherwise

Remarks

  • If the referential is NULL, the axis is defined in world coordinates, otherwise it's defined in the moveable Ref referential.

  • When KeepChildren is set to TRUE, children entities of this object will keep their current position.

See Also

SetOrientation, GetOrientation


CK3dEntity::SetLocalMatrix

Virtual Method Method CK3dEntity::SetLocalMatrix

virtual void CK3dEntity::SetLocalMatrix(const VxMatrix& Mat,CKBOOL KeepChildren=FALSE) CK_PURE

Sets the local transformation matrix.

Parameters

Input argument Mat | A VxMatrix giving the orientation, position and scale relative to the entity's parent.
Input argument KeepChildren | TRUE if NOT applied to children, FALSE otherwise

Remarks

+Setting the local transformation matrix automatically updates the world transformation matrix of this entity and all its children (unless KeepChildren is set) +When KeepChildren is set to TRUE, this method will not modify children current position/orientation.

See Also

SetWorldMatrix,GetWorldMatrix,GetLocalMatrix,GetInverseWorldMatrix


CK3dEntity::SetOrientation

Virtual Method Method CK3dEntity::SetOrientation

virtual void CK3dEntity::SetOrientation(const VxVector *Dir,const VxVector *Up,const VxVector *Right=NULL,CK3dEntity *Ref = NULL,CKBOOL KeepChildren=FALSE) CK_PURE

Sets the orientation of the entity.

Parameters

Input argument Dir | A vector defining the z axis (Direction) of the entity.
Input argument Up | A vector defining the y axis ( Up Vector) of the entity.
Input argument Right | A vector defining the x axis ( Right Vector) of the entity.
Input argument Ref | The referential entity.
Input argument KeepChildren | TRUE if NOT applied to children, FALSE otherwise

Remarks

+If referential is NULL, the vectors are defined in world coordinates, otherwise they are defined in the entity Ref referential. +When KeepChildren is set to TRUE, SetOrientation will not modify children current orientation. +Note that the vectors defining the axis do not need to be normalized.

See Also

GetOrientation, Rotate


CK3dEntity::SetPosition

Virtual Method Method CK3dEntity::SetPosition

virtual void CK3dEntity::SetPosition(const VxVector *Pos,CK3dEntity *Ref=NULL,CKBOOL KeepChildren=FALSE) CK_PURE
virtual void CK3dEntity::SetPosition(float X,float Y,float Z,CK3dEntity *Ref=NULL,CKBOOL KeepChildren=FALSE) CK_PURE

Sets the position of the moveable

Parameters

Input argument Pos | A vector defining the new position of the moveable
Ref | The referential moveable.
KeepChildren | TRUE if NOT applied to children, FALSE(Default) otherwise.

Remarks

If referential is NULL, the position is given in world coordinates, otherwise the position is defined in the entity Ref referential. When KeepChildren is set to TRUE, children entity of this object will keep their current position.

See Also

Translate


CK3dEntity::SetQuaternion

Virtual Method Method CK3dEntity::SetQuaternion

virtual void CK3dEntity::SetQuaternion(const VxQuaternion *Quat,CK3dEntity *Ref=NULL,CKBOOL KeepChildren=FALSE,BOOL KeepScale=FALSE) CK_PURE

Sets the orientation of the entity according to a quaternion.

Parameters

Input argument Quat | A VxQuaternion which gives the new orientation.
Input argument Ref | The referential entity.
Input argument KeepChildren | TRUE if NOT applied to children, FALSE otherwise
Input argument KeepScale | TRUE if the current scale should be kept,FALSE to reset scale to (1,1,1).

Remarks

When KeepChildren is set to TRUE, SetQuaternion will not modify children current orientation. If referential is NULL, the quaternion defines an orientation relative to the world otherwise the orientation is relative to the moveable Ref referential.

See Also

VxQuaternion,GetQuaternion,SetOrientation


CK3dEntity::SetScale

Virtual Method Method CK3dEntity::SetScale

virtual void CK3dEntity::SetScale(const VxVector *Scale,CKBOOL KeepChildren=FALSE,CKBOOL Local=TRUE) CK_PURE
virtual void CK3dEntity::SetScale(float X,float Y,float Z,CKBOOL KeepChildren=FALSE,CKBOOL Local=TRUE) CK_PURE

Sets the scale factors of the entity.

Parameters

Input argument Scale | A VxVector representing the scale factor for each axis.
KeepChildren | TRUE if NOT applied to children, FALSE otherwise
Local | TRUE to set local axes scale (Default), FALSE to set world axis scale (can introduce shearing)

Remarks

When KeepChildren is set to TRUE, SetScale will not modify children current position/orientation/scale.

See Also

GetScale, AddScale


CK3dEntity::SetWorldMatrix

Virtual Method Method CK3dEntity::SetWorldMatrix

virtual void CK3dEntity::SetWorldMatrix(const VxMatrix& Mat,CKBOOL KeepChildren=FALSE) CK_PURE

Sets the world transformation matrix.

Parameters

Input argument Mat | A VxMatrix giving the position,orientation and scale.
Input argument KeepChildren | TRUE if NOT applied to children, FALSE otherwise

Remarks

Setting the world transformation matrix automatically updates the local transformation matrix of this entity and all its children (unless KeepChildren is set) When KeepChildren is set to TRUE, this method will not modify children current position/orientation.

See Also

SetLocalMatrix,GetLocalMatrix,GetWorldMatrix,GetInverseWorldMatrix


CK3dEntity::Translate

Virtual Method Method CK3dEntity::Translate

virtual void CK3dEntity::Translate(const VxVector *Vect,CK3dEntity *Ref = NULL,CKBOOL KeepChildren=FALSE) CK_PURE
virtual void CK3dEntity::Translate(float X,float Y,float Z,CK3dEntity *Ref = NULL,CKBOOL KeepChildren=FALSE) CK_PURE

Translates the entity.

Parameters

Input argument Vect | A vector defining the amount to translate the moveable
Ref | The referential moveable.in which the translation vector is defined.
KeepChildren | TRUE if NOT applied to children, FALSE otherwise

Remarks

  • If referential is NULL, Vect is defined in world coordinates, otherwise the position is defined in the moveable Ref referential.

  • When KeepChildren is set to TRUE, children entities of this object will keep their current position/orientation.

See Also

SetPosition, GetPosition.


CK3dEntity::AddChild

Virtual Method Method CK3dEntity::AddChild

virtual CKBOOL CK3dEntity::AddChild(CK3dEntity *Child,CKBOOL KeepWorldPos=TRUE) CK_PURE

Attaches an entity as child of this entity.

Parameters

Input argument Child | Moveable to add as a child of this moveable in the hierarchy.
Input argument KeepWorldPos | TRUE if this moveable must keep the same world position and orientation.

Returns

TRUE if successful, FALSE otherwise.

Remarks

  • Trying to add a child twice to the same entity returns an error. If Child was already child of another entity,it is detached from its previous parent.

  • This method does the exact same thing than Child->SetParent(this)

See Also

AddChildren, RemoveChild, SetParent, GetParent


CK3dEntity::AddChildren

Virtual Method Method CK3dEntity::AddChildren

virtual CKBOOL CK3dEntity::AddChildren(const XObjectPointerArray& Children,CKBOOL KeepWorldPos=TRUE) CK_PURE

Attaches a list of entities as children of this entity.

Parameters

Input argument Children | An array of 3d entity to add as a children of this moveable in the hierarchy.
Input argument KeepWorldPos | TRUE if this entity must keep the same world position and orientation.

Returns

TRUE if successful, FALSE otherwise.

Remarks

  • This method takes a list of objects and attaches them as children of this entity.

  • If some of the entities in the list are already hierarchised the method will not break the current hierarchy amongst the entities (only top level entities will be attached).

See Also

Addchild, RemoveChild, SetParent, GetParent


CK3dEntity::CheckIfSameKindOfHierarchy

Virtual Method Method CK3dEntity::CheckIfSameKindOfHierarchy

virtual CKBOOL CK3dEntity::CheckIfSameKindOfHierarchy(CK3dEntity* Mov,CKBOOL SameOrder=FALSE) const CK_PURE

Compares the hierarchy of two entities.

Parameters

Input argument Mov | A CK3dentity to compare with this entity.
Input argument SameOrder | Each children must be inthe same order in both entities.

Returns

TRUE if the two entities have a similar hierarchy.

Remarks

+This method compares the hierarchy of two entity. +If SameOrder is TRUE two hierarchy are considered the same if each child of Mov has an equal number of child of its counterpart (ie the first child of this entity has the same hierarchy than the first child of Mov,etc..) +If SameOrder is FALSE the order of child is less important. +This method can be used to compare the hierarchy of two characters, if they are the same it is likely that animations could be shared from one to another.

See Also

GetChild,GetChildren,GetParent


CK3dEntity::GetChild

Virtual Method Method CK3dEntity::GetChild

virtual CK3dEntity* CK3dEntity::GetChild(int pos) const CK_PURE

Returns child entity according to its index in children list

Parameters

Input argument pos

Index of the child entity to return

Returns

Child entity.

See Also

GetChildrenCount,GetChildren


CK3dEntity::GetChildrenCount

Virtual Method Method CK3dEntity::GetChildrenCount

virtual int CK3dEntity::GetChildrenCount() const CK_PURE

Returns the number of children entity of this entity.

Returns

The number of children.

See Also

GetChildren,GetChild


CK3dEntity::GetParent

Virtual Method Method CK3dEntity::GetParent

virtual CK3dEntity* CK3dEntity::GetParent() const CK_PURE

Returns the parent entity.

Returns

A pointer to the parent entity or NULL if this entity is a root of the hierarchy.

See Also

AddChildren, RemoveChild, SetParent


CK3dEntity::HierarchyParser

Virtual Method Method CK3dEntity::HierarchyParser

virtual CK3dEntity* CK3dEntity::HierarchyParser(CK3dEntity* current) const CK_PURE

Parses the sub hierarchy of an entity.

Parameters

Input argument current

Current object in the hierarchy (must start at NULL).

Returns

Child entity.

Remarks

This method enables you to iterate among the complete hierarchy of an entity.

Example

This sample iterates the hierarchy of Entity
and search for a specific mesh...

       CK3dEntity* Child = NULL;
       CK3dEntity* Result = NULL;

       while (Child = Entity->HierarchyParser(Child)) {
           if (Child->GetCurrentMesh() == MeshToFound) {
               Result = Child;
           }
       }

See Also

GetChildrenCount,GetChildren


CK3dEntity::RemoveChild

Virtual Method Method CK3dEntity::RemoveChild

virtual CKBOOL CK3dEntity::RemoveChild(CK3dEntity *Mov) CK_PURE

Detaches a child entity from its parent.

Parameters

Input argument Mov

Entity to remove from the children list.

Returns

TRUE if successful, FALSE otherwise.

Remarks

Trying to remove moveable which is not a child of this moveable returns FALSE. Once removed, Mov does not have any parent.

See Also

AddChild, GetChildren, SetParent, GetParent


CK3dEntity::SetParent

Virtual Method Method CK3dEntity::SetParent

virtual CKBOOL CK3dEntity::SetParent(CK3dEntity *Parent,CKBOOL KeepWorldPos=TRUE) CK_PURE

Attaches the entity to a new parent in the scene hierarchy.

Parameters

Input argument Parent | New parent of the entity, if NULL this entity becomes a root object.
Input argument KeepWorldPos | TRUE if this entity must keep the same world position and orientation.

Returns

TRUE if successful, FALSE otherwise.

Remarks

If this entity was previously child of another entity, it is automatically detached from its previous parent.

See Also

GetParent,AddChild,RemoveChild,GetChild


CK3dEntity::AddMesh

Virtual Method Method CK3dEntity::AddMesh

virtual CKERROR CK3dEntity::AddMesh(CKMesh *mesh) CK_PURE

Adds the given mesh to the set of potential meshes

Parameters

Input argument mesh

A pointer to the CKMesh to add.

Returns

CK_OK if success.

Remarks

An entity has a set of potential meshes attached to it, only one can be used for rendering but this set can be used by behavior to manage level of detail.

See Also

Using Meshes,GetCurrentMesh,SetCurrentMesh,GetMesh,GetMeshCount


CK3dEntity::GetCurrentMesh

Virtual Method Method CK3dEntity::GetCurrentMesh

virtual CKMesh* CK3dEntity::GetCurrentMesh() const CK_PURE

Returns the current mesh.

Returns

The mesh that is currently used to render this entity.

See Also

Using Meshes,SetCurrentMesh,GetMeshCount,GetMesh,AddMesh


CK3dEntity::GetMesh

Virtual Method Method CK3dEntity::GetMesh

virtual CKMesh* CK3dEntity::GetMesh(int pos) const CK_PURE

Returns a potential mesh according to its index.

Parameters

Input argument pos

Index of the mesh to return.

Returns

A pointer to a CKMesh

Remarks

An entity has a set of potential meshes attached to it, only one can be used for rendering but this set can be used by behavior to manage level of detail.

See Also

Using Meshes,GetCurrentMesh,SetCurrentMesh,GetMesh,AddMesh


CK3dEntity::GetMeshCount

Virtual Method Method CK3dEntity::GetMeshCount

virtual int CK3dEntity::GetMeshCount() const CK_PURE

Returns the number of meshes in this entity.

Returns

Number of meshes on this entity.

Remarks

An entity can have several potential meshes attached to it, only can be used for rendering but this list can be used to have level of detail on an entity.

See Also

Using Meshes,GetCurrentMesh,SetCurrentMesh,GetMesh,AddMesh


CK3dEntity::RemoveMesh

Virtual Method Method CK3dEntity::RemoveMesh

virtual CKERROR CK3dEntity::RemoveMesh(CKMesh *mesh) CK_PURE

Removes the given mesh from the set of potential meshes

Parameters

Input argument mesh

A pointer to the CKMesh to remove

Returns

CK_OK if success.

Remarks

An entity has a set of potential meshes attached to it, only one can be used for rendering but this set can be used by behavior to manage level of detail.

See Also

Using Meshes,GetCurrentMesh,SetCurrentMesh,GetMesh,GetMeshCount,AddMesh


CK3dEntity::SetCurrentMesh

Virtual Method Method CK3dEntity::SetCurrentMesh

virtual CKMesh* CK3dEntity::SetCurrentMesh(CKMesh *m,CKBOOL add_if_not_here=TRUE) CK_PURE

Sets the current mesh of this entity.

Parameters

Input argument m | A pointer to the CKMesh to use for rendering.
Input argument add_if_not_here | If TRUE adds m to the list of meshes of this entity.

Returns

The mesh that was currently used to render this entity.

Remarks

The current mesh of the entity does not have to be part of the set of potential meshes (temporary representation for example), in which case add_if_not_here can be set to FALSE.

See Also

Using Meshes,GetCurrentMesh,GetMeshCount,GetMesh,AddMesh


CK3dEntity::AddObjectAnimation

Virtual Method Method CK3dEntity::AddObjectAnimation

virtual void CK3dEntity::AddObjectAnimation(CKObjectAnimation *anim) CK_PURE

Adds an animation to the entity

Parameters

Input argument anim

The new animation to attach.

Remarks

You should rather use the CKObjectAnimation::Set3dEntity method which automatically calls this method when necessary. Each 3D entity may have several animations attached to it. These animations can be accessed by behaviors of the entity, to play, stop them, etc... These animations are often part of a CKKeyedAnimation which control a whole character.

See Also

CKObjectAnimation,GetObjectAnimation,GetObjectAnimationCount,RemoveObjectAnimation


CK3dEntity::GetObjectAnimation

Virtual Method Method CK3dEntity::GetObjectAnimation

virtual CKObjectAnimation* CK3dEntity::GetObjectAnimation(int index) const CK_PURE

Returns an animation by its index.

Parameters

Input argument index

Index of the animation to return.

Returns

A pointer to the index th CKObjectAnimation.

See Also

CKObjectAnimation,RemoveObjectAnimation,GetObjectAnimationCount,AddObjectAnimation


CK3dEntity::GetObjectAnimationCount

Virtual Method Method CK3dEntity::GetObjectAnimationCount

virtual int CK3dEntity::GetObjectAnimationCount() const CK_PURE

Returns the number of object animations on this entity.

Returns

Number of animation on this entity.

See Also

CKObjectAnimation,RemoveObjectAnimation,GetObjectAnimation,AddObjectAnimation


CK3dEntity::RemoveObjectAnimation

Virtual Method Method CK3dEntity::RemoveObjectAnimation

virtual void CK3dEntity::RemoveObjectAnimation(CKObjectAnimation *anim) CK_PURE

Removes an animation from the entity

Parameters

Input argument anim

the animation to remove

Remarks

Each 3D entity may have several animations attached to it. These animations can be accessed by behaviors of the entity, to play, stop them, etc...

See Also

CKObjectAnimation,GetObjectAnimation,GetObjectAnimationCount,AddObjectAnimation


CK3dEntity::GetBlendShapeWeightByIndex

Virtual Method Method CK3dEntity::GetBlendShapeWeightByIndex

virtual float CK3dEntity::GetBlendShapeWeightByIndex(int bsIndex) const CK_PURE

Set the weight value of a blend shape for the current mesh bound to that 3D entity, or 0 if the blend shape index is invalid, or if no mesh was bound to that entity. The blend shape is identified by its index

Parameters

Input argument bsIndex

Name of the blend shape in the current mesh

Returns

The blend shape current weight


CK3dEntity::GetBlendShapeWeightByName

Virtual Method Method CK3dEntity::GetBlendShapeWeightByName

virtual float CK3dEntity::GetBlendShapeWeightByName(const XString& name) const CK_PURE

Set the weight value of a blend shape for the current mesh bound to that 3D entity, or 0 if the blend shape name is invalid, or if no mesh was bound to that entity. The blend shape is identified by its name

Parameters

bsIndex: Name of the blend shape in the current mesh

Returns

The blend shape current weight


CK3dEntity::SetBlendShapeWeightByIndex

Virtual Method Method CK3dEntity::SetBlendShapeWeightByIndex

virtual void CK3dEntity::SetBlendShapeWeightByIndex(int bsIndex, float weight) CK_PURE

Set the weight value of a blend shape for the current mesh bound to that 3D entity. The blend shape is identified by its index.

Parameters

Input argument bsIndex | Index of the blend shape in the current mesh
Input argument weight | The weight value. This value will be clamped to [0, 1]

Remarks

When CK3dEntity::SetCurrentMesh is called with a new mesh, all weights are set to 0


CK3dEntity::SetBlendShapeWeightByName

Virtual Method Method CK3dEntity::SetBlendShapeWeightByName

virtual void CK3dEntity::SetBlendShapeWeightByName(const XString& name, float weight) CK_PURE

Set the weight value of a blend shape for the current mesh bound to that 3D entity. The blend shape is identified by its name

Parameters

Input argument weight

The weight value. This value will be clamped to [0, 1]

Remarks

When CK3dEntity::SetCurrentMesh is called with a new mesh, all weights are set to 0


CK3dEntity::GetBaryCenter

Virtual Method Method CK3dEntity::GetBaryCenter

virtual CKBOOL CK3dEntity::GetBaryCenter(VxVector *Pos) CK_PURE

Returns the barycenter of the current mesh of this entity.

Parameters

Input argument Pos

The returned VxVector which represents the barycenter of the mesh.

Returns

FALSE if the 3D Entity does not have a mesh, TRUE otherwise.

Remarks

The barycenter is computed as the average of all the mesh vertices.

See Also

GetRadius, GetBoundingBox, GetHierarchicalBox


CK3dEntity::GetBoundingBox

Virtual Method Method CK3dEntity::GetBoundingBox

virtual const VxBbox& CK3dEntity::GetBoundingBox(CKBOOL Local=FALSE) CK_PURE

Returns the bounding box this entity.

Parameters

Input argument Local

TRUE for local bounding box, FALSE for world bounding box.

Returns

A reference to the bounding box.

Remarks

If Local is set to TRUE the returned box is expressed in local axis aligned coordinates. Otherwise the box min and max coordinates are returned in world axis aligned coordinates which results in a larger box.

See Also

VxBbox, GetRadius, GetBaryCenter, GetHierarchicalBox


CK3dEntity::GetHierarchicalBox

Virtual Method Method CK3dEntity::GetHierarchicalBox

virtual const VxBbox& CK3dEntity::GetHierarchicalBox(CKBOOL Local=FALSE) CK_PURE

Returns the hierarchical bounding box of this entity and its children.

Parameters

Input argument Local

This argument is kept only for compatibility reason and should be always set to FALSE.(TRUE for local bounding box, FALSE for world bounding box)

Returns

A reference to the hierarchical bounding box.

Remarks

+If Local is set to TRUE the returned box is expressed in local axis aligned coordinates. But this box is computed from the extents of the world hierarchical box so it is not as precise as the world box could be. To compute an accurate local hierarchy box, merge the “this” local box with “this” axis aligned bounding boxes of the objects of the hierarchy of “this”. This accurate method requires to parse the meshes of the objects of the hierarchy. Another approximated method would be to merge “this” local box and its children local boxes transformed in “this” referential. The box min and max coordinates are returned in world axis aligned coordinates.

See Also

VxBbox, GetRadius,GetBoundingBox,GetBaryCenter,SetBoundingBox


CK3dEntity::GetRadius

Virtual Method Method CK3dEntity::GetRadius

virtual float CK3dEntity::GetRadius() CK_PURE

Returns the radius of the mesh currently used by this moveable.

Returns

The radius of the moveable, 0 there is no current mesh.

Remarks

Returns the radius of the current mesh used by the entity. The radius is defined as the distance from the midpoint of the mesh to a corner of the mesh's bounding box. This method takes the entity scale factors into account. NOTE: A Sprite3D returns a 0 radius.

See Also

GetBaryCenter, GetBoundingBox, GetHierarchicalBox


CK3dEntity::SetBoundingBox

Virtual Method Method CK3dEntity::SetBoundingBox

virtual CKBOOL CK3dEntity::SetBoundingBox(const VxBbox *BBox,CKBOOL Local=FALSE) CK_PURE

Specify a user bounding box for the entity.

Parameters

Input argument BBox | The VxBbox to set, a NULL value disable the usage of the user bounding box.
Input argument Local | Indicate whether local or world bounding box should be set.

Returns

TRUE if successful, FALSE otherwise.

Remarks

The default bounding box of an entity is the bounding box of its current mesh, you can specify your own bounding box (which will be used for visibility tests) with this method. It is especially useful when using render callback on dummy object (a point) in which case the box should be set according to was it drawn. The particle systems behavior for example use this method to set the bounding box of their emitter as equal to the box that contains all particles.

See Also

VxBbox, GetRadius, GetBaryCenter, GetHierarchicalBox,GetBoundingBox


CK3dEntity::Cast

Static Object Method CK3dEntity::Cast

static CK3dEntity* CK3dEntity::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CK3dEntity::IsPickable

Virtual Method Method CK3dEntity::IsPickable

virtual CKBOOL CK3dEntity::IsPickable() const CK_PURE

Returns the state of picking flag

Returns

TRUE if pickable, FALSE if not.

See Also

CKRenderContext::Pick, IsPickable


CK3dEntity::GetOrientation

Virtual Method Method CK3dEntity::GetOrientation

virtual void CK3dEntity::GetOrientation(VxVector *Dir,VxVector *Up,VxVector *Right=NULL,CK3dEntity *Ref = NULL) CK_PURE

Returns the entity orientation axes.

Parameters

Input argument Dir | A vector that will receive the z axis (Direction) of the entity.
Input argument Up | A vector that will receive the y axis ( Up Vector) of the entity.
Input argument Right | A vector that will receive the x axis ( Right Vector) of the entity.
Input argument Ref | The referential entity in which the vectors will be defined. Reamrks: All arguments are optionnal and be set to NULL.


CK3dEntity::GetPosition

Virtual Method Method CK3dEntity::GetPosition

virtual void CK3dEntity::GetPosition(VxVector *Pos,CK3dEntity *Ref = NULL) const CK_PURE

Returns the entity position in a given referential.

Parameters

Input argument Pos | A pointer to a VxVector that will be filled with the position.
Input argument Ref | An entity in which Pos will be defined.

See Also

SetPosition,GetWorldMatrix


CK3dEntity::GetReferencePlace

Virtual Method Method CK3dEntity::GetReferencePlace

virtual CKPlace *CK3dEntity::GetReferencePlace() const CK_PURE

Returns the reference place of this entity

Returns

A pointer to the reference place of this entity

Remarks

An entity can be attached to a place (as one of its children). Places can be used to perfom portal culling to removes hidden entities in a scene.

See Also

Using Portals,CKPlace,CKPlace::AddEntity


CK3dEntity::Render

Virtual Method Method CK3dEntity::Render

virtual CKBOOL CK3dEntity::Render(CKRenderContext *Dev,CKDWORD Flags=CKRENDER_UPDATEEXTENTS) CK_PURE

Renders the entity.

Parameters

Input argument Dev | A RenderContext which is used to render the entity.
Input argument Flags | See remarks.

Returns

TRUE if successful, FALSE otherwise.

Remarks

This method is automatically called by the framework if the entity is referenced in the scene or render context. This method works as following if entity is visible: first, it calls pre-render callbacks, then it renders the mesh or it calls a user defined procedure and last, it calls post-render callbacks. if Flags contains CKRENDER_UPDATEEXTENTS the bounding box is projected onto the screen to find the extents of the object on screen. if Flags contains CKRENDER_DONTSETMATRIX the current world transformation matrix (See CKRenderContext::SetWorldTransformationMatrix) is left as it is otherwise it is set to the current world matrix of the entity. It can be used to render this entity using a different matrix.

See Also

CKRenderContext::Render,Understanding the Render Loop,IsInViewFrustrum


CK3dEntity::GetFlags

Virtual Method Method CK3dEntity::GetFlags

virtual CKDWORD CK3dEntity::GetFlags() const CK_PURE

Returns the entity flags

Returns

A CKDWORD containing a combination of CK_3DENTITY_FLAGS flags

Remarks

CK_3DENTITY_FLAGS flags contain information about special type of entity such as dummy objects,camera or light targets,etc..

See Also

CK_3DENTITY_FLAGS,SetFlags


CK3dEntity::GetMoveableFlags

Virtual Method Method CK3dEntity::GetMoveableFlags

virtual CKDWORD CK3dEntity::GetMoveableFlags() const CK_PURE

Sets the moveable flags

Parameters

flags : A CKDWORD containing a combination of VX_MOVEABLE_FLAGS flags

Returns

A CKDWORD containing a combination of the entity VX_MOVEABLE_FLAGS flags

Remarks

  • Moveable Flags are used internally by the render engine

  • In order to change a flags you should rather use ModifyMoveableFlags

See Also

VX_MOVEABLE_FLAGS,GetMoveableFlags,ModifyMoveableFlags


CK3dEntity::IgnoreAnimations

Virtual Method Method CK3dEntity::IgnoreAnimations

virtual void CK3dEntity::IgnoreAnimations(CKBOOL ignore=TRUE) CK_PURE
virtual CKBOOL CK3dEntity::AreAnimationIgnored() const CK_PURE

Excludes this entity from animations.

Parameters

Input argument ignore

TRUE if animations should not modify this object.

Remarks

  • If ignore is set to TRUE the entity position and orientation will not be modifiable anymore by animations.

  • This method sets or removes the flag CK_3DENTITY_IGNOREANIMATION


CK3dEntity::ModifyMoveableFlags

Virtual Method Method CK3dEntity::ModifyMoveableFlags

virtual void CK3dEntity::SetMoveableFlags(CKDWORD flags) CK_PURE
virtual CKDWORD CK3dEntity::ModifyMoveableFlags(CKDWORD Add,CKDWORD Remove) CK_PURE

Changes the entity flags

Parameters

Input argument Add | A CKDWORD containing a combination of VX_MOVEABLE_FLAGS flags to add.
Input argument Remove | A CKDWORD containing a combination of VX_MOVEABLE_FLAGS flags to add.

Returns

A CKDWORD containing a combination of the entity new VX_MOVEABLE_FLAGS flags

Remarks

In order to change a flags you should rather use ModifyMoveableFlags than SetMoveableFlags This flags contain hints or render settings that can be given to the render engine

See Also

VX_MOVEABLE_FLAGS,GetMoveableFlags,ModifyMoveableFlags


CK3dEntity::SetFlags

Virtual Method Method CK3dEntity::SetFlags

virtual void CK3dEntity::SetFlags(CKDWORD Flags) CK_PURE

Sets the entity flags

Parameters

Input argument Flags

A CKDWORD containing a combination of CK_3DENTITY_FLAGS flags

Remarks

CK_3DENTITY_FLAGS flags contain information about special type of entity such as dummy objects,camera or light targets,etc..

See Also

CK_3DENTITY_FLAGS,GetFlags


CK3dEntity::SetPickable

Virtual Method Method CK3dEntity::SetPickable

virtual void CK3dEntity::SetPickable(CKBOOL Pick=TRUE) CK_PURE

Sets if the entity should be pickable

Parameters

Input argument Pick

TRUE if pickable, FALSE if not.

Remarks

  • If the flag is set to FALSE, this object is not taken into account by CKRenderContext::Pick method. This way, if picking occurs on this object, nothing will be returnd.

  • This method sets or removes the VX_MOVEABLE_PICKABLE moveable flag.

See Also

VX_MOVEABLE_FLAGS,CKRenderContext::Pick, IsPickable


CK3dEntity::SetRenderAsTransparent

Virtual Method Method CK3dEntity::SetRenderAsTransparent

virtual void CK3dEntity::SetRenderAsTransparent(CKBOOL Trans=TRUE) CK_PURE

Makes this entity to be rendered as other transparents objects

Parameters

Input argument Trans

A Boolean indicating if it should be rendered as transparent objects.

Remarks

o Render Engines may execute special processing for transparents object: In most case they are sorted in Z order before being rendered and are rendered after all non-transparent object. o This function sets VX_MOVEABLE_RENDERLAST moveable flags.

See Also

VX_MOVEABLE_FLAGS,GetMoveableFlags,SetMoveableFlags,ModifyMoveableFlags


CK3dEntity::CreateSkin

Virtual Method Method CK3dEntity::CreateSkin

virtual CKSkin* CK3dEntity::CreateSkin() CK_PURE

Creates a skin on this entity.

Returns

A pointer to newly created CKSkin.

Remarks

A skin is a sort of modifier that can be applied to an entity. It will modify its current mesh vertices according to the position and orientation of a set of bones. This is used to create characters that can be animated using less memory than standard morph animation. See the CKSkin class for more details.

See Also

CKSkin,DestroySkin,UpdateSkin,GetSkin


CK3dEntity::DestroySkin

Virtual Method Method CK3dEntity::DestroySkin

virtual CKBOOL CK3dEntity::DestroySkin() CK_PURE

Removes the skin.

Returns

TRUE if successful, FALSE if the skin does not exist.

See Also

CKSkin,CreateSkin,UpdateSkin,GetSkin


CK3dEntity::GetSkin

Virtual Method Method CK3dEntity::GetSkin

virtual CKSkin* CK3dEntity::GetSkin() const CK_PURE

Returns the current skin applied to this entity.

Returns

A pointer to the CKSkin

See Also

CKSkin,CreateSkin,DestroySkin,UpdateSkin


CK3dEntity::UpdateSkin

Virtual Method Method CK3dEntity::UpdateSkin

virtual CKBOOL CK3dEntity::UpdateSkin() CK_PURE

Updates the current mesh according to bones position.

Returns

TRUE if successful, FALSE if the skin does not exist or is not configured properly.

Remarks

This method is automatically called before rendering this entity if it is visible. It can be use you to force the update of the skin.

See Also

CKSkin,CreateSkin,DestroySkin,GetSkin


CK3dEntity::IsAllInsideFrustrum

Virtual Method Method CK3dEntity::IsAllInsideFrustrum

virtual CKBOOL CK3dEntity::IsAllInsideFrustrum() const CK_PURE

Returns whether the object is entirely inside the view frustum

Returns

TRUE if object is totally visible, FALSE if not.

Remarks

This method only tests the presence of the VX_MOVEABLE_ALLINSIDE moveable flag which is automatically set by the IsInViewFrustrum,IsInViewFrustrumHierarchic and Render methods.

See Also

IsInViewFrustrum, IsInViewFrustrumHierarchic,Render,IsAllInsideFrustrum


CK3dEntity::IsAllOutsideFrustrum

Virtual Method Method CK3dEntity::IsAllOutsideFrustrum

virtual CKBOOL CK3dEntity::IsAllOutsideFrustrum() const CK_PURE

return whether the object is entirely outside the view frustum

Returns

TRUE if object is totally clipped, FALSE if not.

Remarks

This method only tests the presence of the VX_MOVEABLE_OFFSCREEN moveable flag which is automatically set by the IsInViewFrustrum,IsInViewFrustrumHierarchic and Render methods.

See Also

IsInViewFrustrum, IsInViewFrustrumHierarchic,Render,IsAllInsideFrustrum


CK3dEntity::IsInViewFrustrum

Virtual Method Method CK3dEntity::IsInViewFrustrum

virtual CKBOOL CK3dEntity::IsInViewFrustrum(CKRenderContext* Dev,CKDWORD Flags = 0) CK_PURE

Checks if the moveable and its associated mesh are in view frustrum.

Parameters

Input argument Dev | A CKRenderContext which will be used to test the moveable.
Input argument Flags | CKRENDER_UPDATEEXTENTS is the screen extents of the object should be updated and/or CKRENDER_DONTSETMATRIX if the world transformation matrix should not be modified

Returns

TRUE if moveable is visible, FALSE if not.

Remarks

+This function tests the bounding box of the object against the viewing frustrum. It returns TRUE if the object bounding box is partially visible. +if Flags contains CKRENDER_UPDATEEXTENTS the bounding box is projected onto the screen to find the extents of the object on screen. +if Flags contains CKRENDER_DONTSETMATRIX the current world transformation matrix (See CKRenderContext::SetWorldTransformationMatrix) is left as it is otherwise it is set to the world matrix of this entity.

See Also

IsInViewFrustrumHierarchic,IsAllOutsideFrustrum,IsAllInsideFrustrum


CK3dEntity::IsInViewFrustrumHierarchic

Virtual Method Method CK3dEntity::IsInViewFrustrumHierarchic

virtual CKBOOL CK3dEntity::IsInViewFrustrumHierarchic(CKRenderContext* Dev) CK_PURE

Checks if the moveable and its children are in the view frustrum.

Parameters

Input argument Dev

A CKRenderContext which will be used to test the moveable.

Returns

TRUE if moveable and its hierarchy are partially is visible, FALSE if not.

Remarks

This function tests the bounding box of the object and all its hirearchy against the viewing frustrum. It returns TRUE if the bounding box is partially visible.

See Also

IsInViewFrustrum,IsAllOutsideFrustrum,IsAllInsideFrustrum


CK3dEntity::InverseTransform

Virtual Method Method CK3dEntity::InverseTransform

virtual void CK3dEntity::InverseTransform(VxVector *Dest,const VxVector *Src,CK3dEntity *Ref=NULL) const CK_PURE
virtual void CK3dEntity::InverseTransformVector(VxVector *Dest,const VxVector *Src,CK3dEntity *Ref=NULL) const CK_PURE

Transforms a position from another entity coordinates system into this coordinates system.

Parameters

Input argument Dest | A VxVector which will be filled with the transformed vector (can be the same pointer than Src).
Input argument Src | The VxVector to be transformed.
Input argument Ref | The referential entity.

Remarks

If referential is NULL, the source vector Src is defined in world coordinates. The InverseTransform method transforms a position vector (that is it takes entity position into account) while InverseTransformVector transforms a normal vector (only rotation is taken).

See Also

Transform,InverseTransformMany,InverseTransformVector


CK3dEntity::InverseTransformMany

Virtual Method Method CK3dEntity::InverseTransformMany

virtual void CK3dEntity::InverseTransformMany(VxVector *Dest,const VxVector *Src,int count,CK3dEntity *Ref=NULL) const CK_PURE

Transforms vectors from another entity coordinates system into this entity coordinates system.

Parameters

Input argument Dest | An array of VxVector array which will be filled with the transformed vectors
Input argument Src | An array of VxVector to be transformed. Count:Number of Vector to process
Input argument Ref | The referential entity (NULL means world coordinates).

Remarks

Use this function to convert an array of vector instead of calling several times InverseTransform for better performances.

See Also

TransformMany


CK3dEntity::Transform

Virtual Method Method CK3dEntity::Transform

virtual void CK3dEntity::Transform(VxVector *Dest,const VxVector *Src,CK3dEntity *Ref=NULL) const CK_PURE
virtual void CK3dEntity::TransformVector(VxVector *Dest,const VxVector *Src,CK3dEntity *Ref=NULL) const CK_PURE

Transforms a vector given in this coordinates system to another entity coordinates.

Parameters

Input argument Dest | A VxVector which will be filled with the transformed vector (can be the same pointer than Src).
Input argument Src | The VxVector to be transformed.
Input argument Ref | The referential entity.

Remarks

If referential is NULL, the result vector Dest is defined in world coordinates. The Transform method transforms a position vector (that is it takes entity position into account) while TransformVector transforms a normal vector (only rotation is taken).

See Also

InverseTransform,TransformVector,TransformMany


CK3dEntity::TransformMany

Virtual Method Method CK3dEntity::TransformMany

virtual void CK3dEntity::TransformMany(VxVector *Dest,const VxVector *Src,int count,CK3dEntity *Ref=NULL) const CK_PURE

Transforms vectors from this coordinates system into another entity coordinates system.

Parameters

Input argument Dest | An array of VxVector array which will be filled with the transformed vectors
Input argument Src | An array of VxVector to be transformed. Count:Number of Vector to process
Input argument Ref | The referential entity (NULL means world coordinates).

Remarks

Use this function to convert an array of vector instead of calling several times InverseTransform for better performances.

See Also

InverseTransformMany


CK3dEntity::GetLastFrameMatrix

Virtual Method Method CK3dEntity::GetLastFrameMatrix

virtual const VxMatrix& CK3dEntity::GetLastFrameMatrix() const CK_PURE

Returns the world matrix of this object as it was last rendering frame.

Returns

A reference to the saved matrix.

Remarks

+The entity must have CK_3DENTITY_UPDATELASTFRAME flag set in order the matrix to be saved. If the flag is set, the entity world matrix is saved each time a rendering occurs so that if someone calls this method in a behavior it will have the position of this entity as it was last time it was rendered. If the flag is not set and this method is called it will return the current world matrix.

See Also

VxMatrix,SetLocalMatrix, SetWorldMatrix, GetWorldMatrix


CK3dEntity::GetRenderExtents

Virtual Method Method CK3dEntity::GetRenderExtents

virtual void CK3dEntity::GetRenderExtents(VxRect& rect) const CK_PURE

Returns the 2D extents of this entity on screen.

Parameters

Input argument rect

A reference to a VxRect that will be filled with the extents of the object on screen.

Remarks

+Each time a object is rendered, its screen extents are computed, this method does not compute the current extents but returns those that were computed the last time the object was rendered.


CK3dEntity::RayIntersection

Virtual Method Method CK3dEntity::RayIntersection

virtual int CK3dEntity::RayIntersection(const VxVector *Pos1,const VxVector *Pos2,VxIntersectionDesc *Desc,CK3dEntity *Ref,CK_RAYINTERSECTION iOptions = CKRAYINTERSECTION_DEFAULT) CK_PURE

Checks if the entity is intersected by a given ray or segment.

Parameters

Input argument Pos1 | A VxVector that gives the source of the ray.
Input argument Pos2 | Any point located on the ray, if Segment is TRUE this represent the ending point of the segment.
Input argument Desc | The returned VxIntersectionDesc that describes the ray intersection results.
Input argument Ref | The referential frame in which Pos1 and Pos2 are specified.
Input argument iOptions | a combination of the CK_RAYINTERSECTION flags.

Returns

Returns 0 if not intersection occured or the number of faces intersected otherwise.

Remarks

+Checks for intersection between the ray specified by points Pos1 and Pos2 where Pos1 is the origin of the ray and Pos2 is a point on the ray (in Ref's coordinate system). +Desc is the description of the intersection results (if there is one) in the entity's local coordinate system. +if NULL is given for Desc, then the first intersection found exits the function, returning 1 (and not the real number of faces intersected) : This allow faster intersection when only occlusion is looking for. +If referential is NULL, the source vectos Pos1 and Pos2 are defined in world coordinates.

See Also

VxIntersectionDesc


CK3dObject

Class CK3dObject

Base class for 3D objects with geometry

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CK3dObject

CKBodyPart

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CK3dObject

Subclasses

CKBodyPart

Remarks

The CK3dObject does not yet provide new functions compare to CK3dEntity

You are advised to use CK3dObjects for all of your real 3D objects with a geometry. The loading plug-ins of Virtools should all create instances of CK3dObject when loading models imported from foreign formats. Even though you can instanciate CK3dEntity directly, using a CK3dObject provides you with additionnal services that may be increased in future.

The class id of CK3dObject is CKCID_3DOBJECT.

Groups

Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.

See Also

CK3dEntity


CK3dObject::Cast

Static Object Method CK3dObject::Cast

static CK3dObject* CK3dObject::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CK3dPointCloud

Class CK3dPointCloud

Cloud of 3D points.

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CK3dPointCloud

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CK3dPointCloud

Remarks

This class is used to manage and display clouds of 3D points. These points are stored in a tree structure for efficient memory management and can have attribute attached like colors, normal or user defined attributes.

One of these attribute is called the render group (see GetPointRenderGroup). Points can be placed in different render group to have different render options (rendering as a sprite , size of this sprite , usage of a given material, etc..).

The class id of CK3dPointCloud is CKCID_3DPOINTCLOUD.

Groups

Creation | Information | Selection Tools | Rendering | Points attributes access | Standard attributes | User Attributes Types | Cast operator | Operations | Type Definitions

Creation
Virtual Method Method ClearAllData | Deletes all the data stored by the cloud.
Virtual Method Method CreateFromArray | Create the cloud using a data array of points.
Virtual Method Method CreateFromAscFile | Create the cloud using a .Asc file.
Virtual Method Method CreateFromPointList | Create the cloud using an array of points.
Virtual Method Method LoadAttributesFromArray | Create the cloud using a data array of points.
Information
Virtual Method Method GetLoadOffset | Returns the offset that was applied to all the points when loaded from a .asc file.
Virtual Method Method GetLoadScaleFactor | Returns the scale factor that was applied to all the points when loaded from a .asc file.
Virtual Method Method GetMemorySize | Returns the memory taken to store all the points and their attributes.
Virtual Method Method GetPointsCount | Returns the number of points stored.
Virtual Method Method GetVertexBufferCount | Returns the number of vertex buffers allocated to display the cloud.
Virtual Method Method GetVertexBufferMemorySize | Returns the memory taken to store all the vertex buffers.
Selection Tools
Virtual Method Method CreateSelection | Returns an iterator on the root of the tree.
Virtual Method Method GetRootIterator | Returns an iterator on the root of the tree.
Virtual Method Method SelectBox | Selects a list of points within a box.
Virtual Method Method SelectPoint | Selects a list of points within a box.
Virtual Method Method SelectSphere | Selects a list of points within a sphere.
Virtual Method Method SetReferentialPosition | Sets the position of the referential.
Rendering
Virtual Method Method EnableLighting | Enables or disables the lighting of the points
Virtual Method Method GetGlobalPointSize | Returns the size factor for points drawn as sprites.
Virtual Method Method IsLightingEnabled | Returns if the point are lit.
Virtual Method Method Render | Renders the entity.
Virtual Method Method SetGlobalPointSize | Sets the size factor for points drawn as sprites.
Points attributes access
Virtual Method Method GetPointFloatAttribute | Gets the value of an attribute on a point (stored as a float).
Virtual Method Method GetPointIntAttribute | Gets the value of an attribute on a point (stored as an integer).
Virtual Method Method SetPointFloatAttribute | Sets the value of an attribute on a point (stored as a float).
Virtual Method Method SetPointIntAttribute | Sets the value of an attribute on a point (stored as an integer).
Standard attributes
Virtual Method Method GetPointColor | Returns the color of a point in ARGB 8888 format.
Virtual Method Method GetPointIntensity | Returns the intensity of a point.
Virtual Method Method GetPointNormal | Returns the normal of a point.
Virtual Method Method HasColors | Returns if a color is stored per point.
Virtual Method Method HasNormals | Returns if a normal is stored per point.
Virtual Method Method SetPointColor | Sets the color of a point in ARGB 8888 format.
Virtual Method Method SetPointIntensity | Sets the intensity of a point.
Virtual Method Method SetPointNormal | Sets the normal of a point.
Virtual Method Method UseColors | Ensure memory is allocatd to store colors.
Virtual Method Method UseNormals | Ensure memory is allocatd to store normals.
User Attributes Types
Virtual Method Method GetCloudAttributeCount | Returns the number of attribute types on the cloud.
Virtual Method Method GetCloudAttributeDescription | Returns the description of an attribute type.
Virtual Method Method GetCloudAttributeIndexByName | Returns an attribute type from the cloud given its name.
Virtual Method Method IsCloudAttributeInVB | Returns whether the values of an attribute type will be inside the vertex buffer.
Virtual Method Method IsCloudAttributeUsed | Returns whether a attribute type is used.
Virtual Method Method RegisterCloudAttribute | Register a new type of attribute to use on the cloud.
Virtual Method Method SetCloudAttributeDescription | Sets the description of an attribute type.
Virtual Method Method SetCloudAttributeInVB | Sets whether the values of an attribute type should be put inside the vertex buffer.
Virtual Method Method UnRegisterCloudAttribute | Removes an attribute type from the cloud.
Virtual Method Method UseCloudAttribute | Sets the usage of a given attribute type.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Operations
Static Object Method Cast | Dynamic Cast method (returns NULL if the object can't be casted)
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Virtual Method Method GetClipPlane |
Virtual Method Method GetClipPlaneCount |
Virtual Method Method GetGlobalMaterial |
Method GetID | Returns the Identifier for this object
Virtual Method Method GetLOD |
Virtual Method Method GetLODPointCount |
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Virtual Method Method GetOrientation | Returns the entity orientation axes.
Virtual Method Method GetPickingPrecision |
Virtual Method Method GetPosition | Returns the entity position in a given referential.
Virtual Method Method GetSelection |
Virtual Method Method GetSelectionCount |
Pure Virtual Method Method IsInRenderContext | Checks if this render object is referenced in a CKRenderContext.
Virtual Method Method IsMainCloudVisible |
Virtual Method Method IsUsingMaterialColor |
Virtual Method Method IsUsingPointSprite |
Virtual Method Method LoadAttributesFromTextFile |
Virtual Method Method RemoveSelection |
Virtual Method Method SelectCone |
Virtual Method Method SelectConvexObject |
Virtual Method Method SelectConvexObjectGroup |
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Virtual Method Method SetClipPlane |
Virtual Method Method SetClipPlaneCount |
Virtual Method Method SetGlobalMaterial |
Virtual Method Method SetLOD |
Virtual Method Method SetLODPointCount |
Virtual Method Method SetPickingPrecision |
Pure Virtual Method Method SetZOrder | Sets the Z order (priority) for this object.
Virtual Method Method ShowMainCloud |
Virtual Method Method UseMaterialColor |
Virtual Method Method UsePointSprite |
Type Definitions
Enumerated Type DefaultCloudAttribute | Default Point cloud attributes.

See Also

CK3dEntity


CK3dPointCloud::ClearAllData

Virtual Method Method CK3dPointCloud::ClearAllData

virtual CKBOOL CK3dPointCloud::ClearAllData(CKBOOL iKeepAttributes = TRUE, CKBOOL iKeepSelection = TRUE) CK_PURE

Deletes all the data stored by the cloud.

Parameters

Input argument iKeepAttributes | Keeps the attributes definitions.
Input argument iKeepSelection | Keeps the selections definitions.

See Also

CreateFromAscFile,CreateFromArray


CK3dPointCloud::CreateFromArray

Virtual Method Method CK3dPointCloud::CreateFromArray

virtual CKBOOL CK3dPointCloud::CreateFromArray(CKDataArray* iArray,int iColumn1 = 0,int iColumn2 = -1,int iColumn3 = -1) CK_PURE

Create the cloud using a data array of points.

Parameters

Input argument iArray | A pointer to a CKDataArray that contain the points to load.
Input argument iColumn1 | Index of the column that contains the points to load.
Input argument iColumn2 | Optionnal index of the additionnal column when using 3 columns containing floats.
Input argument iColumn3 | Optionnal index of the additionnal column when using 3 columns containing floats.

Remarks

This methods creates a new cloud using the data given in the input iArray. Only point position (a vector) can be specified through this method, additionnal attributes can be read later using LoadAttributesFromArray. The valid format for a data array is to contain either: a column containing strings (slower), a column containing parameters of type vector. 3 columns containing floats. Any other data types will produce an error.

See Also

CreateFromAscFile,LoadAttributesFromTextFile,LoadAttributesFromArray


CK3dPointCloud::CreateFromAscFile

Virtual Method Method CK3dPointCloud::CreateFromAscFile

virtual CKBOOL CK3dPointCloud::CreateFromAscFile(const char* iFileName) CK_PURE

Create the cloud using a .Asc file.

Remarks

This method searches for a file named iFileName.Desc in the same directory than the iFileName file. This *.Desc* file contains the information about the number of points, bounding box, etc... and its syntax is the following:

Version 0
Points 2399432
Format 6
Precision (0.110841,0.122853,0.114422)
BoxMin (503847.437500,78931.140625,19900.824219)
BoxMax (521581.968750,98587.679688,38208.335938)
Translate (-512000,-88000,-29000)
Rescale 0.05

No comments are allowed in a *.Desc* file for the moment.... This information allows for a quick one-step processing of the .asc file. If the *.Desc* file is not found the file is loaded in a two-step process to identify the bounding volumes The asc file is a text-mode file which contains a list of point and its syntax looks like this:

10.0    11.0     5.0
8.002   13.15    14.2
etc...

The data contained in a .asc file is expected to be in the form : X Y Z (floats) [R G B (0..255)] [NX NY NZ (floats)] [I(0..255)]

If the appropriate fields are found (color, normal and/or intensity) the relevant attribute types are created and marked as used on the point cloud.

See Also

CreateFromPointList


CK3dPointCloud::CreateFromPointList

Virtual Method Method CK3dPointCloud::CreateFromPointList

virtual CKBOOL CK3dPointCloud::CreateFromPointList(int iPointCount,VxVector* iPoints,VxVector* iNormals,DWORD* iColors,BYTE* iIntensities,VxVector& iPrecision) CK_PURE

Create the cloud using an array of points.

Parameters

Input argument iPointCount | Number of points in the iPoints array.
Input argument iPoints | A point to the list of point in the cloud.
Input argument iNormals | (Optionnal, can be NULL) A pointer to an array of VxVector containing the points normals.
Input argument iColors | (Optionnal, can be NULL) A pointer to an array of DWORD containing the points colors (32 bit ARGB).
Input argument iIntensities | (Optionnal, can be NULL) A pointer to an array of Bytes containing the points intensity.
Input argument iPrecision | A vector containing the error that is acceptable between the value given in iPoints and the values that will get stored in the tree.

Remarks

This methods creates a new cloud using the data given in the different arrays. Only the iPointCount, iPoints and iPrecision parameters are mandatory.

See Also

CreateFromAscFile


CK3dPointCloud::LoadAttributesFromArray

Virtual Method Method CK3dPointCloud::LoadAttributesFromArray

virtual CKBOOL CK3dPointCloud::LoadAttributesFromArray(int iAttributeIndex,CKDataArray* iArray, int iColumn = 0,float iOffset = 0.0f, float iScale = 1.0f) CK_PURE

Create the cloud using a data array of points.

Parameters

Input argument iArray

A pointer to a CKDataArray that contain the points to load. iColumn1: Index of the column that contains the points to load. iColumn2: Optionnal index of the additionnal column when using 3 columns containing floats. iColumn3: Optionnal index of the additionnal column when using 3 columns containing floats.

Remarks

This methods creates a new cloud using the data given in the input iArray. Only point position (a vector) can be specified through this method, additionnal attributes can be read later using LoadAttributesFromArray. The valid format for a data array is to contain either: a column containing strings (slower), a column containing parameters of type vector. 3 columns containing floats. Any other data types will produce an error.

See Also

CreateFromAscFile,LoadAttributesFromTextFile,LoadAttributesFromArray


CK3dPointCloud::GetLoadOffset

Virtual Method Method CK3dPointCloud::GetLoadOffset

virtual const VxVector& CK3dPointCloud::GetLoadOffset() const CK_PURE

Returns the offset that was applied to all the points when loaded from a .asc file.

Remarks

When loading from a .asc file an offset and scale factor can be applied to all the points if a *.Desc* was used. This scale factor and offset can be taken into account when accessing the point position with an iterator (see CloudIterator::GetCurrentPointPosition and GetCurrentPointRealPosition )

See Also

CreateFromAscFile, GetLoadScaleFactor


CK3dPointCloud::GetLoadScaleFactor

Virtual Method Method CK3dPointCloud::GetLoadScaleFactor

virtual float CK3dPointCloud::GetLoadScaleFactor() const CK_PURE

Returns the scale factor that was applied to all the points when loaded from a .asc file.

Remarks

When loading from a .asc file an offset and scale factor can be applied to all the points if a *.Desc* was used. This scale factor and offset can be taken into account when accessing the point position with an iterator (see CloudIterator::GetCurrentPointPosition and GetCurrentPointRealPosition )

See Also

CreateFromAscFile, GetLoadOffset


CK3dPointCloud::GetMemorySize

Virtual Method Method CK3dPointCloud::GetMemorySize

virtual CKDWORD CK3dPointCloud::GetMemorySize() const CK_PURE

Returns the memory taken to store all the points and their attributes.

See Also

GetPointsCount,GetVertexBufferCount,GetVertexBufferMemorySize


CK3dPointCloud::GetPointsCount

Virtual Method Method CK3dPointCloud::GetPointsCount

virtual CKDWORD CK3dPointCloud::GetPointsCount() const CK_PURE

Returns the number of points stored.

Remarks

Number of points...

See Also

GetMemorySize,GetVertexBufferCount,GetVertexBufferMemorySize


CK3dPointCloud::GetVertexBufferCount

Virtual Method Method CK3dPointCloud::GetVertexBufferCount

virtual CKDWORD CK3dPointCloud::GetVertexBufferCount() const CK_PURE

Returns the number of vertex buffers allocated to display the cloud.

Remarks

The number of vertex buffer that will be generated depends on the number of vertices that can be placed in a single vertex buffer. This value is controled by a global variable CK2_3D\CloudVerticesPerVB.

See Also

GetPointsCount,GetMemorySize,GetVertexBufferMemorySize


CK3dPointCloud::GetVertexBufferMemorySize

Virtual Method Method CK3dPointCloud::GetVertexBufferMemorySize

virtual CKDWORD CK3dPointCloud::GetVertexBufferMemorySize() const CK_PURE

Returns the memory taken to store all the vertex buffers.

Remarks

This method returns the size (in bytes) taken by all the currently allocated vertex buffers to display the cloud.

See Also

GetPointsCount,GetVertexBufferCount,GetMemorySize


CK3dPointCloud::CreateSelection

Virtual Method Method CK3dPointCloud::CreateSelection

virtual CloudSelection* CK3dPointCloud::CreateSelection(const XString& iName, int iMaxSize = 250000) CK_PURE

Returns an iterator on the root of the tree.

See Also

CloudIterator,SelectSphere,SelectHalfSpace,SelectCylinder,RayPick


CK3dPointCloud::GetRootIterator

Virtual Method Method CK3dPointCloud::GetRootIterator

virtual CloudIterator* CK3dPointCloud::GetRootIterator() CK_PURE

Returns an iterator on the root of the tree.

See Also

CloudIterator,SelectSphere,SelectHalfSpace,SelectCylinder,RayPick


CK3dPointCloud::SelectBox

Virtual Method Method CK3dPointCloud::SelectBox

virtual int CK3dPointCloud::SelectBox(const VxBbox& iBox,CloudSelection* iSelection, BOOL iClearSelection = TRUE) CK_PURE
virtual int CK3dPointCloud::SelectBox(const VxOBB& iOBox,CloudSelection* iSelection, BOOL iClearSelection = TRUE) CK_PURE

Selects a list of points within a box.

Parameters

Input argument iBox | Axis aligned selection box given in the cloud local space.
Input argument iOBox | Oriented selection box given in the cloud local space.
iSelection | Pointer on the CloudSelection in which the result should be stored. This selection must have been previously created with the CreateSelection Method

Remarks

This method returns the number of points that were put in the selection.

See Also

CloudIterator,SelectSphere,RayPick


CK3dPointCloud::SelectPoint

Virtual Method Method CK3dPointCloud::SelectPoint

virtual int CK3dPointCloud::SelectPoint(CKRenderContext* iContext,const Vx2DVector& iScreenPosition,CloudSelection* iSelection, BOOL iClearSelection = TRUE) CK_PURE

Selects a list of points within a box.

Parameters

Input argument iSelection

Index of the selection which should contain .

Remarks

This method returns an iterator which can then be used to acces all the points that are inside the given box or NULL if no such point exists.

See Also

CloudIterator,SelectSphere,SelectHalfSpace,SelectCylinder,RayPick


CK3dPointCloud::SelectSphere

Virtual Method Method CK3dPointCloud::SelectSphere

virtual int CK3dPointCloud::SelectSphere(const VxSphere& iSphere,CloudSelection* iSelection, BOOL iClearSelection = TRUE) CK_PURE

Selects a list of points within a sphere.

Parameters

Input argument iSphere

Selection sphere given in the cloud local space. iPutInRenderGroup: If >= 0 this value gives the render group in which the selected point should be put. Default is -1, that is do not change the point render group.

Remarks

This method returns an iterator which can then be used to acces all the points that are inside the given sphere or NULL if no such point exists.

See Also

CloudIterator,SelectBox,SelectHalfSpace,SelectCylinder,RayPick


CK3dPointCloud::SetReferentialPosition

Virtual Method Method CK3dPointCloud::SetReferentialPosition

virtual void CK3dPointCloud::SetReferentialPosition(const VxVector& iPosition,CK3dEntity* iRef = NULL) CK_PURE

Sets the position of the referential.

Remarks

This methods the referential of the cloud without actually moving the points themselves. It is different from the CK3dEntity::SetPosition method which moves the whole cloud.


CK3dPointCloud::EnableLighting

Virtual Method Method CK3dPointCloud::EnableLighting

virtual void CK3dPointCloud::EnableLighting(CKBOOL iEnable = TRUE) CK_PURE

Enables or disables the lighting of the points

Parameters

Input argument iEnable

TRUE to set lighting on , FALSE to set it off.

Remarks

If the data set does not contain any normal information the lighting can not be enabled.

See Also

IsLightingEnabled,HasNormals


CK3dPointCloud::GetGlobalPointSize

Virtual Method Method CK3dPointCloud::GetGlobalPointSize

virtual float CK3dPointCloud::GetGlobalPointSize() const CK_PURE

Returns the size factor for points drawn as sprites.

Remarks

This value is taken as a multiplication factor of the size of the point sprites. To be drawn as sprites a point must belong to a render group which rendering is set to Sprite mode (see CloudRenderGroup).

See Also

SetRenderGroup,SetGlobalPointSize,CloudRenderGroup


CK3dPointCloud::IsLightingEnabled

Virtual Method Method CK3dPointCloud::IsLightingEnabled

virtual CKBOOL CK3dPointCloud::IsLightingEnabled() const CK_PURE

Returns if the point are lit.

Remarks

If the data set does not contain any normal information the lighting can not be enabled.

See Also

EnableLighting,HasNormals


CK3dPointCloud::SetGlobalPointSize

Virtual Method Method CK3dPointCloud::SetGlobalPointSize

virtual void CK3dPointCloud::SetGlobalPointSize(float iPointSize) CK_PURE

Sets the size factor for points drawn as sprites.

Remarks

This value is taken as a multiplication factor of the size of the point sprites. To be drawn as sprites a point must belong to a render group which rendering is set to Sprite mode (see CloudRenderGroup).

See Also

SetRenderGroup,GetGlobalPointSize,CloudRenderGroup


CK3dPointCloud::GetPointFloatAttribute

Virtual Method Method CK3dPointCloud::GetPointFloatAttribute

virtual float CK3dPointCloud::GetPointFloatAttribute(int iPointIndex,int iAttributeIndex) const CK_PURE

Gets the value of an attribute on a point (stored as a float).

Parameters

Input argument iPointIndex | Index of the point (0..GetPointsCount()).
Input argument iAttributeIndex | Index of the attribute to get the value of.

Remarks

This method should only be used if the value stored by the attribute is a float as described in the CloudAttributeDescription. An attribute index can be retrieve from its name using GetCloudAttributeIndexByName.

See Also

SetAttributeOnPoint,GetPointIntAttribute,SetPointFloatAttribute,GetCloudAttributeIndexByName


CK3dPointCloud::GetPointIntAttribute

Virtual Method Method CK3dPointCloud::GetPointIntAttribute

virtual int CK3dPointCloud::GetPointIntAttribute(int iPointIndex,int iAttributeIndex) const CK_PURE

Gets the value of an attribute on a point (stored as an integer).

Parameters

Input argument iPointIndex | Index of the point (0..GetPointsCount()).
Input argument iAttributeIndex | Index of the attribute to get the value of.

Remarks

This method should only be used if the value stored by the attribute is an integer as described in the CloudAttributeDescription. An attribute index can be retrieve from its name using GetCloudAttributeIndexByName.

See Also

SetAttributeOnPoint,SetPointIntAttribute,GetPointFloatAttribute,GetCloudAttributeIndexByName


CK3dPointCloud::SetPointFloatAttribute

Virtual Method Method CK3dPointCloud::SetPointFloatAttribute

virtual void CK3dPointCloud::SetPointFloatAttribute(int iPointIndex,int iAttributeIndex, float iValue) CK_PURE

Sets the value of an attribute on a point (stored as a float).

Parameters

Input argument iPointIndex | Index of the point (0..GetPointsCount()).
Input argument iAttributeIndex | Index of the attribute to set the value of.
Input argument iValue | float Value

Remarks

This method should only be used if the value stored by the attribute is a float as described in the CloudAttributeDescription. An attribute index can be retrieve from its name using GetCloudAttributeIndexByName.

See Also

SetAttributeOnPoint,SetPointIntAttribute,GetPointFloatAttribute,GetCloudAttributeIndexByName


CK3dPointCloud::SetPointIntAttribute

Virtual Method Method CK3dPointCloud::SetPointIntAttribute

virtual void CK3dPointCloud::SetPointIntAttribute(int iPointIndex,int iAttributeIndex, int iValue) CK_PURE

Sets the value of an attribute on a point (stored as an integer).

Parameters

Input argument iPointIndex | Index of the point (0..GetPointsCount()).
Input argument iAttributeIndex | Index of the attribute to set the value of.
Input argument iValue | integer Value

Remarks

This method should only be used if the value stored by the attribute is an integer as described in the CloudAttributeDescription. An attribute index can be retrieve from its name using GetCloudAttributeIndexByName.

See Also

SetAttributeOnPoint,GetPointIntAttribute,GetPointFloatAttribute,GetCloudAttributeIndexByName


CK3dPointCloud::GetPointColor

Virtual Method Method CK3dPointCloud::GetPointColor

virtual DWORD CK3dPointCloud::GetPointColor(int iPointIndex) const CK_PURE

Returns the color of a point in ARGB 8888 format.

Remarks

If there is no color stored in the cloud , the returned value is 0xFFFFFFFF. Note: Colors are internally encoded in 16 bit.

See Also

HasColors,UseColor,SetPointColor,GetPointIntAttribute


CK3dPointCloud::GetPointIntensity

Virtual Method Method CK3dPointCloud::GetPointIntensity

virtual int CK3dPointCloud::GetPointIntensity(int iPointIndex) const CK_PURE

Returns the intensity of a point.

Remarks

If there is no intensity stored in the cloud, the returned value is 0. The intensity is a information stored on a byte (0..255) that was retrieved when reading a .asc file for example.

See Also

GetPointIntAttribute,SetPointIntensity


CK3dPointCloud::GetPointNormal

Virtual Method Method CK3dPointCloud::GetPointNormal

virtual VxVector CK3dPointCloud::GetPointNormal(int iPointIndex) const CK_PURE

Returns the normal of a point.

Remarks

If there is no normal stored in the cloud, the returned value is the vector (0,0,0) .

See Also

HasNormals,UseNormals


CK3dPointCloud::HasColors

Virtual Method Method CK3dPointCloud::HasColors

virtual CKBOOL CK3dPointCloud::HasColors() const CK_PURE

Returns if a color is stored per point.

Remarks

This method is equivalent to calling IsCloudAttributeUsed(CLOUD_ATTRIBUTE_COLOR). If not color is stored per point, the default color is full white.

See Also

HasNormals,UseNormals,GetPointNormal,IsCloudAttributeUsed


CK3dPointCloud::HasNormals

Virtual Method Method CK3dPointCloud::HasNormals

virtual CKBOOL CK3dPointCloud::HasNormals() const CK_PURE

Returns if a normal is stored per point.

Remarks

This method is equivalent to calling IsCloudAttributeUsed(CLOUD_ATTRIBUTE_NORMAL). Normals must exist if lighting is to be enabled.

See Also

HasColors,UseNormals,GetPointNormal,IsCloudAttributeUsed


CK3dPointCloud::SetPointColor

Virtual Method Method CK3dPointCloud::SetPointColor

virtual void CK3dPointCloud::SetPointColor(int iPointIndex,DWORD iColor) CK_PURE

Sets the color of a point in ARGB 8888 format.

Remarks

If there is no color stored in the cloud , this function does nothing. Modifying the color of a point can be a slow operation, if used inside a vertex buffer, as the whole vertex buffer will be reloaded in video memory. Note: Colors are internally encoded in 16 bit.

See Also

HasColors,UseColor,GetPointColor


CK3dPointCloud::SetPointIntensity

Virtual Method Method CK3dPointCloud::SetPointIntensity

virtual void CK3dPointCloud::SetPointIntensity(int iPointIndex, BYTE iNewIntensity) CK_PURE

Sets the intensity of a point.

Remarks

If there is no intensity stored in the cloud, the function does nothing. Modifying the normal of a point can be a slow operation, if used inside a vertex buffer, as the whole vertex buffer will be reloaded in video memory.

See Also

GetPointIntAttribute,GetPointIntensity


CK3dPointCloud::SetPointNormal

Virtual Method Method CK3dPointCloud::SetPointNormal

virtual void CK3dPointCloud::SetPointNormal(int iPointIndex,const VxVector& iNormal) CK_PURE

Sets the normal of a point.

Remarks

If there is no normal stored in the cloud , this function does nothing. Modifying the normal of a point can be a slow operation, if used inside a vertex buffer, as the whole vertex buffer will be reloaded in video memory.

See Also

HasColors,UseColor


CK3dPointCloud::UseColors

Virtual Method Method CK3dPointCloud::UseColors

virtual void CK3dPointCloud::UseColors(CKBOOL iUseColors) CK_PURE

Ensure memory is allocatd to store colors.

Remarks

This method is equivalent to calling UseCloudAttribute(CLOUD_ATTRIBUTE_COLOR). This ensures that memory is allocated to store a color for each point. A color is stored internally as a 16 bit ARGB 1555 color.

See Also

HasColors,GetPointColor,UseCloudAttribute


CK3dPointCloud::UseNormals

Virtual Method Method CK3dPointCloud::UseNormals

virtual void CK3dPointCloud::UseNormals(CKBOOL iUseNormals) CK_PURE

Ensure memory is allocatd to store normals.

Remarks

This method is equivalent to calling UseCloudAttribute(CLOUD_ATTRIBUTE_NORMAL). This ensures that memory is allocated to store a normal for each point. A normal is compressed on 10 bits for efficiency purposes.

See Also

HasNormals,GetPointNormal,UseCloudAttribute


CK3dPointCloud::GetCloudAttributeCount

Virtual Method Method CK3dPointCloud::GetCloudAttributeCount

virtual int CK3dPointCloud::GetCloudAttributeCount() const CK_PURE

Returns the number of attribute types on the cloud.

Remarks

The default attributes (Color,Normal,Intensity and render group) can not be removed which means there should be at least 4 default groups.

See Also

RegisterCloudAttribute,GetCloudAttributeIndexByName


CK3dPointCloud::GetCloudAttributeDescription

Virtual Method Method CK3dPointCloud::GetCloudAttributeDescription

virtual const CloudAttributeDescription& CK3dPointCloud::GetCloudAttributeDescription(int iAttributeIndex) const CK_PURE

Returns the description of an attribute type.

Parameters

Input argument iAttributeIndex

Index of the attribute which description should be returned (Can be returned from a name with GetCloudAttributeIndexByName).

Remarks

The 4 first attributes are the Color,Normal,Intensity and render group attributes. The description of an attribute type gives the type of value stored on the points in the cloud.

See Also

CloudAttributeDescription,SetCloudAttributeDescription,GetCloudAttributeIndexByName


CK3dPointCloud::GetCloudAttributeIndexByName

Virtual Method Method CK3dPointCloud::GetCloudAttributeIndexByName

virtual int CK3dPointCloud::GetCloudAttributeIndexByName(const XBaseString& iName) const CK_PURE

Returns an attribute type from the cloud given its name.

Parameters

Input argument iName

Name of the attribute type which index should be returned.

See Also

RegisterCloudAttribute,UnRegisterCloudAttribute,GetCloudAttributeCount


CK3dPointCloud::IsCloudAttributeInVB

Virtual Method Method CK3dPointCloud::IsCloudAttributeInVB

virtual CKBOOL CK3dPointCloud::IsCloudAttributeInVB(int iAttributeIndex) const CK_PURE

Returns whether the values of an attribute type will be inside the vertex buffer.

Parameters

Input argument iAttributeIndex

Index of the attribute for which we want to known if values will be present in VB.

See Also

CloudAttributeDescription,SetCloudAttributeInVB


CK3dPointCloud::IsCloudAttributeUsed

Virtual Method Method CK3dPointCloud::IsCloudAttributeUsed

virtual CKBOOL CK3dPointCloud::IsCloudAttributeUsed(int iAttributeIndex) const CK_PURE

Returns whether a attribute type is used.

Remarks

Having an attribute defined on a cloud does not mean it is used. An attribute type must be marked as used with this method before points can hold data for this attribute. Warning: When an attribute is marked as “non used” all the memory that was used to store the point data is released, therefore switching back and forth to “used” - “not used” will not keep the value initially stored on the points.

See Also

UseCloudAttribute


CK3dPointCloud::RegisterCloudAttribute

Virtual Method Method CK3dPointCloud::RegisterCloudAttribute

virtual int CK3dPointCloud::RegisterCloudAttribute(const CloudAttributeDescription& iAttributeDesc) CK_PURE

Register a new type of attribute to use on the cloud.

Parameters

Input argument iAttributeDesc

A CloudAttributeDescription that defines the attribute to create.

Remarks

The CloudAttributeDescription structure identifies the type of data that will be stored (integer or float) along with a description. An attribute can be stored on all points or only on a subset of points.

This function returns an index that can be later used to access data on points.

See Also

UnRegisterCloudAttribute,GetCloudAttributeIndexByName


CK3dPointCloud::SetCloudAttributeDescription

Virtual Method Method CK3dPointCloud::SetCloudAttributeDescription

virtual void CK3dPointCloud::SetCloudAttributeDescription(int iAttributeIndex,const CloudAttributeDescription& iDescription) CK_PURE

Sets the description of an attribute type.

Parameters

Input argument iAttributeIndex

Index of the attribute which description should be returned (Can be returned from a name with GetCloudAttributeIndexByName).

Remarks

The 4 first attributes are the Color,Normal,Intensity and render group attributes. The description of an attribute type gives the type of value stored on the points in the cloud.

See Also

CloudAttributeDescription,GetCloudAttributeDescription,GetCloudAttributeIndexByName


CK3dPointCloud::SetCloudAttributeInVB

Virtual Method Method CK3dPointCloud::SetCloudAttributeInVB

virtual void CK3dPointCloud::SetCloudAttributeInVB(int iAttributeIndex,CKBOOL iPutInVB) CK_PURE

Sets whether the values of an attribute type should be put inside the vertex buffer.

Parameters

Input argument iAttributeIndex | Index of the attribute which VB presence should be modified.
Input argument iPutInVB | TRUE if attribute values should uploaded in the vertex buffer , FALSE otherwise

See Also

CloudAttributeDescription,IsCloudAttributeInVB


CK3dPointCloud::UnRegisterCloudAttribute

Virtual Method Method CK3dPointCloud::UnRegisterCloudAttribute

virtual void CK3dPointCloud::UnRegisterCloudAttribute(int iAttributeIndex) CK_PURE

Removes an attribute type from the cloud.

Parameters

Input argument iAttributeIndex

Index of the attribute to remove (Can be returned from a name with GetCloudAttributeIndexByName).

Remarks

The default attributes (Color,Normal,Intensity and render group) can not be removed. Removing an attribute can change the indices that were attributed to all the user attribute.

See Also

RegisterCloudAttribute,GetCloudAttributeIndexByName


CK3dPointCloud::UseCloudAttribute

Virtual Method Method CK3dPointCloud::UseCloudAttribute

virtual void CK3dPointCloud::UseCloudAttribute(int iAttributeIndex,BOOL iUse) CK_PURE

Sets the usage of a given attribute type.

Remarks

Having an attribute defined on a cloud does not mean it is used. An attribute type must be marked as used with this method before points can hold data for this attribute. Warning: When an attribute is marked as “non used” all the memory that was used to store the point data is released, therefore switching back and forth to “used” - “not used” will not keep the value initially stored on the points.

See Also

IsCloudAttributeUsed


CK3dPointCloud::Cast

Static Object Method CK3dPointCloud::Cast

static CK3dPointCloud* CK3dPointCloud::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CK3dPointCloud* anim = CK3dPointCloud::Cast(Object);


CK3dPointCloud::GetClipPlane

Virtual Method Method CK3dPointCloud::GetClipPlane

virtual void CK3dPointCloud::GetClipPlane(int iClipPlaneIndex,VxPlane& oPlaneEquation) const CK_PURE


CK3dPointCloud::GetClipPlaneCount

Virtual Method Method CK3dPointCloud::GetClipPlaneCount

virtual int CK3dPointCloud::GetClipPlaneCount() const CK_PURE


CK3dPointCloud::GetGlobalMaterial

Virtual Method Method CK3dPointCloud::GetGlobalMaterial

virtual CKMaterial* CK3dPointCloud::GetGlobalMaterial() const CK_PURE


CK3dPointCloud::GetLOD

Virtual Method Method CK3dPointCloud::GetLOD

virtual int CK3dPointCloud::GetLOD() const CK_PURE


CK3dPointCloud::GetLODPointCount

Virtual Method Method CK3dPointCloud::GetLODPointCount

virtual int CK3dPointCloud::GetLODPointCount(int iLod) const CK_PURE


CK3dPointCloud::GetPickingPrecision

Virtual Method Method CK3dPointCloud::GetPickingPrecision

virtual float CK3dPointCloud::GetPickingPrecision() const CK_PURE


CK3dPointCloud::GetSelection

Virtual Method Method CK3dPointCloud::GetSelection

virtual CloudSelection* CK3dPointCloud::GetSelection(int iIndex) const CK_PURE
virtual CloudSelection* CK3dPointCloud::GetSelection(const XString& iName) const CK_PURE


CK3dPointCloud::GetSelectionCount

Virtual Method Method CK3dPointCloud::GetSelectionCount

virtual int CK3dPointCloud::GetSelectionCount() const CK_PURE


CK3dPointCloud::IsMainCloudVisible

Virtual Method Method CK3dPointCloud::IsMainCloudVisible

virtual CKBOOL CK3dPointCloud::IsMainCloudVisible() const CK_PURE


CK3dPointCloud::IsUsingMaterialColor

Virtual Method Method CK3dPointCloud::IsUsingMaterialColor

virtual CKBOOL CK3dPointCloud::IsUsingMaterialColor() const CK_PURE


CK3dPointCloud::IsUsingPointSprite

Virtual Method Method CK3dPointCloud::IsUsingPointSprite

virtual CKBOOL CK3dPointCloud::IsUsingPointSprite() const CK_PURE


CK3dPointCloud::LoadAttributesFromTextFile

Virtual Method Method CK3dPointCloud::LoadAttributesFromTextFile

virtual CKBOOL CK3dPointCloud::LoadAttributesFromTextFile(int iAttributeIndex,const char* iFileName,float iOffset = 0.0f, float iScale = 1.0f) CK_PURE


CK3dPointCloud::RemoveSelection

Virtual Method Method CK3dPointCloud::RemoveSelection

virtual void CK3dPointCloud::RemoveSelection(CloudSelection* iSelection) CK_PURE
virtual void CK3dPointCloud::RemoveSelection(const XString& iName) CK_PURE


CK3dPointCloud::SelectCone

Virtual Method Method CK3dPointCloud::SelectCone

virtual int CK3dPointCloud::SelectCone(const VxCone& iCone,CloudSelection* iSelection, BOOL iClearSelection = TRUE) CK_PURE


CK3dPointCloud::SelectConvexObject

Virtual Method Method CK3dPointCloud::SelectConvexObject

virtual int CK3dPointCloud::SelectConvexObject(CK3dEntity* iEnt,CloudSelection* iSelection, BOOL iClearSelection = TRUE) CK_PURE


CK3dPointCloud::SelectConvexObjectGroup

Virtual Method Method CK3dPointCloud::SelectConvexObjectGroup

virtual int CK3dPointCloud::SelectConvexObjectGroup(CKGroup* iGroup,CloudSelection* iSelection, BOOL iClearSelection = TRUE) CK_PURE
virtual int CK3dPointCloud::SelectConvexObjectGroup(const XObjectPointerArray& iObjects,CloudSelection* iSelection, BOOL iClearSelection = TRUE) CK_PURE


CK3dPointCloud::SetClipPlane

Virtual Method Method CK3dPointCloud::SetClipPlane

virtual void CK3dPointCloud::SetClipPlane(int iClipPlaneIndex,const VxPlane& iPlaneEquation) CK_PURE


CK3dPointCloud::SetClipPlaneCount

Virtual Method Method CK3dPointCloud::SetClipPlaneCount

virtual void CK3dPointCloud::SetClipPlaneCount(int iClipPlaneCount) CK_PURE


CK3dPointCloud::SetGlobalMaterial

Virtual Method Method CK3dPointCloud::SetGlobalMaterial

virtual void CK3dPointCloud::SetGlobalMaterial(CKMaterial* iMaterial) CK_PURE


CK3dPointCloud::SetLOD

Virtual Method Method CK3dPointCloud::SetLOD

virtual void CK3dPointCloud::SetLOD(int iLod) CK_PURE


CK3dPointCloud::SetLODPointCount

Virtual Method Method CK3dPointCloud::SetLODPointCount

virtual void CK3dPointCloud::SetLODPointCount(int iLod,int iPointCount) CK_PURE


CK3dPointCloud::SetPickingPrecision

Virtual Method Method CK3dPointCloud::SetPickingPrecision

virtual void CK3dPointCloud::SetPickingPrecision(float iPointDistance) CK_PURE


CK3dPointCloud::ShowMainCloud

Virtual Method Method CK3dPointCloud::ShowMainCloud

virtual void CK3dPointCloud::ShowMainCloud(CKBOOL iShow) CK_PURE


CK3dPointCloud::UseMaterialColor

Virtual Method Method CK3dPointCloud::UseMaterialColor

virtual void CK3dPointCloud::UseMaterialColor(CKBOOL iUse) CK_PURE


CK3dPointCloud::UsePointSprite

Virtual Method Method CK3dPointCloud::UsePointSprite

virtual void CK3dPointCloud::UsePointSprite(CKBOOL iUse) CK_PURE


CK3dPointCloud::DefaultCloudAttribute

Enumerated Type CK3dPointCloud::DefaultCloudAttribute

enum DefaultCloudAttribute {
CLOUD_ATTRIBUTE_UNUSED = 0,
CLOUD_ATTRIBUTE_COLOR = 1,
CLOUD_ATTRIBUTE_NORMAL = 2,
CLOUD_ATTRIBUTE_INTENSITY = 3,
}

Default Point cloud attributes.

Members

CLOUD_ATTRIBUTE_COLOR | Color information is stored as 16 bits color
CLOUD_ATTRIBUTE_INTENSITY | An intensity stored on 8 bits
CLOUD_ATTRIBUTE_NORMAL | Normal information is stored as compressed on 10 bits
CLOUD_ATTRIBUTE_UNUSED | Attribute 0 is not used

Remarks

This enumeration represents the attribute type that are always created for a 3D point cloud (which does not mean they are used)


CKBodyPart

Class CKBodyPart

Class for 3D objects being part of a character.

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity

CK3dObject
Show brief derivation trees

CKBodyPart

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity

CK3dObject
Show full derivation trees

CKBodyPart

Remarks

The CKBodyPart class is designed for characters parts. In addition to the virtual base class CK3dObject it provides functions to retrieve the character a bodypart is part of.

All the IK related methods (GetRotationJoint,FitToJoint) of the CKBodyPart class are now deprecated

The class id of CKBodyPart is CKCID_BODYPART.

Groups

Operations
Static Object Method Cast | Dynamic Cast method (returns NULL if the object can't be casted)
Virtual Method Method GetCharacter | Returns the character to which this bodypart belongs to.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Virtual Method Method GetOrientation | Returns the entity orientation axes.
Virtual Method Method GetPosition | Returns the entity position in a given referential.
Pure Virtual Method Method IsInRenderContext | Checks if this render object is referenced in a CKRenderContext.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Virtual Method Method SetExclusiveAnimation | Sets the only animation that can modify this bodypart.
Pure Virtual Method Method SetZOrder | Sets the Z order (priority) for this object.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.

See Also

CK3dObject,CKCharacter::AddBodyPart()


CKBodyPart::GetCharacter

Virtual Method Method CKBodyPart::GetCharacter

virtual CKCharacter* CKBodyPart::GetCharacter() const CK_PURE

Returns the character to which this bodypart belongs to.

Returns

A pointer to the owner CKCharacter.

See Also

CKCharacter


CKBodyPart::SetExclusiveAnimation

Virtual Method Method CKBodyPart::SetExclusiveAnimation

virtual void CKBodyPart::SetExclusiveAnimation(const CKAnimation *anim) CK_PURE
virtual CKAnimation* CKBodyPart::GetExclusiveAnimation() const CK_PURE

Sets the only animation that can modify this bodypart.

Parameters

Input argument anim

A pointer to the new exclusive CKAnimation or NULL to remove any exclusive animation.

Remarks

Since a character can have several animations playing at the same moment, some animations may refer to the same bodypart. This function forces one of these animations to be the only one that can modify an object.

See Also

CKAnimation


CKBodyPart::Cast

Static Object Method CKBodyPart::Cast

static CKBodyPart* CKBodyPart::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKCamera

Class CKCamera

Camera

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CKCamera

CKTargetCamera

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CKCamera

Subclasses

CKTargetCamera

Remarks

A CKCamera represents a potential configuration for a viewpoint: front plane, back plane, field of view, roll, projection type, zoom type, aspect ratio. As it is derived from CK3DEntity and CKBeObject, it has all the potentialities from those classes, especially the possibility to have behaviors attached to it. The orientation and position of the camera is defined the same way a 3dEntity does.

For a camera to become active in a rendercontext you should attach the viewpoint to it using the function CKRenderContext::AttachViewpointToCamera()

Field of View (FOV): It controls how much of a scene is visible and is an angle measured in radians. The Dev interface gives acces to the notion of focal length used in photography. For a standard 35 mm camera the conversion formula between field of view and focal length is :

Field Of View = 2 x ArcTan( (35/2) / Focal Length)

The class id of CKCamera is CKCID_CAMERA.

Groups

Aspect Ratio | Cast operator | Clipping planes | Field of view | Misc | Projection Type | Target

Aspect Ratio
Virtual Method Method GetAspectRatio | Gets the aspect ratio
Virtual Method Method SetAspectRatio | Sets the aspect ratio
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Clipping planes
Virtual Method Method GetBackPlane | Returns the back clipping plane distance
Virtual Method Method GetFrontPlane | Returns the front clipping plane distance
Virtual Method Method SetBackPlane | Sets the back clipping plane distance
Virtual Method Method SetFrontPlane | Sets the front clipping plane distance
Field of view
Virtual Method Method GetFov | Returns the field of view of the camera
Virtual Method Method SetFov | Changes the field of view of the camera
Misc
Virtual Method Method ComputeProjectionMatrix | Computes the projection matrix
Virtual Method Method ResetRoll | Rolls back the camera to vertical.
Virtual Method Method Roll | Rolls the camera of the desired angle,
Projection Type
Virtual Method Method GetOrthographicZoom | Returns the zoom value in orthographic projection
Virtual Method Method GetProjectionType | Returns the current projection type
Virtual Method Method SetOrthographicZoom | Changes the zoom value in orthographic projection
Virtual Method Method SetProjectionType | Sets the projection type of the camera
Target
Virtual Method Method GetTarget | Returns the target of this camera.
Virtual Method Method SetTarget | Sets the target of this camera.

See Also

CKRenderContext,CKTargetCamera


CKCamera::GetAspectRatio

Virtual Method Method CKCamera::GetAspectRatio

virtual void CKCamera::GetAspectRatio(int& width,int& height) CK_PURE

Gets the aspect ratio

Remarks

The given aspect ratio will be used to resize the viewport of the render context on which this camera is attached.

See Also

SetAspectRatio,CKRenderContext::SetViewRect,CKRenderContext::AttachViewpointToCamera


CKCamera::SetAspectRatio

Virtual Method Method CKCamera::SetAspectRatio

virtual void CKCamera::SetAspectRatio(int width,int height) CK_PURE

Sets the aspect ratio

Remarks

The given aspect ratio will be used to resize the viewport of the render context on which this camera is attached.

See Also

GetAspectRatio,CKRenderContext::SetViewRect,CKRenderContext::AttachViewpointToCamera


CKCamera::Cast

Static Object Method CKCamera::Cast

static CKCamera* CKCamera::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKCamera::GetBackPlane

Virtual Method Method CKCamera::GetBackPlane

virtual float CKCamera::GetBackPlane() CK_PURE

Returns the back clipping plane distance

Returns

Back clipping plane distance.

Remarks

The back plane distance is the distance beyond which nothing is seen by the camera. By default, at creation time, the back clipping plane distance is equal to 4000.0f.

See Also

SetBackPlane,SetFrontPlane


CKCamera::GetFrontPlane

Virtual Method Method CKCamera::GetFrontPlane

virtual float CKCamera::GetFrontPlane() CK_PURE

Returns the front clipping plane distance

Returns

Front clipping plane distance.

Remarks

The front plane distance is the distance below which nothing is seen by the camera. By default, at creation time, the front plane distance is equal to 1.0f.

See Also

GetBackPlane,SetFrontPlane


CKCamera::SetBackPlane

Virtual Method Method CKCamera::SetBackPlane

virtual void CKCamera::SetBackPlane(float back) CK_PURE

Sets the back clipping plane distance

Parameters

Input argument back

The new back clipping plane distance

Remarks

The back plane distance is the distance beyond which nothing is seen by the camera. By default, at creation time, the back clipping plane distance is equal to 4000.0f.

See Also

GetBackPlane,SetFrontPlane


CKCamera::SetFrontPlane

Virtual Method Method CKCamera::SetFrontPlane

virtual void CKCamera::SetFrontPlane(float front) CK_PURE

Sets the front clipping plane distance

Parameters

Input argument front

The new front clipping plane distance

Remarks

The front plane distance is the distance below which nothing is seen by the camera. By default, at creation time, the front plane distance is equal to 1.0f.

See Also

SetBackPlane,GetFrontPlane


CKCamera::GetFov

Virtual Method Method CKCamera::GetFov

virtual float CKCamera::GetFov() CK_PURE

Returns the field of view of the camera

Returns

Field of view of the camera.

Remarks

By default, the field of view is equal to: 0.5f ( 30°)

See Also

SetFov


CKCamera::SetFov

Virtual Method Method CKCamera::SetFov

virtual void CKCamera::SetFov(float fov) CK_PURE

Changes the field of view of the camera

Parameters

Input argument fov

The new field of view of the camera

Remarks

By default, the field of view is equal to: 0.5f ( 30°)

See Also

GetFov


CKCamera::ComputeProjectionMatrix

Virtual Method Method CKCamera::ComputeProjectionMatrix

virtual void CKCamera::ComputeProjectionMatrix(VxMatrix& mat) CK_PURE

Computes the projection matrix

Remarks

This method uses the fov,aspect ratio, back and front clipping to compute a projection matrix.

See Also

VxMatrix::Perspective,VxMatrix::Orthographic


CKCamera::ResetRoll

Virtual Method Method CKCamera::ResetRoll

virtual void CKCamera::ResetRoll() CK_PURE

Rolls back the camera to vertical.

Remarks

+Rolls back the camera to vertical by aligning its Up axis (Y) with the world up axis. +If the camera as a target this method as no effect as the orientation of the camera will be forced toward its target.

See Also

CKTargetCamera,SetTarget,Roll


CKCamera::Roll

Virtual Method Method CKCamera::Roll

virtual void CKCamera::Roll(float angle) CK_PURE

Rolls the camera of the desired angle,

Parameters

Input argument angle

Angle of rotation around Z axis in radians.

Remarks

If the camera as a target this method as no effect as the orientation of the camera will be forced toward its target. To align the camera back with the Up vector in the world use ResetRoll

See Also

CKTargetCamera,SetTarget,ResetRoll


CKCamera::GetOrthographicZoom

Virtual Method Method CKCamera::GetOrthographicZoom

virtual float CKCamera::GetOrthographicZoom() CK_PURE

Returns the zoom value in orthographic projection

Returns

Zoom factor.

See Also

SetOrthographicZoom,SetProjectionType


CKCamera::GetProjectionType

Virtual Method Method CKCamera::GetProjectionType

virtual int CKCamera::GetProjectionType() CK_PURE

Returns the current projection type

Returns

Value | Meaning
CK_PERSPECTIVEPROJECTION | perspective projection (default)
CK_ORTHOGRAPHICPROJECTION | orthographic projection

Remarks

The project type is either orthographic or perspective.

See Also

SetProjectionType,SetOrthographicZoom


CKCamera::SetOrthographicZoom

Virtual Method Method CKCamera::SetOrthographicZoom

virtual void CKCamera::SetOrthographicZoom(float zoom) CK_PURE

Changes the zoom value in orthographic projection

Parameters

Input argument zoom

The new zoom value

Remarks

Changes the zoom value. Valid only if in orthographic projection mode. The bigger the value, the bigger the objects... By default, at creation time, the zoom of the camera is equal to: 1.0f

See Also

GetOrthographicZoom,SetProjectionType


CKCamera::SetProjectionType

Virtual Method Method CKCamera::SetProjectionType

virtual void CKCamera::SetProjectionType(int proj) CK_PURE

Sets the projection type of the camera

Parameters

Input argument proj

The new projection type

Remarks

The project type is either orthographic or perspective. proj = CK_PERSPECTIVEPROJECTION : perspective projection (default) proj = CK_ORTHOGRAPHICPROJECTION : orthographic projection If the projection is orthographic, you can specify a zoom value.

See Also

GetProjectionType,SetOrthographicZoom


CKCamera::GetTarget

Virtual Method Method CKCamera::GetTarget

virtual CK3dEntity *CKCamera::GetTarget() CK_PURE

Returns the target of this camera.

Returns

A pointer to the CK3dEntity used as target for this camera.

Remarks

This method is only implemented for a CKTargetCamera otherwise it returns NULL.

See Also

CKTargetCamera,SetTarget


CKCamera::SetTarget

Virtual Method Method CKCamera::SetTarget

virtual void CKCamera::SetTarget(CK3dEntity *target) CK_PURE

Sets the target of this camera.

Parameters

Input argument target

A pointer to the CK3dEntity to use as a target or NULL to remove the current target.

Remarks

This method is only implemented for a CKTargetCamera. If the camera has a target its orientation it always updated toward the given target.

See Also

CKTargetCamera,GetTarget


CKCharacter

Class CKCharacter

Representation of character

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CKCharacter

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CKCharacter

Remarks

A CKCharacter is defined as an articulated hierarchical set of bodyparts.A character must be a hierarchy of object (CKBodyPart) with an unique root object giving position and orientation (optionnal for orientation).

A character may have an object called Floor referencer which is used (if present) by behaviors to make the characters detect floors. This object should be a child of the root and contain the keywords ""Pas"","Foot" or “FloorRef” in its name to be automatically recognized otherwise use SetFloorReferenceObject to precise a custom object.

It can have animations attached and provides default functionnalities to handle these animations and their transitions. This behavior can be overriden by calling SetAutomaticProcess(FALSE). The processing of animations on characters occurs each frame before the processing of behaviors. The automatic processing of animation plays the active animation until its a new animation is set to be played using SetNextActiveAnimation, when a new animation becomes active any kind of transitions can be made (smooth,to the start of the next animation,break,etc...)

In addition to the active animation, secondary animations may be played concurrently. If there are bodyparts that are used by both animations the secondary animations have priority on the currently active animation.

The objects making a character are called Bodyparts (CKBodyPart which derives from CK3dObject). While names may be pure conveniency with other objects, Bodyparts name are used by loaders to detect to which particuliar object an animation should be attributed. If there is a bodypart that should not be modify by the character animation (for procedural animation of the head for example), it can be disabled by using CK3dEntity::IgnoreAnimations()

As a child class of CKBeObject and CK3dEntity, CKCharacter inherits all their methods for placement and behaviors gestion.

The class id of CKCharacter is CKCID_CHARACTER.

Groups

Animations | BodyParts | Automatic animations processing | Secondary animations | Bodyparts | Cast operator | Floor Reference | Misc

Animations
Virtual Method Method AddAnimation | Adds an animation to the character
Virtual Method Method AddObjectAnimation | Adds an animation to the entity
Virtual Method Method GetAnimation | Gets a specific animation given its index.
Virtual Method Method GetAnimationCount | Gets the number of animations in this character.
Virtual Method Method GetObjectAnimation | Returns an animation by its index.
Virtual Method Method GetObjectAnimationCount | Returns the number of object animations on this entity.
Virtual Method Method GetWarper | Gets the animation used to make transitions.
Virtual Method Method GetWarperParameters | Gets the parameters that were used to create the warping animation.
Virtual Method Method RemoveAnimation | Removes an animation from the character
Virtual Method Method RemoveObjectAnimation | Removes an animation from the entity
Virtual Method Method SetAnimationLevelOfDetail | Sets the level of detail for animation processing.
BodyParts
Automatic animations processing
Virtual Method Method GetActiveAnimation | Gets the animation being played.
Virtual Method Method GetNextActiveAnimation | Gets the animation that will be played next.
Virtual Method Method ProcessAnimation | Updates the character according to current active animation and secondary animations.
Virtual Method Method SetActiveAnimation | Forces the current active animation
Virtual Method Method SetNextActiveAnimation | Sets the next animation to be played by the character
Virtual Method Method SetNextActiveAnimation2 | Sets the next animation to be played by the character
Secondary animations
Virtual Method Method GetSecondaryAnimationsCount | Gets the number of secondary animations currently playing on this character.
Virtual Method Method PlaySecondaryAnimation | Plays a secondary animation.
Virtual Method Method StopSecondaryAnimation | Stops playing a secondary animation.
Bodyparts
Virtual Method Method AddBodyPart | Adds a bodypart to this character.
Virtual Method Method GetBodyPart | Gets a bodypart at a given index.
Virtual Method Method GetBodyPartCount | Gets the number of bodyparts of this character.
Virtual Method Method GetRootBodyPart | Gets the root body part.
Virtual Method Method RemoveBodyPart | Removes a bodypart from this character.
Virtual Method Method SetRootBodyPart | Forces the character to use a specific bodypart as its RootBodyPart
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Floor Reference
Virtual Method Method GetFloorReferenceObject | Gets the entity used to represent floor reference.
Virtual Method Method SetFloorReferenceObject | Sets the entity used to represent floor reference.
Misc
Virtual Method Method AlignCharacterWithRootPosition | Aligns character position and orientation with its root
Virtual Method Method GetEstimatedVelocity | Gets the velocity vector of the character.

See Also

Using Characters,Using Animations,CKAnimation,CKKeyedAnimation,CKKinematicChain


CKCharacter::AddAnimation

Virtual Method Method CKCharacter::AddAnimation

virtual CKERROR CKCharacter::AddAnimation(CKAnimation *anim) CK_PURE

Adds an animation to the character

Parameters

Input argument anim

A CKAnimation pointer to be added for the character.

Returns

CK_OK if successful, CKERR_INVALIDPARAMETER otherwise.

See Also

RemoveAnimation,GetAnimation,GetAnimationCount


CKCharacter::GetAnimation

Virtual Method Method CKCharacter::GetAnimation

virtual CKAnimation* CKCharacter::GetAnimation(int index) CK_PURE

Gets a specific animation given its index.

Parameters

Input argument index

Index of the animation to be returned.

Returns

A CKAnimation pointer.

See Also

AddAnimation,GetAnimation,GetAnimationCount


CKCharacter::GetAnimationCount

Virtual Method Method CKCharacter::GetAnimationCount

virtual int CKCharacter::GetAnimationCount() CK_PURE

Gets the number of animations in this character.

Returns

The number of animations.

See Also

RemoveAnimation,GetAnimation,GetAnimationCount


CKCharacter::GetWarper

Virtual Method Method CKCharacter::GetWarper

virtual CKAnimation* CKCharacter::GetWarper() CK_PURE

Gets the animation used to make transitions.

Returns

A pointer to the animation used for transitions.

Remarks

A transition animation is always created along with a character. Its parameters will always be updated each time a new transition is needed and can be retrieved with GetWarperParameters method.

See Also

AddAnimation,RemoveAnimation,GetAnimation,GetAnimationCount,GetWarperParameters


CKCharacter::GetWarperParameters

Virtual Method Method CKCharacter::GetWarperParameters

virtual void CKCharacter::GetWarperParameters(CKDWORD* TransitionMode,CKAnimation** AnimSrc,float* FrameSrc,CKAnimation** AnimDest,float* FrameDest) CK_PURE

Gets the parameters that were used to create the warping animation.

Parameters

Input argument TransitionMode | A pointer to a DWORD that will be filled with the transition mode (CK_ANIMATION_TRANSITION_MODE) used to create the warping animation.
Input argument AnimSrc | Source animation
Input argument FrameSrc | Frame index in the source animation that was used as starting point for the warper.
Input argument AnimDest | Destination animation
Input argument FrameDest | Frame index in the destination animation that was used as ending point for the warper.

Remarks

o This method retrieves the parameters that were used to create the last generated transition animation (warper).

See Also

GetWarper


CKCharacter::RemoveAnimation

Virtual Method Method CKCharacter::RemoveAnimation

virtual CKERROR CKCharacter::RemoveAnimation(CKAnimation *anim) CK_PURE

Removes an animation from the character

Parameters

Input argument anim

A CKAnimation pointer to be removed from the character.

Returns

CK_OK if successful, CKERR_INVALIDPARAMETER otherwise

See Also

AddAnimation,GetAnimation,GetAnimationCount


CKCharacter::SetAnimationLevelOfDetail

Virtual Method Method CKCharacter::SetAnimationLevelOfDetail

virtual void CKCharacter::SetAnimationLevelOfDetail(float LOD) CK_PURE
virtual float CKCharacter::GetAnimationLevelOfDetail() CK_PURE

Sets the level of detail for animation processing.

Parameters

Input argument LOD

A float value between 0..1 giving the animations level of detail.

Remarks

A character that is far from the viewpoint does not need all bodyparts animations to be processed. The animations of the bodyparts are sorted according to their importance in (contribution to) the global animation of the character. You can use this level of detail to remove the processing of the less important bodyparts animations. At the minimum level of detail (0) only the root and floor reference object animations are processed (character movement) , at the full level of detail (1.0f) all the bodyparts animations are processed.

See Also

GetRootBodyPart, GetFloorReferenceObject


CKCharacter::GetActiveAnimation

Virtual Method Method CKCharacter::GetActiveAnimation

virtual CKAnimation *CKCharacter::GetActiveAnimation() CK_PURE

Gets the animation being played.

Returns

A pointer to the CKAnimation being played.

See Also

SetActiveAnimation,SetNextActiveAnimation


CKCharacter::GetNextActiveAnimation

Virtual Method Method CKCharacter::GetNextActiveAnimation

virtual CKAnimation *CKCharacter::GetNextActiveAnimation() CK_PURE

Gets the animation that will be played next.

Returns

A pointer to the next active CKAnimation.

See Also

GetActiveAnimation,SetActiveAnimation,SetNextActiveAnimation


CKCharacter::ProcessAnimation

Virtual Method Method CKCharacter::ProcessAnimation

virtual void CKCharacter::ProcessAnimation(float deltat=1.0f) CK_PURE

Updates the character according to current active animation and secondary animations.

Parameters

Input argument deltat

a float value giving the elapsed time since last process loop in milliseconds.

Remarks

This method is automatically called by the framework on each active character before the process loop.

See Also

SetAutomaticProcess, SetActiveAnimation, SetNextActiveAnimation


CKCharacter::SetActiveAnimation

Virtual Method Method CKCharacter::SetActiveAnimation

virtual CKERROR CKCharacter::SetActiveAnimation(CKAnimation *anim) CK_PURE

Forces the current active animation

Parameters

Input argument anim

A pointer to a CKAnimation to be set as current active animation.

Returns

Value | Meaning
CK_OK | List of error codes.

Remarks

This method changes the current active animation without any transition.

See Also

GetActiveAnimation,GetNextActiveAnimation,SetNextActiveAnimation


CKCharacter::SetNextActiveAnimation

Virtual Method Method CKCharacter::SetNextActiveAnimation

virtual CKERROR CKCharacter::SetNextActiveAnimation(CKAnimation *anim,CKDWORD transitionmode,float warplength=0.0f) CK_PURE

Sets the next animation to be played by the character

Parameters

Input argument anim | A pointer to the next CKAnimation to be played.
Input argument transitionmode | A CKDWORD containing a combination of CK_ANIMATION_TRANSITION_MODE
Input argument warplength | length in frame of the warping animation if there is one.

Returns

CK_OK if successful, CKERR_INVALIDPARAMETER otherwise

Remarks

Depending on transitionmode value, this function may :

Create a transition animation between current position and next animation which will be played before playing anim. Set anim as Active Animation immediatly (break). Continue playing current animation in loop.

if transitionmode is CK_TRANSITION_FROMANIMATION then the transition mode will be taken from the animation parameters (set with CKAnimation::SetTransitionMode The UnlimittedController building block in the Character catagory is good sample to see the different usage of transition mode.

Example

If the current active animation is anim then the function returns immediatly otherwise
if the current active animation can be stopped then a transition animation will be created
which will be 5 frames long then anim will be played from the frame to which the positions of
the character and its bodyparts is the closest match to the current ones.
       SetNextActiveAnimation(anim,CK_TRANSITION_LOOPIFEQUAL|CK_TRANSITION_USEVELOCITY|CK_TRANSITION_WARPBEST,5.0f);

If the current active animation is anim then the function returns immediatly otherwise
if the current active animation can be stopped then a transition animation will be created
which will be 5 frames long then anim will be played from the start.
       SetNextActiveAnimation(anim,CK_TRANSITION_LOOPIFEQUAL|CK_TRANSITION_USEVELOCITY|CK_TRANSITION_WARPSTART,5.0f);

See Also

SetNextActiveAnimation2,GetActiveAnimation,SetActiveAnimation,CK_ANIMATION_TRANSITION_MODE


CKCharacter::SetNextActiveAnimation2

Virtual Method Method CKCharacter::SetNextActiveAnimation2

virtual CKERROR CKCharacter::SetNextActiveAnimation2(CKAnimation *anim,CKDWORD transitionmode,float warplength=0.0f,float frameTo = 0) CK_PURE

Sets the next animation to be played by the character

Remarks

This function is a extended version of the SetNextActiveAnimation where you can give the position in which to start the destination animation.

See Also

SetNextActiveAnimation,CK_ANIMATION_TRANSITION_MODE


CKCharacter::GetSecondaryAnimationsCount

Virtual Method Method CKCharacter::GetSecondaryAnimationsCount

virtual int CKCharacter::GetSecondaryAnimationsCount() CK_PURE

Gets the number of secondary animations currently playing on this character.

Returns

Number of secondary animations.

See Also

PlaySecondaryAnimation,GetSecondaryAnimationCount, StopSecondaryAnimation


CKCharacter::PlaySecondaryAnimation

Virtual Method Method CKCharacter::PlaySecondaryAnimation

virtual CKERROR CKCharacter::PlaySecondaryAnimation(CKAnimation *anim,float StartingFrame=0.0f,CK_SECONDARYANIMATION_FLAGS PlayFlags=CKSECONDARYANIMATION_ONESHOT,float warplength=5.0f,int LoopCount=0) CK_PURE

Plays a secondary animation.

Parameters

Input argument anim | A pointer to the CKAnimation to start playing.
Input argument StartingFrame | Frame to starts playing anim from.
Input argument PlayFlags | Play options (CK_SECONDARYANIMATION_FLAGS)
Input argument warplength | If play options contain CKSECONDARYANIMATION_DOWARP, length in frames of the transition animation.
Input argument LoopCount | If play options specifies CKSECONDARYANIMATION_LOOPNTIMES, number of loops.

Returns

CK_OK if successful or an error code.

Remarks

The secondary animations have priority over primary animations, they force the movement of bodyparts that they referenced. Most of the time these animations will be specific to parts of the characters (arms for example) and should not referenced the root bodypart as its the object that gives the character movement.

See Also

StopSecondaryAnimation


CKCharacter::StopSecondaryAnimation

Virtual Method Method CKCharacter::StopSecondaryAnimation

virtual CKERROR CKCharacter::StopSecondaryAnimation(CKAnimation *anim,CKBOOL warp=FALSE,float warplength=5.0f) CK_PURE
virtual CKERROR CKCharacter::StopSecondaryAnimation(CKAnimation *anim,float warplength=5.0f) CK_PURE

Stops playing a secondary animation.

Parameters

Input argument warp | A boolean indication whether a transition should be made to stop current animation.
anim | A pointer to the CKAnimation to stop.
warplength | If warp is TRUE : duration in frames of the transition, irrelevant otherwise.

Returns

CK_OK if successful,CKERR_INVALIDPARAMETER if the animation doesn't belong to the character.

See Also

PlaySecondaryAnimation


CKCharacter::AddBodyPart

Virtual Method Method CKCharacter::AddBodyPart

virtual CKERROR CKCharacter::AddBodyPart(CKBodyPart *part) CK_PURE

Adds a bodypart to this character.

Parameters

Input argument part

A pointer to the CKBodyPart to be added.

Returns

CK_OK if successful or CKERR_ALREADYPRESENT if part is already a member of this character.

See Also

RemoveBodyPart,GetRootBodyPart,GetBodyPartCount,GetBodyPart


CKCharacter::GetBodyPart

Virtual Method Method CKCharacter::GetBodyPart

virtual CKBodyPart* CKCharacter::GetBodyPart(int index) CK_PURE

Gets a bodypart at a given index.

Parameters

Input argument index

Index of the bodypart to be obtained.

Returns

A pointer to the indexth bodypart of the character.

See Also

GetRootBodyPart,AddBodyPart,RemoveBodyPart,GetBodyPartCount


CKCharacter::GetBodyPartCount

Virtual Method Method CKCharacter::GetBodyPartCount

virtual int CKCharacter::GetBodyPartCount() CK_PURE

Gets the number of bodyparts of this character.

Returns

The number of bodyparts.

See Also

GetRootBodyPart,AddBodyPart,RemoveBodyPart,GetBodyPart


CKCharacter::GetRootBodyPart

Virtual Method Method CKCharacter::GetRootBodyPart

virtual CKBodyPart *CKCharacter::GetRootBodyPart() CK_PURE

Gets the root body part.

Returns

A CKBodyPart pointer.

Remarks

A character must always have only one root object which will be used for the movement of the character.

See Also

AddBodyPart,RemoveBodyPart,GetBodyPartCount,GetBodyPart


CKCharacter::RemoveBodyPart

Virtual Method Method CKCharacter::RemoveBodyPart

virtual CKERROR CKCharacter::RemoveBodyPart(CKBodyPart *part) CK_PURE

Removes a bodypart from this character.

Parameters

Input argument part

A pointer to the CKBodyPart to be removed

Returns

CK_OK if successful,CKERR_INVALIDPARAMETER otherwise.

See Also

AddBodyPart,GetRootBodyPart,GetBodyPartCount,GetBodyPart


CKCharacter::SetRootBodyPart

Virtual Method Method CKCharacter::SetRootBodyPart

virtual CKERROR CKCharacter::SetRootBodyPart(CKBodyPart *part) CK_PURE

Forces the character to use a specific bodypart as its RootBodyPart

Parameters

Input argument part

A pointer to a CKBodyPart that should be set as the root body part.

Returns

CK_OK if successful, error code otherwise.

Remarks

When adding animations and bodyparts to a character the root bodypart is automatically detected A character must always have only one root object which will be used for the movement of the character.

See Also

GetRootBodyPart,AddBodyPart,RemoveBodyPart,GetBodyPartCount,GetBodyPart


CKCharacter::Cast

Static Object Method CKCharacter::Cast

static CKCharacter* CKCharacter::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKCharacter::GetFloorReferenceObject

Virtual Method Method CKCharacter::GetFloorReferenceObject

virtual CK3dEntity* CKCharacter::GetFloorReferenceObject() CK_PURE

Gets the entity used to represent floor reference.

Returns

A pointer to a CK3dEntity used as floor reference.

Remarks

The floor reference object is used to identify the position of the character relatively to a floor.

See Also

GetRootBodyPart, SetFloorReferenceObject.


CKCharacter::SetFloorReferenceObject

Virtual Method Method CKCharacter::SetFloorReferenceObject

virtual void CKCharacter::SetFloorReferenceObject(CK3dEntity* FloorRef) CK_PURE

Sets the entity used to represent floor reference.

Parameters

Input argument FloorRef

A pointer to a CK3dEntity used as floor reference.

Remarks

The floor reference object is used to identify the position of the character relatively to a floor.

See Also

GetRootBodyPart, GetFloorReferenceObject


CKCharacter::AlignCharacterWithRootPosition

Virtual Method Method CKCharacter::AlignCharacterWithRootPosition

virtual void CKCharacter::AlignCharacterWithRootPosition() CK_PURE

Aligns character position and orientation with its root

Remarks

This method is automatically called when automatic process of the animations is on to align the referential of the character with its root bodypart

See Also

GetRootBodyPart, ProcessAnimation, SetAutomaticProcess


CKCharacter::GetEstimatedVelocity

Virtual Method Method CKCharacter::GetEstimatedVelocity

virtual void CKCharacter::GetEstimatedVelocity(float deltat,VxVector* velocity) CK_PURE

Gets the velocity vector of the character.

Parameters

Input argument deltat | Time delay in milliseconds.
Input argument velocity | A pointer to a VxVector that will be filled with the velocity vector of the character.

Remarks

The velocity will be filled with the estimated movement made by the character in deltat milliseconds.

See Also

CKTimeManager


CKCollisionManager

Class CKCollisionManager

Collision management

CKBaseManager
Show brief derivation trees

CKCollisionManager

CKBaseManager
Show full derivation trees

CKCollisionManager

Remarks

+For its main part, the collision manager lies on the obstacle attributes. These are of two types :

Fixed Obstacle: defining the obstacle which not move from one frame to another Moving Obstacle: defining the objects susceptible to move during the processing

For these two attributes, You can precise the geometry precision (for now, only Bounding Box and Faces) and if you want to take into account the children of the obstacle, the hierarchy flags must be checked.

+You can add this attributes the normal way, by adding the beobject the attribute or by using the devoted collision manager functions : AddObstacle, AddObstacleByNames and remove them the same way. You can also iterate among the obstacles with the GetObstacle(fixed/moving)() functions.

+The main function of the Collision Manager is the DetectCollision() The goal of this function is to find if the given object (which must be marked as an obstacle) is in collision with another obstacle. It stops with the first obstacle found and can provide several impact information if the user wants them. The ImpactDesc is as follow :

  typedef struct {
    CK_ID   m_OwnerEntity;  // Child of the object tested or the object itself (can be the body part of a character)
    CK_ID   m_EntityTouched; // Precise entity touched, a child of one obstacle, or the obstacle itself (can be the body part of a character)
    CK_ID   m_ObstacleTouched; // Object with an attribute obstacle touched
    int     m_TouchedVertex;    // NOT USED YET
    int     m_TouchingVertex;   // NOT USED YET
    int     m_TouchedFace;      // NOT USED YET
    int     m_TouchingFace;     // NOT USED YET
    VxMatrix m_ImpactWorldMatrix; // a World Matrix describing the position of the tested object before it touched an obstacle
    VxVector m_ImpactPoint; // NOT USED YET
    VxVector m_ImpactNormal; // NOT USED YET
} ImpactDesc;

The collision manager keeps all the objects marked as obstacle in sorted arrays which allow it to find quickly which objects are overlapping with another one. The DetectCollision() method use this functionnality to restrict the number of complex intersection tests to perform.

One of the other functions set provided by the collision manager is the RayIntersection set. These are three functions : RayIntersection() testing the ray with all the obstacles FixedRayIntersection() testing the ray with only the fixed obstacles MovingRayIntersection() testing the ray with only the moving obstacles

The collision manager gives also access to intersection tests between two entities, at different precision level. These functions are :

CKBOOL BoxBoxIntersection(ent1,ent2);
CKBOOL BoxFaceIntersection(ent1,ent2);
CKBOOL FaceFaceIntersection(ent1,ent2);

These three functions operate at single entity level. For hierarchical detection, use :

IsInCollisionWithHierarchy()
IsHierarchyInCollisionWithHierarchy()

which operate on hierarchy. The precision level is given as argument (for now, only CKCOLLISION_BOX and CKCOLLISION_FACE)

Finally, the collision manager gives basic geometric tests functions such as :

FaceFaceIntersection();
BoxBoxIntersection();

The unique instance of CollisionManager can be retrieved by calling CKContext::GetManagerByGUID(COLLISION_MANAGER_GUID).

Groups

Advanced Intersection Functions
Pure Virtual Method Method BoxBoxIntersection | Collision detection between two 3d entities (Box against Box)
Pure Virtual Method Method BoxFaceIntersection | Collision detection between two 3d entities (Box against Faces)
Pure Virtual Method Method FaceFaceIntersection | Collision detection between two 3d entities (Faces against Faces)
Pure Virtual Method Method IsHierarchyInCollisionWithHierarchy | Check if two hierarchies are in collision.
Pure Virtual Method Method IsInCollision | Check if two 3dEntities are in collision
Pure Virtual Method Method IsInCollisionWithHierarchy | Check if an 3dEntity is in collision with another and its hierarchy.
Manager Detection
Pure Virtual Method Method DetectCollision | Check if an entity is in collision with any of the declared obstacles, at the time the function is called.
Pure Virtual Method Method ObstacleBetween | Check if an entity, declared as an obstacle, is between two other obstacle objects.
Obstacles Management
Pure Virtual Method Method AddObstacle | Declare a 3dEntity as an obstacle for the collision manager
Pure Virtual Method Method AddObstaclesByName | Declare as obstacles every 3dEntity whose name contains a certain substring
Pure Virtual Method Method GetFixedObstacle | Return the 'pos'th object declared as fixed obstacle
Pure Virtual Method Method GetFixedObstacleCount | Return the total numbers of objects declared as fixed obstacles
Pure Virtual Method Method GetMovingObstacle | Return the 'pos'th object declared as moving obstacle
Pure Virtual Method Method GetMovingObstacleCount | Return the total numbers of objects declared as moving obstacles
Pure Virtual Method Method GetObstacle | Return the 'pos'th object declared as obstacle, wheter moving or not
Pure Virtual Method Method GetObstacleCount | Return the total numbers of objects declared as obstacles
Pure Virtual Method Method IsObstacle | Remove all the entities declared so far as obstacles from the collision manager
Pure Virtual Method Method RemoveAllObstacles | Remove all the entities declared so far as obstacles from the collision manager
Pure Virtual Method Method RemoveObstacle | Remove a 3dEntity from the collision manager

See Also

CKFloorManager, CKAttributeManager


CKCollisionManager::BoxBoxIntersection

Pure Virtual Method Method CKCollisionManager::BoxBoxIntersection

virtual CKBOOL CKCollisionManager::BoxBoxIntersection(CK3dEntity* ent1,CKBOOL hiera1,CKBOOL local1,CK3dEntity* ent2,CKBOOL hiera2,CKBOOL local2)

Collision detection between two 3d entities (Box against Box)

Parameters

Input argument ent1 | the first 3dEntity
Input argument hiera1 | whether or not to test the entire hierarchy of entity 1
Input argument local1 | do we want to test the local box (more precise, slower) or the world box (less precise, faster) of the first entity
Input argument ent2 | the second 3dEntity
Input argument hiera2 | whether or not we want to test the entire hierarchy of entity 2
Input argument local2 | do we want to test the local box(more precise, slower) or the world box (less precise, faster) of the second entity

Returns

TRUE if they intersect, FALSE otherwise

See Also

BoxFaceIntersection,FaceFaceIntersection


CKCollisionManager::BoxFaceIntersection

Pure Virtual Method Method CKCollisionManager::BoxFaceIntersection

virtual CKBOOL CKCollisionManager::BoxFaceIntersection(CK3dEntity* ent1,CKBOOL hiera1,CKBOOL local1,CK3dEntity* ent2)

Collision detection between two 3d entities (Box against Faces)

Parameters

Input argument ent1 | the first 3dEntity
Input argument hiera1 | whether or not to test the entire hierarchy of entity 1
Input argument local1 | do we want to test the local box(more precise, slower) or the world box (less precise, faster) of the first entity
Input argument ent2 | the second 3dEntity

Returns

TRUE if they intersect, FALSE otherwise

See Also

BoxBoxIntersection,FaceFaceIntersection


CKCollisionManager::FaceFaceIntersection

Pure Virtual Method Method CKCollisionManager::FaceFaceIntersection

virtual CKBOOL CKCollisionManager::FaceFaceIntersection(CK3dEntity* ent1,CK3dEntity* ent2)

Collision detection between two 3d entities (Faces against Faces)

Parameters

Input argument ent1 | the first 3dEntity
Input argument ent2 | the second 3dEntity

Returns

TRUE if they intersect, FALSE otherwise

See Also

BoxBoxIntersection,BoxFaceIntersection


CKCollisionManager::IsHierarchyInCollisionWithHierarchy

Pure Virtual Method Method CKCollisionManager::IsHierarchyInCollisionWithHierarchy

virtual CKBOOL CKCollisionManager::IsHierarchyInCollisionWithHierarchy(CK3dEntity *ent,CK_GEOMETRICPRECISION precis_level1,CK3dEntity *ent2,CK_GEOMETRICPRECISION precis_level2,CK3dEntity** sub, CK3dEntity** subob)

Check if two hierarchies are in collision.

Parameters

Input argument ent | first obstacle
Input argument precis_level1 | the geometric precision level you want to use for ent1 and its hierarchy.(CKCOLLISION_NONE is not a valid value)
Input argument ent2 | second obstacle
Input argument precis_level2 | the geometric precision level you want to use for ent2 and its hierarchy.(CKCOLLISION_NONE is not a valid value)
Input argument sub | A pointer to be filled with the children of ent1 that is colliding.
Input argument subob | A pointer to be filled with the children of ent2 that is colliding.

Returns

TRUE if the two entites are colliding, FALSE otherwise.

Remarks

Check if two 3dEntities are in collision, the two considered with all their sub-hierarchy.

See Also

IsInCollision,IsHierarchyInCollisionWithHierarchy


CKCollisionManager::IsInCollision

Pure Virtual Method Method CKCollisionManager::IsInCollision

virtual CKBOOL CKCollisionManager::IsInCollision(CK3dEntity *ent,CK_GEOMETRICPRECISION precis_level1,CK3dEntity *ent2,CK_GEOMETRICPRECISION precis_level2)

Check if two 3dEntities are in collision

Parameters

Input argument ent | first obstacle
Input argument precis_level1 | the geometric precision level you want to use for ent1.(CKCOLLISION_NONE is not a valid value)
Input argument ent2 | second obstacle
Input argument precis_level2 | the geometric precision level you want to use for ent2.(CKCOLLISION_NONE is not a valid value)

Returns

TRUE if the two entites are colliding, FALSE otherwise.

Remarks

This method calls FaceFaceIntersection,BoxFaceIntersection or BoxBoxIntersection according to given precision levels.

See Also

IsInCollisionWithHierarchy,IsHierarchyInCollisionWithHierarchy


CKCollisionManager::IsInCollisionWithHierarchy

Pure Virtual Method Method CKCollisionManager::IsInCollisionWithHierarchy

virtual CK3dEntity* CKCollisionManager::IsInCollisionWithHierarchy(CK3dEntity *ent,CK_GEOMETRICPRECISION precis_level1,CK3dEntity *ent2,CK_GEOMETRICPRECISION precis_level2)

Check if an 3dEntity is in collision with another and its hierarchy.

Parameters

Input argument ent | first obstacle
Input argument precis_level1 | the geometric precision level you want to use for ent1.(CKCOLLISION_NONE is not a valid value)
Input argument ent2 | second obstacle
Input argument precis_level2 | the geometric precision level you want to use for ent2 and its hierarchy.(CKCOLLISION_NONE is not a valid value)

Returns

The pointer to the sub-object of entity 2 if the two entites are colliding, NULL otherwise.

Remarks

Check if two 3dEntities are in collision, the second one considered with all its sub-hierarchy. All the sub objects of entity 2 are tested at the same level of precision : precis_level2

See Also

IsInCollision,IsHierarchyInCollisionWithHierarchy


CKCollisionManager::DetectCollision

Pure Virtual Method Method CKCollisionManager::DetectCollision

virtual CKBOOL CKCollisionManager::DetectCollision(CK3dEntity *ent,CK_GEOMETRICPRECISION precis_level,int replacementPrecision,int detectionPrecision,CK_IMPACTINFO inmpactFlags,ImpactDesc* imp)

Check if an entity is in collision with any of the declared obstacles, at the time the function is called.

Parameters

Input argument ent | the object to be checked (it needs to be defined as an obstacle, probably moving)
Input argument precis_level | the geometric precision level you want t oforce for the tests. Use CKCOLLISION_NONE if you want the tests to use the precision chosen for each obstacle. Otherwise, you can force the tests to be on bounding boxes for everyone by transmitting CKCOLLISION_BOX for example.
Input argument replacementPrecision | an integer that describes the maximum number of tests to be executed to determine the nearest safe position to the collision point, testing backwards to the starting point. (By safe position, we mean a position with no collision at all. If it can not found anyone, the starting matrix will be given).
Input argument detectionPrecision | an integer that describes the maximum number of tests to be executed to determine if a collision occured starting with the starting point (before the behavioral process begins) and testing forward to the current point. The behavior stops testing at the first collision it encounters, then tests for a safe position from that point.
Input argument inmpactFlags | flags determining which information you want to be calculated and returned in the ImpactDesc structure.
Input argument imp | pointer to an ImpactDesc structure that will be filled with all the information you asked, NULL if you don't need these info.

Returns

TRUE if a collision occured, FALSE otherwise.

See Also

ObstacleBetween


CKCollisionManager::ObstacleBetween

Pure Virtual Method Method CKCollisionManager::ObstacleBetween

virtual CKBOOL CKCollisionManager::ObstacleBetween(const VxVector& pos,const VxVector& endpos,float width,float height)
virtual CK3dEntity* CKCollisionManager::ObstacleBetween(const VxVector& pos,const VxVector& endpos,CKBOOL iFace = TRUE, CKBOOL iFirstContact = FALSE, CKBOOL iIgnoreAlpha = FALSE, VxIntersectionDesc* oDesc = NULL)

Check if an entity, declared as an obstacle, is between two other obstacle objects.

Parameters

Input argument width | width of the beam traced, added to the right and to the left of the base ray
Input argument height | height of the beam traced, added to the top and to the bottom of the base ray
pos | first position
endpos | second position
Input argument iFace | FALSE to perform only bounding box tests , TRUE to perform face tests.
Input argument iFirstContact | TRUE to stop the test at the first contact otherwise the contact nearest to pos is returned but it is slower.
Input argument iIgnoreAlpha | if FALSE, face material and texture is taken into account and a test is perfom to check if the ray pass through a color keyed pixel.
Output argument oDesc | A structure that will be filled with detail about the intersection : position , face, etc...

Returns

TRUE if an obstacle is found in between, FALSE otherwise or a 3DEntity if an obstacle is found, NULL otherwise, in the Ray version.

Remarks

The version with a width and an height will work with the bounding boxes of the obstacle whereas the pure ray version will work at the face level.

See Also

DetectCollision


CKCollisionManager::AddObstacle

Pure Virtual Method Method CKCollisionManager::AddObstacle

virtual void CKCollisionManager::AddObstacle(CK3dEntity *ent,CKBOOL moving=FALSE,CK_GEOMETRICPRECISION precision=CKCOLLISION_BOX,CKBOOL hiera=FALSE)

Declare a 3dEntity as an obstacle for the collision manager

Parameters

Input argument ent | the 3dEntity to declare as an obstacle
Input argument moving | whether or not the declared 3dEntity will move during the processing
Input argument precision | the geometric precision we want to use when considering this entity during the collision test
Input argument hiera | whether or not we want to consider the entire hierarchy of entity

Remarks

The implementation of this method is in fact to set the FixedObstacle or MovingObstacle attribute, depending on the value of the moving parameter. It is provided for ease of use in declaring obstacles.

See Also

AddObstaclesByName,RemoveObstacle,RemoveAllObstacles,IsObstacle


CKCollisionManager::AddObstaclesByName

Pure Virtual Method Method CKCollisionManager::AddObstaclesByName

virtual int CKCollisionManager::AddObstaclesByName(CKLevel* level,CKSTRING substring,CKBOOL moving=FALSE,CK_GEOMETRICPRECISION precision=CKCOLLISION_BOX,CKBOOL hiera=FALSE)

Declare as obstacles every 3dEntity whose name contains a certain substring

Parameters

Input argument level | the level in which the manager will search the object to define
Input argument substring | substring to search in the 3dEntities name (case sensitive)
Input argument moving | whether or not the declared 3dEntities will move during the processing
Input argument precision | the geometric precision we want to use for defining these entities during the collision test
Input argument hiera | whether or not we want to consider the entire hierarchy of all the entities

Returns

Number of object defined as obstacles

Remarks

This method calls the AddObstacle methodfor each 3dEntity in level that match the substring parameter.

See Also

AddObstacle,RemoveObstacle,RemoveAllObstacles,IsObstacle


CKCollisionManager::GetFixedObstacle

Pure Virtual Method Method CKCollisionManager::GetFixedObstacle

virtual CK3dEntity* CKCollisionManager::GetFixedObstacle(int pos,CKBOOL level=FALSE)

Return the 'pos'th object declared as fixed obstacle

Parameters

Input argument pos | The index of the obstacle to return.
Input argument level | whether or not you want to consider the obstacles of the entire level or just the ones from the current scene

Returns

The 'pos'th fixed obstacle or NULL if it doesn't exist

See Also

GetFixedObstacleCount


CKCollisionManager::GetFixedObstacleCount

Pure Virtual Method Method CKCollisionManager::GetFixedObstacleCount

virtual int CKCollisionManager::GetFixedObstacleCount(CKBOOL level=FALSE)

Return the total numbers of objects declared as fixed obstacles

Parameters

Input argument level

whether or not you want to consider the obstacles of the entire level or just the ones from the current scene

Returns

The total count of fixed obstacles.

See Also

GetFixedObstacle,GetMovingObstacleCount


CKCollisionManager::GetMovingObstacle

Pure Virtual Method Method CKCollisionManager::GetMovingObstacle

virtual CK3dEntity* CKCollisionManager::GetMovingObstacle(int pos,CKBOOL level=FALSE)

Return the 'pos'th object declared as moving obstacle

Parameters

Input argument pos | The index of the obstacle to return.
Input argument level | whether or not you want to consider the obstacles of the entire level or just the ones from the current scene

Returns

The 'pos'th moving obstacle or NULL if it doesn't exist

See Also

GetMovingObstacleCount


CKCollisionManager::GetMovingObstacleCount

Pure Virtual Method Method CKCollisionManager::GetMovingObstacleCount

virtual int CKCollisionManager::GetMovingObstacleCount(CKBOOL level=FALSE)

Return the total numbers of objects declared as moving obstacles

Parameters

Input argument level

whether or not you want to consider the obstacles of the entire level or just the ones from the current scene

Returns

The total count of moving obstacles.

See Also

GetMovingObstacle,GetFixedObstacleCount


CKCollisionManager::GetObstacle

Pure Virtual Method Method CKCollisionManager::GetObstacle

virtual CK3dEntity* CKCollisionManager::GetObstacle(int pos,CKBOOL level=FALSE)

Return the 'pos'th object declared as obstacle, wheter moving or not

Parameters

Input argument pos | The index of the obstacle to return.
Input argument level | whether or not you want to consider the obstacles of the entire level or just the ones from the current scene

Returns

The 'pos'th obstacle or NULL if it doesn't exist

See Also

GetObstacleCount


CKCollisionManager::GetObstacleCount

Pure Virtual Method Method CKCollisionManager::GetObstacleCount

virtual int CKCollisionManager::GetObstacleCount(CKBOOL level=FALSE)

Return the total numbers of objects declared as obstacles

Parameters

Input argument level

whether or not you want to consider the obstacles of the entire level or just the ones from the current scene

Returns

The total count of obstacles whether fixed or moving.

See Also

GetObstacle,GetMovingObstacle,GetMovingObstacleCount,GetFixedObstacle,GetFixedObstacleCount


CKCollisionManager::IsObstacle

Pure Virtual Method Method CKCollisionManager::IsObstacle

virtual CKBOOL CKCollisionManager::IsObstacle(CK3dEntity *ent,CKBOOL moving=FALSE)

Remove all the entities declared so far as obstacles from the collision manager

Parameters

level: whether only the current scene should be considered (FALSE) or the entire level

Returns

TRUE if ent is an obstacle, FALSE otherwise

See Also

AddObstacle,AddObstaclesByName,RemoveObstacle,IsObstacle


CKCollisionManager::RemoveAllObstacles

Pure Virtual Method Method CKCollisionManager::RemoveAllObstacles

virtual void CKCollisionManager::RemoveAllObstacles(CKBOOL level=TRUE)

Remove all the entities declared so far as obstacles from the collision manager

Parameters

Input argument level

whether only the current scene should be considered (FALSE) or the entire level

See Also

AddObstacle,AddObstaclesByName,RemoveObstacle,IsObstacle


CKCollisionManager::RemoveObstacle

Pure Virtual Method Method CKCollisionManager::RemoveObstacle

virtual void CKCollisionManager::RemoveObstacle(CK3dEntity *ent)

Remove a 3dEntity from the collision manager

Parameters

Input argument ent

the 3dEntity to remove as an obstacle

Remarks

The implementation of this method is in fact to remove the FixedObstacle or MovingObstacle attribute if it was present, otherwise it does nothing.

See Also

AddObstacle,AddObstaclesByName,RemoveAllObstacles,IsObstacle


CKCurve

Class CKCurve

Representation of a 3D curve

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CKCurve

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CKCurve

Remarks

The CKCurve class is derivated from CK3dEntity. It adds functions create spline curves made up of CKCurvePoint (control points).

Each control points defines where the curve should pass and how it acts at this point (incoming and outgoing tangents or TCB parameters)

Its class id is CKCID_CURVE

Groups

Control Points | Interpolation | Settings | Representation | Cast operator

Control Points
Virtual Method Method AddControlPoint | Adds a control point to the curve.
Virtual Method Method GetControlPoint | Gets a control point according to its index.
Virtual Method Method GetControlPointCount | Returns the number of control points
Virtual Method Method GetTangents | Gets tangents to a control point
Virtual Method Method InsertControlPoint | Inserts a control point in the curve.
Virtual Method Method RemoveAllControlPoints | Removes all the control points
Virtual Method Method RemoveControlPoint | Removes a control point.
Virtual Method Method SetTangents | Sets tangents to a control point
Interpolation
Virtual Method Method GetLocalPos | Gets a local position along the curve.
Virtual Method Method GetPos | Gets a position along the curve.
Settings
Virtual Method Method Close | Sets the curve as closed .
Virtual Method Method GetFlags | Returns the entity flags
Virtual Method Method GetLength | Returns the length of the curve
Virtual Method Method GetMoveableFlags | Sets the moveable flags
Virtual Method Method IgnoreAnimations | Excludes this entity from animations.
Virtual Method Method IsOpen | Checks the curve as opened or closed.
Virtual Method Method ModifyMoveableFlags | Changes the entity flags
Virtual Method Method Open | Sets the curve as opened .
Virtual Method Method SetFittingCoeff | Sets the fitting coefficient for the curve.
Virtual Method Method SetFlags | Sets the entity flags
Virtual Method Method SetPickable | Sets if the entity should be pickable
Virtual Method Method SetRenderAsTransparent | Makes this entity to be rendered as other transparents objects
Representation
Virtual Method Method CreateLineMesh | Creates a line mesh to represent the curve
Virtual Method Method GetColor | Gets the color used for the curve mesh.
Virtual Method Method SetColor | Sets the color used for the curve mesh.
Virtual Method Method SetStepCount | Sets the number of segments used to represent the cruve.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.

See Also

CKCurvePoint


CKCurve::AddControlPoint

Virtual Method Method CKCurve::AddControlPoint

virtual CKERROR CKCurve::AddControlPoint(CKCurvePoint *pt) CK_PURE

Adds a control point to the curve.

Parameters

Input argument pt

A pointer to the CKCurvePoint to add.

Returns

CK_OK if successful, an error code otherwise.

See Also

RemoveControlPoint,InsertControlPoint,GetControlPointCount,GetControlPoint


CKCurve::GetControlPoint

Virtual Method Method CKCurve::GetControlPoint

virtual CKCurvePoint *CKCurve::GetControlPoint(int pos) CK_PURE

Gets a control point according to its index.

Parameters

Input argument pos

Index of the cotrol point to retrieve.

Returns

A pointer to the CKCurvePoint.

See Also

RemoveControlPoint,InsertControlPoint,GetControlPointCount,AddControlPoint


CKCurve::GetControlPointCount

Virtual Method Method CKCurve::GetControlPointCount

virtual int CKCurve::GetControlPointCount() CK_PURE

Returns the number of control points

Returns

Number of control points

See Also

RemoveControlPoint,InsertControlPoint,AddControlPoint,GetControlPoint


CKCurve::GetTangents

Virtual Method Method CKCurve::GetTangents

virtual CKERROR CKCurve::GetTangents(int index,VxVector *in,VxVector *out) CK_PURE
virtual CKERROR CKCurve::GetTangents(CKCurvePoint *pt,VxVector *in,VxVector *out) CK_PURE

Gets tangents to a control point

Parameters

Input argument index | Index of the control point to get the tangents of.
Input argument pt | A pointer to the CKCurvePoint to get the tangents of.
in | A pointer to a VxVector containing incoming tangent.
out | A pointer to a VxVector containing outgoing tangent.

Returns

CK_OK if successful,an error code otherwise.

See Also

SetTangents


CKCurve::InsertControlPoint

Virtual Method Method CKCurve::InsertControlPoint

virtual CKERROR CKCurve::InsertControlPoint(CKCurvePoint *prev,CKCurvePoint *pt) CK_PURE

Inserts a control point in the curve.

Parameters

Input argument prev | A pointer to the control point after which the point should be inserted.
Input argument pt | A pointer to the control point to insert.

Returns

CK_OK if successful or an error code otherwise.

See Also

RemoveControlPoint,AddControlPoint,GetControlPointCount,GetControlPoint


CKCurve::RemoveAllControlPoints

Virtual Method Method CKCurve::RemoveAllControlPoints

virtual CKERROR CKCurve::RemoveAllControlPoints() CK_PURE

Removes all the control points

Returns

CK_OK if successful, an error code otherwise.

See Also

RemoveControlPoint


CKCurve::RemoveControlPoint

Virtual Method Method CKCurve::RemoveControlPoint

virtual CKERROR CKCurve::RemoveControlPoint(CKCurvePoint *pt,CKBOOL removeall=FALSE) CK_PURE

Removes a control point.

Parameters

Input argument pt | A pointer to the control point to remove.
Input argument removeall | TRUE if all references to the control point should be removed.

Returns

CK_OK if successful or CKERR_INVALIDPARAMETER if pt is an invalid control point

See Also

RemoveAllControlPoints,InsertControlPoint,AddControlPoint,GetControlPointCount,GetControlPoint


CKCurve::SetTangents

Virtual Method Method CKCurve::SetTangents

virtual CKERROR CKCurve::SetTangents(int index,VxVector *in,VxVector *out) CK_PURE
virtual CKERROR CKCurve::SetTangents(CKCurvePoint *pt,VxVector *in,VxVector *out) CK_PURE

Sets tangents to a control point

Parameters

Input argument index | Index of the control point to get the tangents of.
Input argument pt | A pointer to the CKCurvePoint to get the tangents of.
in | A pointer to a VxVector containing incoming tangent.
out | A pointer to a VxVector containing outgoing tangent.

Returns

CK_OK if successful,an error code otherwise.

See Also

GetTangents


CKCurve::GetLocalPos

Virtual Method Method CKCurve::GetLocalPos

virtual CKERROR CKCurve::GetLocalPos(float step,VxVector *pos,VxVector *dir=NULL) CK_PURE

Gets a local position along the curve.

Parameters

Input argument step | A float coefficient between 0 and 1 indicating position along the curve.
Input argument pos | A pointer to a VxVector which will be filled with position on the curve at specified step.
Input argument dir | A optionnal pointer to a VxVector which will contain the direction of the curve at the specified step.

Returns

CK_OK if successful or an error code otherwise.

Remarks

The returned position is given in the curve referential

See Also

GetPos


CKCurve::GetPos

Virtual Method Method CKCurve::GetPos

virtual CKERROR CKCurve::GetPos(float step,VxVector *pos,VxVector *dir=NULL) CK_PURE

Gets a position along the curve.

Parameters

Input argument step | A float coefficient between 0 and 1 indicating position along the curve.
Input argument pos | A pointer to a VxVector which will be filled with position on the curve at specified step.
Input argument dir | A optional pointer to a VxVector which will contain the direction of the curve at the specified step.

Returns

CK_OK if successful or an error code otherwise.

Remarks

The returned position is given in the world referential.

See Also

GetLocalPos


CKCurve::Close

Virtual Method Method CKCurve::Close

virtual void CKCurve::Close() CK_PURE

Sets the curve as closed .

See Also

IsOpen,Open


CKCurve::GetLength

Virtual Method Method CKCurve::GetLength

virtual float CKCurve::GetLength() CK_PURE

Returns the length of the curve

Returns

Length of the curve

Remarks

The curve length is updated every time a curvepoint moves.

See Also

SetLength


CKCurve::IsOpen

Virtual Method Method CKCurve::IsOpen

virtual CKBOOL CKCurve::IsOpen() CK_PURE

Checks the curve as opened or closed.

Returns

TRUE if the curve is opened.

See Also

Close, Open


CKCurve::Open

Virtual Method Method CKCurve::Open

virtual void CKCurve::Open() CK_PURE

Sets the curve as opened .

See Also

IsOpen,Close


CKCurve::SetFittingCoeff

Virtual Method Method CKCurve::SetFittingCoeff

virtual void CKCurve::SetFittingCoeff(float fit) CK_PURE
virtual float CKCurve::GetFittingCoeff() CK_PURE

Sets the fitting coefficient for the curve.

Parameters

Input argument fit

Fitting coefficient.

Remarks

A fitting coefficient of 0 make the curve pass by every control point.

See Also

GetFittingCoeff


CKCurve::CreateLineMesh

Virtual Method Method CKCurve::CreateLineMesh

virtual CKERROR CKCurve::CreateLineMesh() CK_PURE

Creates a line mesh to represent the curve

Returns

CK_OK if successful an error code otherwise.

See Also

SetStepCount,SetColor


CKCurve::GetColor

Virtual Method Method CKCurve::GetColor

virtual VxColor CKCurve::GetColor() CK_PURE

Gets the color used for the curve mesh.

Returns

Current color.

See Also

SetColor


CKCurve::SetColor

Virtual Method Method CKCurve::SetColor

virtual void CKCurve::SetColor(const VxColor& Color) CK_PURE

Sets the color used for the curve mesh.

Parameters

Input argument Color

new color for the curve.

See Also

GetColor,CreateLineMesh


CKCurve::SetStepCount

Virtual Method Method CKCurve::SetStepCount

virtual CKERROR CKCurve::SetStepCount(int steps) CK_PURE
virtual int CKCurve::GetStepCount() CK_PURE

Sets the number of segments used to represent the cruve.

Parameters

Input argument steps

Number of segments.

Returns

CK_OK, if successful

Remarks

A line mesh can be created to represent the curve with CreateLineMesh, this method sets the number of segments used for this mesh.

See Also

GetStepCount


CKCurve::Cast

Static Object Method CKCurve::Cast

static CKCurve* CKCurve::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKCurvePoint

Class CKCurvePoint

Class describing curve control point (tangent and TCB parameters )

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CKCurvePoint

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CKCurvePoint

Remarks

A Control point describes where a curve should pass and how it should behave at this point. This can be set using incoming and outgoing tangents or using TCB parameters which are tension, continuity and bias.

The class id of CKCurvePoint is CKCID_CURVEPOINT.

Groups

TCB Parameters
Virtual Method Method GetBias | Gets the Bias of the curve at this point.
Virtual Method Method GetContinuity | Gets the Continuity of the curve at this point
Virtual Method Method GetTension | Gets the Tension of the curve at this point
Virtual Method Method IsTCB | Checks the usage of TCB parameters.
Virtual Method Method SetBias | Sets the Bias of the curve at this point
Virtual Method Method SetContinuity | Sets the Continuity of the curve at this point
Virtual Method Method SetTension | Sets the Tension of the curve at this point
Virtual Method Method UseTCB | Uses TCB data or explicit tangents
Tangents
Virtual Method Method GetTangents | Gets the tangents of the curve at this control point.
Virtual Method Method SetTangents | Sets the tangents at this point.
Misc
Virtual Method Method GetCurve | Gets the curve which owns this control point.
Virtual Method Method GetLength | Gets Curve length at this point.
Virtual Method Method IsLinear | Checks whether the curve is linear from this point to the next.
Virtual Method Method NotifyUpdate | Notifies the curve if any parameter gets modified.
Virtual Method Method SetLinear | Sets the curve to be linear from this point to the next.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.

See Also

CKCurve


CKCurvePoint::GetBias

Virtual Method Method CKCurvePoint::GetBias

virtual float CKCurvePoint::GetBias() CK_PURE

Gets the Bias of the curve at this point.

Returns

Bias Value.

See Also

SetBias, SetTension, SetContinuity.


CKCurvePoint::GetContinuity

Virtual Method Method CKCurvePoint::GetContinuity

virtual float CKCurvePoint::GetContinuity() CK_PURE

Gets the Continuity of the curve at this point

Returns

Continuity value.

See Also

SetBias, SetTension, SetContinuity.


CKCurvePoint::GetTension

Virtual Method Method CKCurvePoint::GetTension

virtual float CKCurvePoint::GetTension() CK_PURE

Gets the Tension of the curve at this point

Returns

Tension Value.

See Also

SetBias, SetTension, SetContinuity.


CKCurvePoint::IsTCB

Virtual Method Method CKCurvePoint::IsTCB

virtual CKBOOL CKCurvePoint::IsTCB() CK_PURE

Checks the usage of TCB parameters.

Returns

TRUE to force usage of TCB data, FALSE to use tangents.

See Also

UseTCB


CKCurvePoint::SetBias

Virtual Method Method CKCurvePoint::SetBias

virtual void CKCurvePoint::SetBias(float b) CK_PURE

Sets the Bias of the curve at this point

Parameters

Input argument b

Bias value

See Also

GetBias, SetTension, SetContinuity.


CKCurvePoint::SetContinuity

Virtual Method Method CKCurvePoint::SetContinuity

virtual void CKCurvePoint::SetContinuity(float c) CK_PURE

Sets the Continuity of the curve at this point

Parameters

Input argument c

Continuity value.

See Also

SetBias, SetTension, GetContinuity.


CKCurvePoint::SetTension

Virtual Method Method CKCurvePoint::SetTension

virtual void CKCurvePoint::SetTension(float t) CK_PURE

Sets the Tension of the curve at this point

Parameters

Input argument t

Tension value

See Also

SetBias, GetTension, SetContinuity.


CKCurvePoint::UseTCB

Virtual Method Method CKCurvePoint::UseTCB

virtual void CKCurvePoint::UseTCB(CKBOOL use=TRUE) CK_PURE

Uses TCB data or explicit tangents

Parameters

Input argument use

TRUE to force usage of TCB data, FALSE to use tangents.

Remarks

Each curve point has incoming and outgoing tangents. These tangents can be automatically calculated using TCB parameters ( SetTension,SetContinuity,SetBias) or given explicitly through SetTangents

See Also

SetTangents,SetTension,SetContinuity,SetBias


CKCurvePoint::GetTangents

Virtual Method Method CKCurvePoint::GetTangents

virtual void CKCurvePoint::GetTangents(VxVector *in,VxVector *out) CK_PURE

Gets the tangents of the curve at this control point.

Parameters

Input argument in | pointer to VxVector
Input argument out | pointer to VxVector

See Also

SetTangents


CKCurvePoint::SetTangents

Virtual Method Method CKCurvePoint::SetTangents

virtual void CKCurvePoint::SetTangents(VxVector *in,VxVector *out) CK_PURE

Sets the tangents at this point.

Parameters

Input argument in | A pointer to VxVector to the incoming tangent
Input argument out | A pointer to VxVector to the outgoin tangent

Remarks

Sets the incoming and outgoing tangents to the curve at this control point.

See Also

GetTangents


CKCurvePoint::GetCurve

Virtual Method Method CKCurvePoint::GetCurve

virtual CKCurve *CKCurvePoint::GetCurve() CK_PURE

Gets the curve which owns this control point.

Returns

Pointer to CKCurve

See Also

CKCurve


CKCurvePoint::GetLength

Virtual Method Method CKCurvePoint::GetLength

virtual float CKCurvePoint::GetLength() CK_PURE

Gets Curve length at this point.

Returns

Length of the curve from the first control point to this point.

See Also

CKCurve::GetLength


CKCurvePoint::IsLinear

Virtual Method Method CKCurvePoint::IsLinear

virtual CKBOOL CKCurvePoint::IsLinear() CK_PURE

Checks whether the curve is linear from this point to the next.

Returns

TRUE if it is linear, FALSE otherwise.

See Also

SetLinear


CKCurvePoint::NotifyUpdate

Virtual Method Method CKCurvePoint::NotifyUpdate

virtual void CKCurvePoint::NotifyUpdate() CK_PURE

Notifies the curve if any parameter gets modified.

Remarks

Notifies the curve that it should be updated.


CKCurvePoint::SetLinear

Virtual Method Method CKCurvePoint::SetLinear

virtual void CKCurvePoint::SetLinear(CKBOOL linear=FALSE) CK_PURE

Sets the curve to be linear from this point to the next.

Parameters

Input argument linear

TRUE to set the curve to linear FALSE otherwise.

See Also

IsLinear


CKCurvePoint::Cast

Static Object Method CKCurvePoint::Cast

static CKCurvePoint* CKCurvePoint::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKFloorManager

Class CKFloorManager

Floors management

CKBaseManager
Show brief derivation trees

CKFloorManager

CKBaseManager
Show full derivation trees

CKFloorManager

Remarks

The floor manager will keep the count of the floor objects, marked with the Floor attribute, or registered directly to the FloorManager. These floors will be used for intersection tests, at a precision level depending on their attribute, wheen looking for the floor under an object or a character, so that it can follow the landscape.

The unique instance of CKFloorManager can be retrieved by calling CKContext::GetManagerByGUID(FLOOR_MANAGER_GUID).

Groups

Floor Processing
Pure Virtual Method Method ConstrainToFloor | Constrain a moving point in the edges of the current floors, with a given radius.
Pure Virtual Method Method GetNearestFloor | Returns the nearest floor (up floor or down floor, if available).
Pure Virtual Method Method GetNearestFloors | Returns the nearest floors (up floor and down floor, if availables).
Floor Registration
Pure Virtual Method Method AddFloorObject | Declares an object as a floor.
Pure Virtual Method Method AddFloorObjectsByName | Declares objects as floors, based on their name.
Pure Virtual Method Method GetFloorObject | Returns the floor object at the given index.
Pure Virtual Method Method GetFloorObjectCount | Returns the floor object count.
Pure Virtual Method Method RemoveFloorObject | Unregister a floor object.
Floors Cache Management
Pure Virtual Method Method GetCacheSize | Gets the current number of positions kept by the cache.
Pure Virtual Method Method GetCacheThreshold | Returns the current threshold use by the cache system of the FloorManager
Pure Virtual Method Method SetCacheSize | Sets the number of positions kept by the cache.
Pure Virtual Method Method SetCacheThreshold | Set the current threshold use by the cache system of the FloorManager
Limit Angle
Pure Virtual Method Method SetLimitAngle | Sets/Gets the angle above which faces are not considered as floors.

See Also

CKCollisionManager, CKAttributeManager


CKFloorManager::ConstrainToFloor

Pure Virtual Method Method CKFloorManager::ConstrainToFloor

virtual CKBOOL CKFloorManager::ConstrainToFloor(const VxVector &iPosition, float iRadius, VxVector* oPosition, CKAttributeType iExcludeAttribute = -1)
virtual CKBOOL CKFloorManager::ConstrainToFloor(const VxVector &iOldPosition, const VxVector &iPosition, float iRadius, VxVector* oPosition, CKAttributeType iExcludeAttribute = -1)

Constrain a moving point in the edges of the current floors, with a given radius.

Parameters

Input argument iOldPosition | the old position in world space to be tested.
Input argument iPosition | the current position in world space to be tested.
Input argument iRadius | float describing the radius of the object to constrain
Input argument oPosition | the new position of the vector, in world space, if constraint has been done.
Input argument iExcludeAttribute | attribute that will exclude a found floor. from the process

Returns

TRUE if the position has been constrained, FALSE otherwise,

See Also

GetNearestFloors


CKFloorManager::GetNearestFloor

Pure Virtual Method Method CKFloorManager::GetNearestFloor

virtual CK_FLOORNEAREST CKFloorManager::GetNearestFloor(const VxVector &iPosition, CK3dEntity** oFloor, int* oFaceIndex=NULL, VxVector* oNormal=NULL, float* oDistance=NULL, CK3dEntity* iExcludeFloor = NULL)

Returns the nearest floor (up floor or down floor, if available).

Parameters

Input argument iPosition | a vector in world space to be tested.
Input argument oFloor | address of a pointer that will be filled by the function to point on the nearest floor
Input argument oFaceIndex | index of the floor face intersecting the vertical to iPosition
Input argument oNormal | normal of the floor at the intersection with the vertical to iPosition
Input argument oDistance | vertical distance between iPosition and the floor
Input argument iExcludeFloor | if given, floor to exclude from the detection

Returns

Value | Meaning
CKFLOOR_NOFLOOR | if no floor is available,
CKFLOOR_DOWN | if the down floor is the nearest (or only)
CKFLOOR_UP | if the up floor is the nearest (or only)

Remarks

+Faces with an angle greater than the angle limit will be rejected. +The test for floors will be done on the Y world axis, so you cannot for example use this function for doing a looping in a rollercoaster for example.


CKFloorManager::GetNearestFloors

Pure Virtual Method Method CKFloorManager::GetNearestFloors

virtual CK_FLOORNEAREST CKFloorManager::GetNearestFloors(const VxVector &iPosition, CKFloorPoint* oFP,CK3dEntity* iExcludeFloor = NULL)

Returns the nearest floors (up floor and down floor, if availables).

Parameters

Input argument iPosition | a vector in world space to be tested.
Input argument oFP | a pointer on an existing CKFloorPoint structure.
Input argument iExcludeFloor | if given, floor to exclude from the detection

Returns

Value | Meaning
CKFLOOR_NOFLOOR | if no floor is available,
CKFLOOR_DOWN | if the down floor is the nearest (or only)
CKFLOOR_UP | if the up floor is the nearest (or only)

Remarks

+The structure is filled with the nearest floor downward the point and the nearest floor upward the point. The distance from the intersection point, the index of the face and its normal (in the floor referential) are also given.

+Faces with an angle greater than the angle limit will be rejected.

+The test for floors will be done on the Y world axis, so you cannot for example use this function for doing a looping in a rollercoaster for example.

See Also

CKFloorPoint


CKFloorManager::AddFloorObject

Pure Virtual Method Method CKFloorManager::AddFloorObject

virtual void CKFloorManager::AddFloorObject(CK3dEntity *ent,CK_FLOORGEOMETRY geo,CKBOOL moving,int type,CKBOOL hiera,CKBOOL first)

Declares an object as a floor.

Parameters

Input argument ent | object to register as floor.
Input argument geo | geometry precision of the floor (CKFLOOR_FACES or CKFLOOR_BOX).
Input argument moving | will the floor be moving or not.
Input argument type | integer provided by the user to “type” the floors.
Input argument hiera | should the hierarchy of the floor considered too.
Input argument first | should the intersection test at the first contact (assuming that the floor faces does not overlap in the Y axis).

See Also

RemoveFloorObject,AddFloorObjectsByName,GetFloorObjectCount,GetFloorObject


CKFloorManager::AddFloorObjectsByName

Pure Virtual Method Method CKFloorManager::AddFloorObjectsByName

virtual int CKFloorManager::AddFloorObjectsByName(CKLevel *level,CKSTRING floorname,CK_FLOORGEOMETRY geo,CKBOOL moving,int type,CKBOOL hiera,CKBOOL first)

Declares objects as floors, based on their name.

Parameters

Input argument level | level containg the objects to parse.
Input argument floorname | string to be seach in the object name.
Input argument geo | geometry precision of the floor (CKFLOOR_FACES or CKFLOOR_BOX).
Input argument moving | will the floor be moving or not.
Input argument type | integer provided by the user to “type” the floors.
Input argument hiera | should the hierarchy of the floor considered too.
Input argument first | should the intersection test at the first contact (asuming that the floor faces does not overlap in the Y axis).

Returns

count of the declared floors.

See Also

AddFloorObject,RemoveFloorObject,GetFloorObjectCount,GetFloorObject


CKFloorManager::GetFloorObject

Pure Virtual Method Method CKFloorManager::GetFloorObject

virtual CK3dEntity* CKFloorManager::GetFloorObject(int pos)

Returns the floor object at the given index.

Parameters

Input argument pos

index of the floor to obtain.

Returns

The floor at the given index.

See Also

AddFloorObject,AddFloorObjectsByName,RemoveFloorObject,GetFloorObject


CKFloorManager::GetFloorObjectCount

Pure Virtual Method Method CKFloorManager::GetFloorObjectCount

virtual int CKFloorManager::GetFloorObjectCount()

Returns the floor object count.

Returns

Number of floor objects.

See Also

AddFloorObject,AddFloorObjectsByName,RemoveFloorObject,GetFloorObject


CKFloorManager::RemoveFloorObject

Pure Virtual Method Method CKFloorManager::RemoveFloorObject

virtual void CKFloorManager::RemoveFloorObject(CK3dEntity *ent)

Unregister a floor object.

Parameters

Input argument ent

object to unregister as a floor.

See Also

AddFloorObject,AddFloorObjectsByName,GetFloorObjectCount,GetFloorObject


CKFloorManager::GetCacheSize

Pure Virtual Method Method CKFloorManager::GetCacheSize

virtual int CKFloorManager::GetCacheSize()

Gets the current number of positions kept by the cache.

Returns

The current number of positions kept by the cache.

Remarks

Gets the current number of positions kept by the cache.

See Also

GetCacheThreshold,SetCacheThreshold,GetNearestFloors,SetCacheSize


CKFloorManager::GetCacheThreshold

Pure Virtual Method Method CKFloorManager::GetCacheThreshold

virtual float CKFloorManager::GetCacheThreshold()

Returns the current threshold use by the cache system of the FloorManager

Returns

A floating point value representing the threshold in all the 2 axis, x and z.

Remarks

Return the current threshold use by the cache system of the FloorManager. A cached point is reused if a newly asked point fell in the threshold proximity of it.

See Also

GetNearestFloors,


CKFloorManager::SetCacheSize

Pure Virtual Method Method CKFloorManager::SetCacheSize

virtual void CKFloorManager::SetCacheSize(int size)

Sets the number of positions kept by the cache.

Parameters

Input argument size

The current number of positions kept by the cache.

Remarks

Sets the current number of positions kept by the cache. Warning : It clear the current cache as well...

See Also

GetCacheThreshold,SetCacheThreshold,GetNearestFloors,GetCacheSize


CKFloorManager::SetCacheThreshold

Pure Virtual Method Method CKFloorManager::SetCacheThreshold

virtual void CKFloorManager::SetCacheThreshold(float t)

Set the current threshold use by the cache system of the FloorManager

Parameters

Input argument t

A floating point value representing the threshold in all the 2 axis, x and z.

Remarks

Set the current threshold use by the cache system of the FloorManager. When a call to GetNearestFloor is performed, the position given is kept with the nearest face found from the nearest floor found. When GetNearestFloors is called again, if first test all the kept point, with a fixed threshold, to accelerate the detection when the object has not moved, or just a little.

See Also

FloorManager, FloorManager::GetNearestFloors


CKFloorManager::SetLimitAngle

Pure Virtual Method Method CKFloorManager::SetLimitAngle

virtual void CKFloorManager::SetLimitAngle(float angle)
virtual float CKFloorManager::GetLimitAngle()

Sets/Gets the angle above which faces are not considered as floors.

Parameters

Input argument angle

angle in radian, between 0 and PI/2

Remarks

By default, this angle is set to PI/4


CKGrid

Class CKGrid

Class for Grids

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CKGrid

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CKGrid

Remarks

Grids are a simple and useful way of adding and retrieving information in the 3D scene. A grid is an array of cells which can contain different values.

A grid is considered to have limit in height defined by SetHeightValidity below which points are considered as belonging to the grid.

A grid can contains several layers that store information in a array of squares.

The CKGridManager is used to declare the existing types of layers and to acces the grids in their globality.

Methods can convert from a given world position to a specific square in the grid.

Grids can have classification (kind of attribute) to help organize very complex scene.

Priority can be set on grids especially when several grids overlap so the CKgridManager::GetPreferredGrid returns the desired grid when finding on which grid a point should be tested.

The Class Identifier of a Grid is CKCID_GRID

Groups

Height | Dimensions | Layer | Activation | Orientation | Coordinates | Priority | Classification | Cast operator | Interface Data Construction

Height
Virtual Method Method GetHeightValidity | Returns the grid Height Validity of the grid.
Virtual Method Method SetHeightValidity | Sets the Height of Validity of the grid.
Dimensions
Virtual Method Method GetLength | Returns the grid Length
Virtual Method Method GetWidth | Returns the grid Width
Virtual Method Method SetDimensions | Sets the grid's dimensions
Layer
Virtual Method Method AddLayer | Adds a layer to the grid
Virtual Method Method GetLayer | Gets a layer by its type number, or by its type name
Virtual Method Method GetLayerByIndex | Gets a layer by its index in the layers of the grid
Virtual Method Method GetLayerCount | Gets the number of layers in the grid
Virtual Method Method RemoveAllLayers | Removes all the layers from the grid
Virtual Method Method RemoveLayer | Removes a layer by its type number, or by its type name
Activation
Virtual Method Method IsActive | Returns whether the grid is active or not
Orientation
Virtual Method Method GetOrientationMode | Gets the grid's Orientation mode
Virtual Method Method SetOrientationMode | Sets the grid's Orientation mode
Coordinates
Virtual Method Method Get2dCoordsFrom3dPos | Converts a 3d position into the corresponding 2d grid coordinates
Virtual Method Method Get3dPosFrom2dCoords | Convert a 2 coordinate position on the grid, into a 3d position in world coordinate system
Priority
Virtual Method Method GetGridPriority | Gets the Priority of the grid
Virtual Method Method SetGridPriority | Sets the Priority to the grid
Classification
Virtual Method Method AddClassification | Adds a classification to the grid
Virtual Method Method HasCompatibleClass | Check if the grid has a shared Classification.
Virtual Method Method RemoveClassification | Removes a classification from the grid
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Interface Data Construction
Virtual Method Method ConstructMeshTexture | Construct the mesh materials, and texture associated with the grid
Virtual Method Method DestroyMeshTexture | Destroy the mesh, materials and texture associated with the grid

See Also

CKLayer,CKGridManager


CKGrid::GetHeightValidity

Virtual Method Method CKGrid::GetHeightValidity

virtual float CKGrid::GetHeightValidity() CK_PURE

Returns the grid Height Validity of the grid.

Returns

Height of Validity

Remarks

Just retrieves the Y axis scale of the grid.

See Also

SetHeightValidity


CKGrid::SetHeightValidity

Virtual Method Method CKGrid::SetHeightValidity

virtual void CKGrid::SetHeightValidity(float HeightValidity) CK_PURE

Sets the Height of Validity of the grid.

Parameters

Input argument HeightValidity

the height of validity used to define the grid thickness.

Remarks

HEIGHT VALIDITY

Changing the Height of Validity only changes the Y axis scale of the grid.

See Also

GetHeightValidity


CKGrid::GetLength

Virtual Method Method CKGrid::GetLength

virtual int CKGrid::GetLength() CK_PURE

Returns the grid Length

Returns

Length in number of squares

Remarks

Length

Number of squares along the Z axis

See Also

GetWidth


CKGrid::GetWidth

Virtual Method Method CKGrid::GetWidth

virtual int CKGrid::GetWidth() CK_PURE

Returns the grid Width

Returns

Width in number of squares

Remarks

Width

Number of squares along the X axis

See Also

GetLength


CKGrid::SetDimensions

Virtual Method Method CKGrid::SetDimensions

virtual void CKGrid::SetDimensions(int width, int length, float sizeX, float sizeY) CK_PURE

Sets the grid's dimensions

Parameters

Input argument width | Number of square along X axis
Input argument length | Number of square along Z axis
Input argument sizeX | total world size of the grid's width
Input argument sizeY | total world size of the grid's length

Remarks

DIMENSIONS

This function simply sets the grid's scale so that the grids bounding box (X,Z) has a total size of (sizeX,sizeY). This DOES NOT change the number of square in the grid. To achieve this you must manually remove all the layers from the grid using RemoveAllLayers (and eventually storing them in memory if information should be kept) then call SetDimensions and AddLayer to recreate the layers.

See Also

GetWidth, GetLength


CKGrid::AddLayer

Virtual Method Method CKGrid::AddLayer

virtual CKLayer *CKGrid::AddLayer(int type, int Format=CKGRID_LAYER_FORMAT_NORMAL) CK_PURE
virtual CKLayer *CKGrid::AddLayer(CKSTRING TypeName=NULL, int Format=CKGRID_LAYER_FORMAT_NORMAL) CK_PURE

Adds a layer to the grid

Parameters

Input argument type | Layer type.
Input argument TypeName | Name of the layer type (eg: “collision”, “roughness”, ...). The name of the layer must have been registered with CKGridManager::RegisterType.
Format | Layer Format (by default and only valid value : CKGRID_LAYER_FORMAT_NORMAL).

Returns

A pointer to the newly created layer if successful, NULL otherwise (for example, if the layer type was not registred, or if a layer with the same type is already included in the grid)

Remarks

LAYERS

SetDimensions must have been called before using this method.

See Also

GetLayer, GetLayerCount, RemoveLayer, RemoveAllLayers


CKGrid::GetLayer

Virtual Method Method CKGrid::GetLayer

virtual CKLayer *CKGrid::GetLayer(int type) CK_PURE
virtual CKLayer *CKGrid::GetLayer(CKSTRING TypeName) CK_PURE

Gets a layer by its type number, or by its type name

Parameters

Input argument type | Layer type
Input argument TypeName | Layer type name

Returns

A pointer to the wanted layer if successful, NULL otherwise

See Also

AddLayer, GetLayerCount, RemoveLayer, RemoveAllLayers


CKGrid::GetLayerByIndex

Virtual Method Method CKGrid::GetLayerByIndex

virtual CKLayer *CKGrid::GetLayerByIndex(int type) CK_PURE

Gets a layer by its index in the layers of the grid

Parameters

index: The index in the layer array, starting at 0

Returns

A pointer to the wanted layer if successful, NULL otherwise

See Also

GetLayer, GetLayerCount,RemoveLayer


CKGrid::GetLayerCount

Virtual Method Method CKGrid::GetLayerCount

virtual int CKGrid::GetLayerCount() CK_PURE

Gets the number of layers in the grid

Returns

the grid's layers count

See Also

GetLayer,GetLayerByIndex


CKGrid::RemoveAllLayers

Virtual Method Method CKGrid::RemoveAllLayers

virtual CKERROR CKGrid::RemoveAllLayers( void ) CK_PURE

Removes all the layers from the grid

Returns

Value | Meaning
CKERROR | CK_OK if successful , Error Code otherwise

See Also

RemoveLayer, AddLayer, GetLayer, GetLayerCount


CKGrid::RemoveLayer

Virtual Method Method CKGrid::RemoveLayer

virtual CKERROR CKGrid::RemoveLayer(int type) CK_PURE
virtual CKERROR CKGrid::RemoveLayer(CKSTRING TypeName) CK_PURE

Removes a layer by its type number, or by its type name

Parameters

Input argument type | Type of the layer to be deleted
Input argument TypeName | Name of the type of the layer to be deletet

Returns

Value | Meaning
CKERROR | CK_OK if successful , Error Code otherwise

See Also

RemoveAllLayers, AddLayer, GetLayer, GetLayerCount


CKGrid::IsActive

Virtual Method Method CKGrid::IsActive

virtual CKBOOL CKGrid::IsActive() CK_PURE

Returns whether the grid is active or not

Returns

TRUE if the grid is active, FALSE otherwise.

Remarks

ACTIVATION

Returns if the grid is active or not. The grid is active by default when created. This function just read the CK_SCENEOBJECT_ACTIVE flag of the Grid. This flag, as any other scene object can be modified from the “Level View” or using the CKScene::ModifyObjectFlags method. An inactive grid won't be parsed by the Grid Manager


CKGrid::GetOrientationMode

Virtual Method Method CKGrid::GetOrientationMode

virtual CK_GRIDORIENTATION CKGrid::GetOrientationMode() CK_PURE

Gets the grid's Orientation mode

Returns

the orientation mode (CK_GRIDORIENTATION)

Remarks

A grid can be forced to be aligned on specific axis.

See Also

SetOrientationMode


CKGrid::SetOrientationMode

Virtual Method Method CKGrid::SetOrientationMode

virtual void CKGrid::SetOrientationMode( CK_GRIDORIENTATION orimode ) CK_PURE

Sets the grid's Orientation mode

Parameters

Input argument orimode

The orientation mode

Remarks

ORIENTATION

A grid can be forced to be aligned on specific axis.

See Also

GetOrientationMode,CK_GRIDORIENTATION


CKGrid::Get2dCoordsFrom3dPos

Virtual Method Method CKGrid::Get2dCoordsFrom3dPos

virtual float CKGrid::Get2dCoordsFrom3dPos(const VxVector *pos3d, int *x, int *y) CK_PURE

Converts a 3d position into the corresponding 2d grid coordinates

Parameters

Input argument pos3d | adress of the 3d position vector (expressed in world coordinate system)
Input argument x | adress of the integer to be filled with the x coordinate
Input argument y | adress of the integer to be filled with the y coordinate

Returns

A float that describe the validity height of the given 3d position : Between 0 and 1 the point is in the height validity.

Remarks

COORDINATES

See Also

Get3dPosFrom2dCoords


CKGrid::Get3dPosFrom2dCoords

Virtual Method Method CKGrid::Get3dPosFrom2dCoords

virtual void CKGrid::Get3dPosFrom2dCoords(VxVector *pos3d, int x, int z) CK_PURE

Convert a 2 coordinate position on the grid, into a 3d position in world coordinate system

Parameters

Input argument pos3d | adresse of the 3d position vector (expressed in world coordinate system)
Input argument x | x (width) coordinate in the grid square array
Input argument z | z (height) coordinate in the grid square array

Remarks

The 3d position is the position middle point of the square(x,y) in the grid. returned Y position = 0 (in grid referential)

See Also

Get2dCoordsForm3dPos


CKGrid::GetGridPriority

Virtual Method Method CKGrid::GetGridPriority

virtual int CKGrid::GetGridPriority() CK_PURE

Gets the Priority of the grid

Returns

The grid priority

Remarks

Priority can be set on grids especially when several grids overlap so the CKgridManager::GetPreferredGrid returns the desired grid when finding on which grid a point should be tested.

See Also

SetPriority


CKGrid::SetGridPriority

Virtual Method Method CKGrid::SetGridPriority

virtual void CKGrid::SetGridPriority(int Priority) CK_PURE

Sets the Priority to the grid

Parameters

Input argument Priority

the priority

Remarks

Priority can be set on grids especially when several grids overlap so the CKgridManager::GetPreferredGrid returns the desired grid when finding on which grid a point should be tested.

See Also

GetPriority


CKGrid::AddClassification

Virtual Method Method CKGrid::AddClassification

virtual CKERROR CKGrid::AddClassification(int classification) CK_PURE
virtual CKERROR CKGrid::AddClassification(CKSTRING ClassificationName) CK_PURE

Adds a classification to the grid

Parameters

Input argument classification | attribute.
Input argument ClassificationName | name of the Classification (eg: “Dwarf Grid”, “Hero Grid”, ...).

Returns

CK_OK if successful, ERROR code otherwise.

Remarks

Classification are attribute types (see CKAttributeManager) used to distinguish special kinds of grids. These attribute must have been create with the CKGridManager::RegisterClassification method which will create the attribute with the attribute manager.

See Also

RemoveClassification,HasCompatibleClass


CKGrid::HasCompatibleClass

Virtual Method Method CKGrid::HasCompatibleClass

virtual CKBOOL CKGrid::HasCompatibleClass(CK3dEntity *ent) CK_PURE

Check if the grid has a shared Classification.

Parameters

Input argument ent

3d Entity to be checked (can be a grid).

Returns

CK_OK if successful, ERROR code otherwise.

Remarks

Checks if the entity and the grid share the same classification (attribute).

See Also

AddClassification,RemoveClassification


CKGrid::RemoveClassification

Virtual Method Method CKGrid::RemoveClassification

virtual CKERROR CKGrid::RemoveClassification(int classification) CK_PURE
virtual CKERROR CKGrid::RemoveClassification(CKSTRING ClassificationName) CK_PURE

Removes a classification from the grid

Parameters

Input argument classification | index in the Attribut Manager of a attribut.
Input argument ClassificationName | Name of the Classification (eg: “Dwarf Grid”, “Hero Grid”, ...).

Returns

CK_OK if successful, ERROR code otherwise.

Remarks

Classification are attribute types (see CKAttributeManager) used to distinguish special kinds of grids. These attribute must have been create with the CKGridManager::RegisterClassification method which will create the attribute with the attribute manager.

See Also

AddClassification,HasCompatibleClass


CKGrid::Cast

Static Object Method CKGrid::Cast

static CKGrid* CKGrid::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKGrid::ConstructMeshTexture

Virtual Method Method CKGrid::ConstructMeshTexture

virtual void CKGrid::ConstructMeshTexture( float opacity=0.5f ) CK_PURE

Construct the mesh materials, and texture associated with the grid

Parameters

Opacity: should be bound to range [0,1]

Remarks

CONSTRUCT MESH & TEXTURE

This function is called during the grid creation by the interface. If you make your own grid using the interface and want it to be visible in the interface you must call this function after the creation. This function is called in IsVisible(TRUE) if the grid was previously not visible. When the grid is not visible [ IsVisible(FALSE) ], then the mesh and texture are destroyed

See Also

DestroyMeshTexture, IsVisible


CKGrid::DestroyMeshTexture

Virtual Method Method CKGrid::DestroyMeshTexture

virtual void CKGrid::DestroyMeshTexture() CK_PURE

Destroy the mesh, materials and texture associated with the grid

Remarks

This function is called in IsVisible(FALSE) if the grid was previously visible. +When the grid is not visible [ IsVisible(FALSE) ], then the mesh and texture are destroyed

See Also

ConstructMeshTexture, IsVisible


CKGridManager

Class CKGridManager

Grids Management

CKBaseManager
Show brief derivation trees

CKGridManager

CKBaseManager
Show full derivation trees

CKGridManager

Remarks

The Grid Manager manages the layer types : they are defined by a name to which is associated an integer (what is called the layer type). The layer type has also a type of parameter that is associated with (SetAssociatedParam) most of the time the layers use integer values (CKPGUID_INT).

For every grid you can then decide to create one of more layer on this grid using the existing layer type.

For Dev Interface purposes a layer type can also be given a color with SetAssociatedColor

The Grid Manager is the entry point to acces a grid given a custom point in Space.

The Grid Manager, manage all grids and is the gateway between a point in 3D Space and the correspondant grid. The Grid Manager, also manages the Layer Types (eg: fire, danger, grass)

Groups

Layer Type
Pure Virtual Method Method GetAssociatedColor | Returns the color associated with a layer type.
Pure Virtual Method Method GetAssociatedParam | Gets the type of data associated with a layer type.
Pure Virtual Method Method GetLayerTypeCount | Returns the number of registered layer types.
Pure Virtual Method Method GetTypeFromName | Returns the layer type given its name.
Pure Virtual Method Method GetTypeName | Returns the name of a layer type.
Pure Virtual Method Method RegisterType | Register a new layer type.
Pure Virtual Method Method SetAssociatedColor | Sets the color associated with a layer type.
Pure Virtual Method Method SetAssociatedParam | Sets the type of data associated with a layer type.
Pure Virtual Method Method SetTypeName | Changes the name of a layer type.
Grid retrieval
Pure Virtual Method Method GetGridArray | Gets the list of CKGrids
Pure Virtual Method Method GetGridObject | Returns the Nth grid in the scene or level.
Pure Virtual Method Method GetGridObjectCount | Returns the number of grids
Pure Virtual Method Method GetNearestGrid | Gets the nearest grid from a 3d position expressed in a referential
Pure Virtual Method Method GetPreferredGrid | Gets the grid containing a point given its priority.
Pure Virtual Method Method IsInGrid | Returns whether a given point is inside a grid range.
utilities
Pure Virtual Method Method FillGridWithObjectShape | Fills grids with an object shape.
Classification
Pure Virtual Method Method GetClassificationFromName | Returns an attribute given a classification name
Pure Virtual Method Method GetClassificationName | Returns the classification name associated with an attribute
Pure Virtual Method Method GetGridClassificationCatego | Gets the attribute category used by the grid manager
Pure Virtual Method Method RegisterClassification | Register a new classification name (new attribute)

See Also

CKGrid


CKGridManager::GetAssociatedColor

Pure Virtual Method Method CKGridManager::GetAssociatedColor

virtual CKERROR CKGridManager::GetAssociatedColor(int type, VxColor *col)

Returns the color associated with a layer type.

Parameters

Input argument type | Layer Type
Output argument col | Color associated with layer type.

Returns

CK_OK if successful or an error code otherwise (invalid layer type).

Remarks

The color association is used in the Dev Interface to draw the layer data.

See Also

GetTypeFromName,GetTypeName,RegisterType,SetAssociatedColor


CKGridManager::GetAssociatedParam

Pure Virtual Method Method CKGridManager::GetAssociatedParam

virtual CKGUID CKGridManager::GetAssociatedParam(int type)

Gets the type of data associated with a layer type.

Parameters

Input argument type

Layer Type

Returns

CKGUID of the parameter type associated with the layer type.

Remarks

Most of the time an integer data (CKPGUID_INT) is associated with layer types. Some exception such as the path finding use a Linker type (CKPGUID_LINKERGRAPH_ENUM) when linking grids together.

See Also

GetTypeFromName,GetTypeName,RegisterType,SetAssociatedParam


CKGridManager::GetLayerTypeCount

Pure Virtual Method Method CKGridManager::GetLayerTypeCount

virtual int CKGridManager::GetLayerTypeCount()

Returns the number of registered layer types.

Returns

Number of existing layer type.

See Also

GetTypeFromName,GetTypeName,RegisterType,UnRegisterType


CKGridManager::GetTypeFromName

Pure Virtual Method Method CKGridManager::GetTypeFromName

virtual int CKGridManager::GetTypeFromName(CKSTRING TypeName)

Returns the layer type given its name.

Parameters

Input argument TypeName

Name of the layer type to return (ex: “collision”, “Walls”, ...)

Returns

Layer type integer value if successful, 0 otherwise.

Remarks

A 0 return value means the TypeName type was not registered yet.

See Also

GetTypeName,SetTypeName,RegisterType


CKGridManager::GetTypeName

Pure Virtual Method Method CKGridManager::GetTypeName

virtual CKSTRING CKGridManager::GetTypeName(int type)

Returns the name of a layer type.

Parameters

Input argument type

Layer Type

Returns

Name of the layer type or NULL if the layer type is invalid.

See Also

GetTypeFromName,SetTypeName,RegisterType


CKGridManager::RegisterType

Pure Virtual Method Method CKGridManager::RegisterType

virtual int CKGridManager::RegisterType(CKSTRING TypeName)

Register a new layer type.

Parameters

Input argument TypeName

name for the layer type.

Returns

Newly created layer type.

See Also

GetTypeFromName,GetTypeName,RegisterType,UnRegisterType,SetAssociatedParam,SetAssociatedColor


CKGridManager::SetAssociatedColor

Pure Virtual Method Method CKGridManager::SetAssociatedColor

virtual CKERROR CKGridManager::SetAssociatedColor(int type, VxColor *col)

Sets the color associated with a layer type.

Parameters

Input argument type | Layer Type
Input argument col | Color to associate to this layer type.

Returns

CK_OK if successful or an error code otherwise (invalid layer type).

Remarks

The color association is used in the Dev Interface to draw the layer data.

See Also

GetTypeFromName,GetTypeName,RegisterType,GetAssociatedColor


CKGridManager::SetAssociatedParam

Pure Virtual Method Method CKGridManager::SetAssociatedParam

virtual CKERROR CKGridManager::SetAssociatedParam(int type, CKGUID param)

Sets the type of data associated with a layer type.

Parameters

Input argument type | Layer Type
Input argument param | CKGUID of the parameter type associated with the layer type.

Returns

CK_OK if successful or an error code otherwise (invalid layer type).

Remarks

Most of the time an integer data (CKPGUID_INT) is associated with layer types. Some exception such as the path finding use a Linker type (CKPGUID_LINKERGRAPH_ENUM) when linking grids together.

See Also

GetTypeFromName,GetTypeName,RegisterType,SetAssociatedColor


CKGridManager::SetTypeName

Pure Virtual Method Method CKGridManager::SetTypeName

virtual CKERROR CKGridManager::SetTypeName(int iType, CKSTRING Name)

Changes the name of a layer type.

Parameters

Input argument iType

Layer Type

Returns

CK_OK if successful or an error code otherwise.

See Also

GetTypeFromName,GetTypeName,RegisterType


CKGridManager::GetGridArray

Pure Virtual Method Method CKGridManager::GetGridArray

virtual const XObjectPointerArray& CKGridManager::GetGridArray( int flag=GRID_FLAG_SCENE )

Gets the list of CKGrids

Parameters

Input argument flag

GRID_FLAG_SCENE to return the list of grids in the current scene or GRID_FLAG_LEVEL to return the global list of grids.

Returns

A XObjectPointerArray reference to the scene or global list of CKGrids.

See Also

GetPreferredGrid,IsIngrid


CKGridManager::GetGridObject

Pure Virtual Method Method CKGridManager::GetGridObject

virtual CKGrid* CKGridManager::GetGridObject(int pos, int flag=GRID_FLAG_SCENE )

Returns the Nth grid in the scene or level.

Parameters

Input argument pos | index of the grid to return.
Input argument flag | GRID_FLAG_SCENE to return the number of grid in the current scene or GRID_FLAG_LEVEL to return the total number of grids.

Returns

A pointer to a CKGrid.

See Also

GetGridObjectCount


CKGridManager::GetGridObjectCount

Pure Virtual Method Method CKGridManager::GetGridObjectCount

virtual int CKGridManager::GetGridObjectCount( int flag=GRID_FLAG_SCENE )

Returns the number of grids

Parameters

Input argument flag

GRID_FLAG_SCENE to return the number of grid in the current scene or GRID_FLAG_LEVEL to return the total number of grids.

Returns

Number of grids

See Also

GetGridObject


CKGridManager::GetNearestGrid

Pure Virtual Method Method CKGridManager::GetNearestGrid

virtual CKGrid *CKGridManager::GetNearestGrid( VxVector *pos, CK3dEntity *ref=NULL )

Gets the nearest grid from a 3d position expressed in a referential

Parameters

Input argument pos | the 3d position expressed in the referential ref
Input argument ref | the referential of the position (NULL by default = World)

Returns

the nearest grid if successful, NULL if no grid was found.

See Also

GetPreferredGrid,IsIngrid


CKGridManager::GetPreferredGrid

Pure Virtual Method Method CKGridManager::GetPreferredGrid

virtual CKGrid *CKGridManager::GetPreferredGrid( VxVector *pos, CK3dEntity *ref=NULL )

Gets the grid containing a point given its priority.

Parameters

Input argument pos | position to consider, expressed in the referential ref
Input argument ref | the referential in which the pos are expressed (NULL by default = World)

Returns

The grid with the highest priority that contains the point pos.

See Also

GetNearestGrid,IsIngrid


CKGridManager::IsInGrid

Pure Virtual Method Method CKGridManager::IsInGrid

virtual CKBOOL CKGridManager::IsInGrid( CKGrid *grid, VxVector *pos, CK3dEntity *ref=NULL )

Returns whether a given point is inside a grid range.

Parameters

Input argument grid | Grid in which the point should be tested.
Input argument pos | position to consider, expressed in the referential ref
Input argument ref | the referential in which the pos are expressed (NULL by default = World)

Returns

TRUE is pos is inside the grid range.

See Also

GetNearestGrid,GetPreferredGrid


CKGridManager::FillGridWithObjectShape

Pure Virtual Method Method CKGridManager::FillGridWithObjectShape

virtual void CKGridManager::FillGridWithObjectShape (CK3dEntity *ent, int layerType, void *fillVal)
virtual void CKGridManager::FillGridWithObjectShape (CK3dEntity *ent, int solidLayerType, int shapeLayerType, void *fillVal)

Fills grids with an object shape.

Parameters

Input argument layerType | Layer type on which values should be written.
ent | Entity to use to fill grids.
fillVal | A pointer to the value to set in the layerType layer.

See Also

CKLayer::SetValue


CKGridManager::GetClassificationFromName

Pure Virtual Method Method CKGridManager::GetClassificationFromName

virtual int CKGridManager::GetClassificationFromName(CKSTRING ClassificationName)

Returns an attribute given a classification name

See Also

GetClassificationName,RegisterClassification,GetGridClassificationCatego,CKAttributeManager


CKGridManager::GetClassificationName

Pure Virtual Method Method CKGridManager::GetClassificationName

virtual CKSTRING CKGridManager::GetClassificationName(int Classification)

Returns the classification name associated with an attribute

See Also

GetClassificationFromName,RegisterClassification,GetGridClassificationCatego,CKAttributeManager


CKGridManager::GetGridClassificationCatego

Pure Virtual Method Method CKGridManager::GetGridClassificationCatego

virtual int CKGridManager::GetGridClassificationCatego()

Gets the attribute category used by the grid manager

See Also

GetClassificationFromName,GetClassificationName,RegisterClassification,CKAttributeManager


CKGridManager::RegisterClassification

Pure Virtual Method Method CKGridManager::RegisterClassification

virtual int CKGridManager::RegisterClassification(CKSTRING ClassificationName)

Register a new classification name (new attribute)

See Also

GetClassificationFromName,GetClassificationName,GetGridClassificationCatego,CKAttributeManager


CKLayer

CKObject
Show full derivation trees

CKLayer

Remarks

A CKlayer is only used to store an array of value for a given layer type in a grid.

Instances of CKLayer are created with the function CKGrid::AddLayer and remove the with CKGrid::RemoveLayer method

Layer type is identified by an integer returned by GetType which can be converted in a string by using CKGridManager::GetTypeName

Layer data is stored in an array[length][width] of CKSquare where CKSquare is defined as

class CKSquare {
      union{
        int     ival;
        float   fval;
        CKDWORD dval;
        void    *ptr;
      };
};

The Class Identifier of a Layer is CKCID_LAYER

Groups

LayerType | State | Owner | Cast operator | Data access

LayerType
Pure Virtual Method Method GetType | Returns the layer type
State
Pure Virtual Method Method IsVisible | Test if the layer is visible or not
Pure Virtual Method Method SetVisible | Shows or hides a layer
Owner
Pure Virtual Method Method GetOwner | Returns the CKGrid using this layer.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Data access
Pure Virtual Method Method GetSquareArray | Direct Access to the layer squares Array
Pure Virtual Method Method GetValue | Gets the value of a specific square. (No validity check)
Pure Virtual Method Method SetValue | Sets the value of a specific square. (No validity check)

See Also

CKGrid,CKGridManager


CKLayer::GetType

Pure Virtual Method Method CKLayer::GetType

virtual int CKLayer::GetType()

Returns the layer type

Returns

layer type

Remarks

CKGridManager::GetTypeName

See Also

CKGridManager::GetTypeName


CKLayer::IsVisible

Pure Virtual Method Method CKLayer::IsVisible

virtual CKBOOL CKLayer::IsVisible()

Test if the layer is visible or not

Returns

TRUE if visible, FALSE otherwise

Remarks

+Only CKRenderObject and derived classes(CK2dEntity,CK3dEntity),CKMesh and CKGroup return relevant information about their visibility state. Other classes may return any values. +An object can return CKSHOW and still be hidden if its parent (see CK3dEntity::GetParent and CK2dEntity::GetParent) is hierarchically hidden (see CKObject::Show)

Implementation Notes

The visibility flag is only used in the Dev Interface and has no impact on the processing.

See Also

SetVisible


CKLayer::SetVisible

Pure Virtual Method Method CKLayer::SetVisible

virtual void CKLayer::SetVisible( CKBOOL vis=TRUE )

Shows or hides a layer

Parameters

Input argument vis

default is TRUE (visible), else FALSE (hidden)

Remarks

STATE

The visibility flag is only used in the Dev Interface and has no impact on the processing.

See Also

IsVisible


CKLayer::GetOwner

Pure Virtual Method Method CKLayer::GetOwner

virtual CK_ID CKLayer::GetOwner()

Returns the CKGrid using this layer.

Returns

owner CK_ID

See Also

CKContext::GetObject


CKLayer::Cast

Static Object Method CKLayer::Cast

static CKLayer* CKLayer::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKLayer::GetSquareArray

Pure Virtual Method Method CKLayer::GetSquareArray

virtual CKSquare *CKLayer::GetSquareArray()

Direct Access to the layer squares Array

Returns

The adress of the CKSquare array.

Remarks

Layer data is stored in an array[length][width] of CKSquare where CKSquare is defined as

class CKSquare {
      union{
        int     ival;
        float   fval;
        CKDWORD dval;
        void    *ptr;
      };
};

The example shown in SetValue method can be coded more efficiently using this method.

for (int x = 0; x < Width; x++) {
    for (int y = 0; y < Height; y++) {
        int valueToSet = rand() & 255;

        layer->SetValue(x,y,&valueToSet);
    }
}

becomes

CKSquare* array = layer->GetSquareArray();

for (int x = 0; x < Width; ++x) {
    for (int y = 0; y < Height; ++y , ++array) {
        int valueToSet = rand() & 255;

        array->ival = valueToSet;
    }
}

See Also

SetSquareArray, GetValue, GetValue2, SetValue, SetValue2


CKLayer::GetValue

Pure Virtual Method Method CKLayer::GetValue

virtual void CKLayer::GetValue( int x, int y, void *val )
virtual CKBOOL CKLayer::GetValue2( int x, int y, void *val )

Gets the value of a specific square. (No validity check)

Parameters

Input argument x | the x coordinate in the grid coordinate system
Input argument y | the y coordinate in the grid coordinate system
Input argument val | a pointer to the variable that will get the value

Remarks

The GetValue function does not perform any check about the coordinates validity so it is the application responsabilty to ensure x and y are valid coordinates or use GetValue2 which will be slower. val is supposed to be a pointer to a CKSquare, int, float or any 4 byte data...

int valueToGet;
layer->GetValue(x,y,&valueToGet);

See Also

SetValue, GetValue2, SetValue2, SetSquareArray, GetSquareArray


CKLayer::SetValue

Pure Virtual Method Method CKLayer::SetValue

virtual void CKLayer::SetValue( int x, int y, void *val )
virtual CKBOOL CKLayer::SetValue2( int x, int y, void *val )

Sets the value of a specific square. (No validity check)

Parameters

Input argument x | the x coordinate in the layer coordinate system
Input argument y | the y coordinate in the layer coordinate system
Input argument val | A pointer to the value to set.

Remarks

The SetValue function does not perform any check about the coordinates validity so it is the application responsabilty to ensure x and y are valid coordinates or use SetValue2 which will be slower. val is supposed to be a pointer to a CKSquare, int, float or any 4 byte data... The usual usage is to store integer value. The content of iVal is used immediatly and is not needed anymore afterwards.

for (int y = 0; y < Height; y++) {
    for (int x = 0; x < Width; x++) {
        int valueToSet = rand() & 255;

        layer->SetValue(x,y,&valueToSet);
    }
}

See Also

GetValue, SetValue2, GetValue2, SetSquareArray, GetSquareArray


CKLight

Class CKLight

Class for lights

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CKLight

CKTargetLight

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CKLight

Subclasses

CKTargetLight

Remarks

The CKLight class is derived from CK3dEntity.

A CKLight can be a spot, directional light or point of light.

A range can be given outside which objects won't receive any contribution from this light.

Spot lights are controlled by three additionnal parameters which are the angle of the inner cone (SetHotSpot), outer cone (SetFallOff) and a factor that controls the decrease of intensity between the inner and outer cone limits.

The Class Identifier of a light is CKCID_LIGHT

Groups

Operations | Activity Options | Attenuation | Color | Range | Spotlight Options | Target Access | Type

Operations
Static Object Method Cast | Dynamic Cast method (returns NULL if the object can't be casted)
Static Object Method Cast | Dynamic Cast method (returns NULL if the object can't be casted)
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Virtual Method Method GetOrientation | Returns the entity orientation axes.
Virtual Method Method GetPosition | Returns the entity position in a given referential.
Pure Virtual Method Method IsInRenderContext | Checks if this render object is referenced in a CKRenderContext.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method SetZOrder | Sets the Z order (priority) for this object.
Activity Options
Virtual Method Method Active | Activates the light
Virtual Method Method GetActivity | Gets the light activity status.
Virtual Method Method GetSpecularFlag | Returns if specular highlights are enabled.
Virtual Method Method SetSpecularFlag | Enables or diables specular highlights.
Attenuation
Virtual Method Method GetConstantAttenuation | Gets the light constant attenuation factor.
Virtual Method Method GetLinearAttenuation | Gets the light linear attenuation factor.
Virtual Method Method GetQuadraticAttenuation | Gets the light Quadratic attenuation factor.
Virtual Method Method SetConstantAttenuation | Sets the light constant attenuation.
Virtual Method Method SetLinearAttenuation | Sets the light linear attenuation.
Virtual Method Method SetQuadraticAttenuation | Sets the light quadratic attenuation.
Color
Virtual Method Method GetColor | Returns the light color.
Virtual Method Method SetColor | Sets the light color.
Range
Virtual Method Method GetRange | Gets the light range.
Virtual Method Method SetRange | Sets the light range.
Spotlight Options
Virtual Method Method GetFallOff | Gets the angle of the outer cone for a spot.
Virtual Method Method GetFallOffShape | Gets the shape between inner and outer cone.
Virtual Method Method GetHotSpot | Gets the angle of the inner cone for a spot.
Virtual Method Method SetFallOff | Sets the angle of the outer cone for a spot.
Virtual Method Method SetFallOffShape | Sets the FallOff Shape of the light.
Virtual Method Method SetHotSpot | Sets the angle of the inner cone for a spot.
Target Access
Virtual Method Method GetLightPower | Gets the multiplication power of the light
Virtual Method Method GetTarget | Gets the target of the light
Virtual Method Method SetLightPower | Sets the multiplication power of the light
Virtual Method Method SetTarget | Sets the target of the light
Type
Virtual Method Method GetType | Gets the type of a light (point,spot,directionnal).
Virtual Method Method SetType | Sets the type of a light (point,spot,directionnal)

See Also

CKTargetLight,Using Materials,Using Lights


CKLight::Cast

Static Object Method CKLight::Cast

static CKLight* CKLight::Cast(CKObject* iO)

Remarks

Dynamic Cast method (returns NULL if the object can't be casted)


CKLight::Active

Virtual Method Method CKLight::Active

virtual void CKLight::Active(CKBOOL Active) CK_PURE

Activates the light

Parameters

Input argument Active

TRUE enables the light, FALSE disables it.

Remarks

Hidding a light (CKObject::Show) also disables it.

See Also

GetActivity,SetSpecularFlag


CKLight::GetActivity

Virtual Method Method CKLight::GetActivity

virtual CKBOOL CKLight::GetActivity() CK_PURE

Gets the light activity status.

Returns

TRUE if light is active, FALSE otherwise.

See Also

Active


CKLight::GetSpecularFlag

Virtual Method Method CKLight::GetSpecularFlag

virtual CKBOOL CKLight::GetSpecularFlag() CK_PURE

Returns if specular highlights are enabled.

Returns

TRUE if the light produces specular highlights, FALSE otherwise.

Remarks

Specular highlights require more time to be computed so you should avoid them whenever possible if you are looking for maximum perfomances.

See Also

SetSpecularFlag


CKLight::SetSpecularFlag

Virtual Method Method CKLight::SetSpecularFlag

virtual void CKLight::SetSpecularFlag(CKBOOL Specular) CK_PURE

Enables or diables specular highlights.

Parameters

Input argument Specular

TRUE to activate specular highlights.

Remarks

Specular highlights require more time to be computed so you should avoid them whenever possible if you are looking for maximum perfomances.

See Also

GetSpecularFlag


CKLight::GetConstantAttenuation

Virtual Method Method CKLight::GetConstantAttenuation

virtual float CKLight::GetConstantAttenuation() CK_PURE

Gets the light constant attenuation factor.

Returns

Constant attenuation factor.

See Also

SetConstantAttenuation,GetLinearAttenuation,GetQuadraticAttenuation


CKLight::GetLinearAttenuation

Virtual Method Method CKLight::GetLinearAttenuation

virtual float CKLight::GetLinearAttenuation() CK_PURE

Gets the light linear attenuation factor.

Returns

Linear attenuation factor.

See Also

SetLinearAttenuation,GetQuadraticAttenuation


CKLight::GetQuadraticAttenuation

Virtual Method Method CKLight::GetQuadraticAttenuation

virtual float CKLight::GetQuadraticAttenuation() CK_PURE

Gets the light Quadratic attenuation factor.

Returns

Quadratic attenuation factor.

See Also

GetLinearAttenuation,SetQuadraticAttenuation


CKLight::SetConstantAttenuation

Virtual Method Method CKLight::SetConstantAttenuation

virtual void CKLight::SetConstantAttenuation (float Value) CK_PURE

Sets the light constant attenuation.

Parameters

Input argument Value

Constant attenuation.

See Also

SetLinearAttenuation,SetQuadraticAttenuation


CKLight::SetLinearAttenuation

Virtual Method Method CKLight::SetLinearAttenuation

virtual void CKLight::SetLinearAttenuation (float Value) CK_PURE

Sets the light linear attenuation.

Parameters

Input argument Value

Constant attenuation.

See Also

SetLinearAttenuation,SetQuadraticAttenuation


CKLight::SetQuadraticAttenuation

Virtual Method Method CKLight::SetQuadraticAttenuation

virtual void CKLight::SetQuadraticAttenuation(float Value) CK_PURE

Sets the light quadratic attenuation.

Parameters

Input argument Value

Quadratic attenuation.

See Also

SetConstantAttenuation,SetLinearAttenuation


CKLight::GetColor

Virtual Method Method CKLight::GetColor

virtual const VxColor& CKLight::GetColor() CK_PURE

Returns the light color.

Returns

A VxColor reference to the color of the light

See Also

SetColor


CKLight::SetColor

Virtual Method Method CKLight::SetColor

virtual void CKLight::SetColor(const VxColor& c) CK_PURE

Sets the light color.

Parameters

Input argument c

A reference to a VxColor that contains the new light color.

See Also

GetColor


CKLight::GetRange

Virtual Method Method CKLight::GetRange

virtual float CKLight::GetRange() CK_PURE

Gets the light range.

Returns

Range of the light.

Remarks

The range is the distance beyond which the light has no effect and is only valid for spot and point lights.

See Also

SetRange


CKLight::SetRange

Virtual Method Method CKLight::SetRange

virtual void CKLight::SetRange(float Value) CK_PURE

Sets the light range.

Parameters

Input argument Value

New range of the light.

Remarks

The range is the distance beyond which the light has no effect and is only valid for spot and point lights.

See Also

GetRange


CKLight::GetFallOff

Virtual Method Method CKLight::GetFallOff

virtual float CKLight::GetFallOff() CK_PURE

Gets the angle of the outer cone for a spot.

Returns

Outer cone angle.

See Also

SetFallOff, GetHotSpot,GetFallOffShape


CKLight::GetFallOffShape

Virtual Method Method CKLight::GetFallOffShape

virtual float CKLight::GetFallOffShape() CK_PURE

Gets the shape between inner and outer cone.

Returns

A float value giving the interpolation factor between inner and outer cone.

See Also

SetFallOffShape,GetFallOff,GetHotSpot


CKLight::GetHotSpot

Virtual Method Method CKLight::GetHotSpot

virtual float CKLight::GetHotSpot() CK_PURE

Gets the angle of the inner cone for a spot.

Returns

Inner cone angle.

See Also

SetHotSpot, GetFallOff,GetFallOffShape


CKLight::SetFallOff

Virtual Method Method CKLight::SetFallOff

virtual void CKLight::SetFallOff(float Value) CK_PURE

Sets the angle of the outer cone for a spot.

Parameters

value: Outer cone angle in radian.

See Also

GetFallOff,SetFallOffShape,SetHotSpot


CKLight::SetFallOffShape

Virtual Method Method CKLight::SetFallOffShape

virtual void CKLight::SetFallOffShape(float Value) CK_PURE

Sets the FallOff Shape of the light.

Parameters

Input argument Value

FallOff Shape of the light.

See Also

GetFallOffShape,SetFallOff,SetHotSpot


CKLight::SetHotSpot

Virtual Method Method CKLight::SetHotSpot

virtual void CKLight::SetHotSpot(float Value) CK_PURE

Sets the angle of the inner cone for a spot.

Parameters

value: Inner cone angle in radian.

See Also

GetHotSpot, SetFallOffShape,SetFallOff


CKLight::GetLightPower

Virtual Method Method CKLight::GetLightPower

virtual float CKLight::GetLightPower() CK_PURE

Gets the multiplication power of the light

Returns

A pointer to the target CK3dEntity.

Remarks

o This method was introduced in version 2.1 o The Light color is mutltiplied by this float when used during rendering. o The light power is a float which can take any value including negative ones. Its default value is to be 1.0f which sets the light original color but it can be use to attenuate or extrapolate the global influence of the light without changing its diffuse color.

See Also

SetLightPower


CKLight::GetTarget

Virtual Method Method CKLight::GetTarget

virtual CK3dEntity *CKLight::GetTarget() CK_PURE

Gets the target of the light

Returns

A pointer to the target CK3dEntity.

Remarks

This method always returns NULL for CKLights, but is available on CKTargetLight.

See Also

SetTarget


CKLight::SetLightPower

Virtual Method Method CKLight::SetLightPower

virtual void CKLight::SetLightPower(float power = 1.0f) CK_PURE

Sets the multiplication power of the light

Parameters

target: A pointer to CK3DEntity to be set as target.

Remarks

o This method was introduced in version 2.1 o The Light color is mutltiplied by this float when used during rendering. o The light power is a float which can take any value including negative ones. Its default value is to be 1.0f which sets the light original color but it can be use to attenuate or extrapolate the global influence of the light without changing its diffuse color.

See Also

GetLightPower


CKLight::SetTarget

Virtual Method Method CKLight::SetTarget

virtual void CKLight::SetTarget(CK3dEntity *target) CK_PURE

Sets the target of the light

Parameters

Input argument target

A pointer to CK3DEntity to be set as target.

Remarks

This method does nothing for CKLights as they not have targets but is available on CKTargetLight.

See Also

GetTarget


CKLight::GetType

Virtual Method Method CKLight::GetType

virtual VXLIGHT_TYPE CKLight::GetType() CK_PURE

Gets the type of a light (point,spot,directionnal).

Returns

A VXLIGHT_TYPE type.

See Also

SetType, RCKLight


CKLight::SetType

Virtual Method Method CKLight::SetType

virtual void CKLight::SetType(VXLIGHT_TYPE Type) CK_PURE

Sets the type of a light (point,spot,directionnal)

Parameters

Input argument Type

A VXLIGHT_TYPE type.

See Also

GetType


CKMaterial

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKMaterial

Remarks

+The CKMaterial class provides functions to set color settings for faces of an object, a sprite3D or a 2DEntity. +It specified the way faces will be rendered (eg. Transparency, Texture to use, Blend modes, Texture filter modes, Fill and shade modes, etc..)

+The default diffuse color is (0.7,0.7,0.7) +The default ambient color is (0.3,0.3,0.3,1.0) +The default specular color is (0.5,0.5,0.5) but specular power is 0 (specular is disabled) +The default emissive color is (0,0,0) +The material is single sided. +There is no texture . +Default filter is set to VXTEXTUREFILTER_LINEAR. (Bilinear filtering) +Default blend factors are (VXBLEND_ONE,VXBLEND_ZERO) and blending is disabled. +Default shade mode is VXSHADE_GOURAUD. +Default fill mode is VXFILL_SOLID. +Alpha Testing is Off. +ZBuffer writing is enabled. +Its class id is CKCID_MATERIAL

Groups

Color settings | Texture settings | Rendering | Blending Modes | Misc Settings | Alpha Testing | Cast operator | Effects | Operations

Color settings
Pure Virtual Method Method GetAmbient | Gets the ambient color of the material.
Pure Virtual Method Method GetDiffuse | Gets the diffuse color of the material
Pure Virtual Method Method GetEmissive | Sets the emissive color of the material
Pure Virtual Method Method GetPower | Gets the specular highlight power.
Pure Virtual Method Method GetSpecular | Sets the specular color of the material.
Pure Virtual Method Method SetAmbient | Sets the ambient color of the material
Pure Virtual Method Method SetDiffuse | Sets the diffuse color of the material
Pure Virtual Method Method SetEmissive | Sets the emissive color of the material
Pure Virtual Method Method SetPower | Sets the specular highlight power.
Pure Virtual Method Method SetSpecular | Sets the specular color of the material
Texture settings
Pure Virtual Method Method EnablePerpectiveCorrection | Enables texture perspective correction.
Pure Virtual Method Method GetEffectParameter | Gets the effect parameter
Pure Virtual Method Method GetTexture | Gets the texture of the material
Pure Virtual Method Method GetTextureAddressMode | Gets the texture Address mode.
Pure Virtual Method Method GetTextureBlendMode | Gets texture blend mode of the material.
Pure Virtual Method Method GetTextureBorderColor | Gets texture color to the material border.
Pure Virtual Method Method GetTextureMagMode | Sets the texture filter mode when the texture is magnified.
Pure Virtual Method Method GetTextureMinMode | Gets the texture filter mode when the texture is minified.
Pure Virtual Method Method PerspectiveCorrectionEnabled | Checks whether texture perspective correction is enabled.
Pure Virtual Method Method SetTexture | Sets the texture to the material
Pure Virtual Method Method SetTextureAddressMode | Sets the texture Address mode
Pure Virtual Method Method SetTextureBlendMode | Sets texture blend mode to the material
Pure Virtual Method Method SetTextureBorderColor | Sets texture border color.
Pure Virtual Method Method SetTextureMagMode | Sets the texture filter mode when the texture is magnified.
Pure Virtual Method Method SetTextureMinMode | Sets the texture filter mode when the texture is minified.
Rendering
Pure Virtual Method Method SetAsCurrent | Sets the current material to use for lighting when drawing primitives.
Blending Modes
Pure Virtual Method Method AlphaBlendEnabled | Checks whether alpha blending is enabled or not.
Pure Virtual Method Method EnableAlphaBlend | Enables or disables blending.
Pure Virtual Method Method GetDestBlend | Gets destination blend factor.
Pure Virtual Method Method GetSourceBlend | Gets source blend factor.
Pure Virtual Method Method IsAlphaTransparent | Checks whether this material has transparency.
Pure Virtual Method Method SetDestBlend | Sets destination blend factor.
Pure Virtual Method Method SetSourceBlend | Sets source blend factor.
Misc Settings
Pure Virtual Method Method EnableZWrite | Enables writing in Zbuffer
Pure Virtual Method Method GetFillMode | Gets the fill mode.
Pure Virtual Method Method GetShadeMode | Gets the shade mode.
Pure Virtual Method Method GetZFunc | Gets the Z comparison function.
Pure Virtual Method Method IsLightingTwoSided | Checks whether this material should use 2 sided lighting. This feature will have effect with an OpenGL rasterizer only.
Pure Virtual Method Method IsTwoSided | Checks whether the material is both sided or not
Pure Virtual Method Method SetFillMode | Sets the fill mode.
Pure Virtual Method Method SetShadeMode | Sets the shade mode.
Pure Virtual Method Method SetTwoSided | Sets the material in both sided mode.
Pure Virtual Method Method SetTwoSidedLighting | Sets the material in both sided lighting mode. This feature will have effect with an OpenGL rasterizer only.
Pure Virtual Method Method SetZFunc | Sets the Z comparison function.
Pure Virtual Method Method ZWriteEnabled | Checks whether writing in ZBuffer is enabled.
Alpha Testing
Pure Virtual Method Method AlphaTestEnabled | Checks whether the alpha test is enabled
Pure Virtual Method Method EnableAlphaTest | Enables or disables alpha testing.
Pure Virtual Method Method GetAlphaFunc | Gets alpha comparision function.
Pure Virtual Method Method GetAlphaRef | Gets alpha referential value.
Pure Virtual Method Method SetAlphaFunc | Sets alpha comparison function.
Pure Virtual Method Method SetAlphaRef | Sets alpha referential value for alpha testing.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Effects
Pure Virtual Method Method SetEffect | Sets a special effect on a material.
Operations
Pure Virtual Method Method DestroyCKMaterialShader | Destroy a CKMaterialShader, and set the input pointer (mfx) to NULL
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Pure Virtual Method Method GetMaterialShader | Gets the material shader (DirectX 9 Effect Extension)
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Pure Virtual Method Method GetShaderParamObject |
Pure Virtual Method Method GetShaderParamValue |
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method SetMaterialShader | Sets the material shader (DirectX 9 Effect Extension)
Pure Virtual Method Method SetShader | Applies a shader to the material (DirectX 9 Effect Extension)
Pure Virtual Method Method SetShaderByName |
Pure Virtual Method Method SetShaderParamObject |
Pure Virtual Method Method SetShaderParamValue |

See Also

Using Materials,CKTexture,CKMesh,CKSprite3D,CK2dEntity


CKMaterial::GetAmbient

Pure Virtual Method Method CKMaterial::GetAmbient

virtual const VxColor& CKMaterial::GetAmbient()

Gets the ambient color of the material.

Returns

A reference to the VxColor that contains the material ambient color

See Also

SetAmbient,SetDiffuse, SetSpecular, SetEmissive


CKMaterial::GetDiffuse

Pure Virtual Method Method CKMaterial::GetDiffuse

virtual const VxColor& CKMaterial::GetDiffuse()

Gets the diffuse color of the material

Returns

A reference to a VxColor that contains the material diffuse color

See Also

SetAmbient,SetDiffuse, SetSpecular, SetEmissive


CKMaterial::GetEmissive

Pure Virtual Method Method CKMaterial::GetEmissive

virtual const VxColor& CKMaterial::GetEmissive()

Sets the emissive color of the material

Returns

A reference to a VxColor that contains the material emissive color

See Also

SetAmbient,SetDiffuse, GetSpecular, GetEmissive


CKMaterial::GetPower

Pure Virtual Method Method CKMaterial::GetPower

virtual float CKMaterial::GetPower()

Gets the specular highlight power.

Returns

Specular power.

Remarks

A specular power of 0 disables specular highlights calculation.

See Also

SetPower,GetSpecular


CKMaterial::GetSpecular

Pure Virtual Method Method CKMaterial::GetSpecular

virtual const VxColor& CKMaterial::GetSpecular()

Sets the specular color of the material.

Returns

A reference to a VxColor that contains the material specular color

See Also

SetAmbient,SetDiffuse, SetSpecular, SetEmissive,SetPower


CKMaterial::SetAmbient

Pure Virtual Method Method CKMaterial::SetAmbient

virtual void CKMaterial::SetAmbient(const VxColor& Color)

Sets the ambient color of the material

Parameters

Input argument Color

A reference a VxColor that contains the material ambient color

See Also

SetDiffuse, SetSpecular, SetEmissive


CKMaterial::SetDiffuse

Pure Virtual Method Method CKMaterial::SetDiffuse

virtual void CKMaterial::SetDiffuse(const VxColor& Color)

Sets the diffuse color of the material

Parameters

Input argument Color

A reference to a VxColor that contains the material diffuse color

See Also

SetAmbient,GetDiffuse, SetSpecular, SetEmissive


CKMaterial::SetEmissive

Pure Virtual Method Method CKMaterial::SetEmissive

virtual void CKMaterial::SetEmissive(const VxColor& Color)

Sets the emissive color of the material

Parameters

Input argument Color

A reference to a VxColor that contains the material emissive color

See Also

SetAmbient, SetDiffuse, SetSpecular


CKMaterial::SetPower

Pure Virtual Method Method CKMaterial::SetPower

virtual void CKMaterial::SetPower(float Value)

Sets the specular highlight power.

Parameters

Input argument Value

Specular power.

Remarks

+Specular power controls the size and appearance of specular highlights on the material. +Larger values will create sharper highlights. +A specular power of 0 disables specular highlights calculation.

See Also

GetPower,GetSpeculat


CKMaterial::SetSpecular

Pure Virtual Method Method CKMaterial::SetSpecular

virtual void CKMaterial::SetSpecular(const VxColor& Color)

Sets the specular color of the material

Parameters

Input argument Color

A reference to a VxColor that contains the material specular color

See Also

SetAmbient,SetDiffuse, GetSpecular, SetEmissive


CKMaterial::EnablePerpectiveCorrection

Pure Virtual Method Method CKMaterial::EnablePerpectiveCorrection

virtual void CKMaterial::EnablePerpectiveCorrection(CKBOOL Perspective=TRUE)

Enables texture perspective correction.

Parameters

Input argument Perspective

TRUE to enable Texture perspective correction.

See Also

EnablePerpectiveCorrection


CKMaterial::GetEffectParameter

Pure Virtual Method Method CKMaterial::GetEffectParameter

virtual CKParameter* CKMaterial::GetEffectParameter()

Gets the effect parameter

Returns

A CKParameter that is used to setup the effect.

Remarks

When an effect is set on a material it can create a parameter that will be used as a settings for this effect. For example the Bump Map effect expose a “Bump power” parameter that store a float that

See Also

GetEffect,VxEffectDescription,CKRenderManager::GetEffectDescription


CKMaterial::GetTexture

Pure Virtual Method Method CKMaterial::GetTexture

virtual CKTexture* CKMaterial::GetTexture(int TexIndex = 0)

Gets the texture of the material

Returns

Pointer to CKTexture

See Also

SetTexture,SetTextureBlendMode


CKMaterial::GetTextureAddressMode

Pure Virtual Method Method CKMaterial::GetTextureAddressMode

virtual VXTEXTURE_ADDRESSMODE CKMaterial::GetTextureAddressMode()

Gets the texture Address mode.

Returns

Texture Address mode

See Also

SetTextureAddressMode,VXTEXTURE_ADDRESSMODE


CKMaterial::GetTextureBlendMode

Pure Virtual Method Method CKMaterial::GetTextureBlendMode

virtual VXTEXTURE_BLENDMODE CKMaterial::GetTextureBlendMode()

Gets texture blend mode of the material.

Returns

Texture blend mode

See Also

SetTextureBlendMode,GetTexture


CKMaterial::GetTextureBorderColor

Pure Virtual Method Method CKMaterial::GetTextureBorderColor

virtual CKDWORD CKMaterial::GetTextureBorderColor()

Gets texture color to the material border.

Returns

Texture Border color

Remarks

The border color is used when the texture address mode is VXTEXTURE_ADDRESSBORDER. The border color features is rarely supported by current video cards.

See Also

SetTextureBorderColor,SetTextureAddressMode


CKMaterial::GetTextureMagMode

Pure Virtual Method Method CKMaterial::GetTextureMagMode

virtual VXTEXTURE_FILTERMODE CKMaterial::GetTextureMagMode()

Sets the texture filter mode when the texture is magnified.

Returns

Texture filter mode.

See Also

SetTextureMinMode,SetTextureMagMode,GetTexture


CKMaterial::GetTextureMinMode

Pure Virtual Method Method CKMaterial::GetTextureMinMode

virtual VXTEXTURE_FILTERMODE CKMaterial::GetTextureMinMode()

Gets the texture filter mode when the texture is minified.

Returns

Texture filter mode.

See Also

SetTextureMinMode,GetTextureMagMode


CKMaterial::PerspectiveCorrectionEnabled

Pure Virtual Method Method CKMaterial::PerspectiveCorrectionEnabled

virtual CKBOOL CKMaterial::PerspectiveCorrectionEnabled()

Checks whether texture perspective correction is enabled.

Returns

TRUE, if it is enabled, FALSE otherwise.

See Also

EnablePerpectiveCorrection


CKMaterial::SetTexture

Pure Virtual Method Method CKMaterial::SetTexture

virtual void CKMaterial::SetTexture(CKTexture * Tex)
virtual void CKMaterial::SetTexture(int TexIndex,CKTexture * Tex)

Sets the texture to the material

Parameters

Input argument TexIndex | Index of the texture to set (0..3)
Input argument Tex | A Pointer to the texture to use.

Remarks

For devices that support

See Also

GetTexture,SetTextureBlendMode


CKMaterial::SetTextureAddressMode

Pure Virtual Method Method CKMaterial::SetTextureAddressMode

virtual void CKMaterial::SetTextureAddressMode(VXTEXTURE_ADDRESSMODE Mode)

Sets the texture Address mode

Parameters

Input argument Mode

Texture address mode.

Remarks

The address mode controls how the texture coordinates outside the range 0..1 will be interpreted.

See Also

GetTextureAddressMode,VXTEXTURE_ADDRESSMODE,GetTexture


CKMaterial::SetTextureBlendMode

Pure Virtual Method Method CKMaterial::SetTextureBlendMode

virtual void CKMaterial::SetTextureBlendMode(VXTEXTURE_BLENDMODE BlendMode)

Sets texture blend mode to the material

Parameters

Input argument BlendMode

Texture blend mode

Remarks

The texture blend mode specifies the way the texture and face color are mixed.

See Also

GetTextureBlendMode,GetTexture


CKMaterial::SetTextureBorderColor

Pure Virtual Method Method CKMaterial::SetTextureBorderColor

virtual void CKMaterial::SetTextureBorderColor(CKDWORD Color)

Sets texture border color.

Parameters

color: Border color

Remarks

The border color is used when the texture address mode is VXTEXTURE_ADDRESSBORDER. The border color features is rarely supported by current video cards.

See Also

GetTextureBorderColor,SetTextureAddressMode


CKMaterial::SetTextureMagMode

Pure Virtual Method Method CKMaterial::SetTextureMagMode

virtual void CKMaterial::SetTextureMagMode(VXTEXTURE_FILTERMODE FilterMode)

Sets the texture filter mode when the texture is magnified.

Parameters

Input argument FilterMode

Texture filter mode.

See Also

GetTextureMinMode,GetTextureMagMode,GetTexture


CKMaterial::SetTextureMinMode

Pure Virtual Method Method CKMaterial::SetTextureMinMode

virtual void CKMaterial::SetTextureMinMode(VXTEXTURE_FILTERMODE FilterMode)

Sets the texture filter mode when the texture is minified.

Parameters

Input argument FilterMode

Texture filter mode.

See Also

GetTextureMinMode,GetTextureMagMode,GetTexture


CKMaterial::SetAsCurrent

Pure Virtual Method Method CKMaterial::SetAsCurrent

virtual CKBOOL CKMaterial::SetAsCurrent(CKRenderContext*,BOOL Lit=TRUE,int TextureStage = 0)

Sets the current material to use for lighting when drawing primitives.

Parameters

Input argument Lit | TRUE to set the color settings of the material or FALSE if they will not be used (when rendering prelitted primitives for example)
Input argument TextureStage | For multi-texture monopass rendering index of the texture stage on which this material should be set. Most of the time this value does not need to be set.

Returns

TRUE if successful.

Remarks

When setting a material as current the lighting engine will use its parameters (Diffuse Color ,etc.) for lighting calculation. But this function also sets the render state according to the material properties:

+If the material has a texture it is set as current texture. +If material is two-sided the culling is disabled : SetState(VXRENDERSTATE_CULLMODE,VXCULL_NONE) otherwise it is set to counter-clockwise SetState(VXRENDERSTATE_CULLMODE, VXCULL_CCW). +The Texture Blend Mode is set : SetState(VXRENDERSTATE_TEXTUREMAPBLEND,TextureBlendMode); +The Shade Mode is set : SetState(VXRENDERSTATE_SHADEMODE,ShadeMode) unless the render context has a global shade mode in which case this is the one used. +The Filtering Mode is set :SetState(VXRENDERSTATE_TEXTUREMAG,TextureMagMode) and SetState(VXRENDERSTATE_TEXTUREMIN,TextureMinMode) +Texture Border Color and Address Mode (Wrap,Clamp,etc.) are set : Dev->SetState(VXRENDERSTATE_BORDERCOLOR,BorderColor ) and Dev->SetState(VXRENDERSTATE_TEXTUREADDRESS,TextureAddressMode ) +If Blending is enabled the blending is enabled through SetState(VXRENDERSTATE_BLENDENABLE, ...) Z buffer writing is disabled according to hte current flag SetState(VXRENDERSTATE_ZWRITEENABLE, ...) and the Blending Factors are set SetState(VXRENDERSTATE_SRCBLEND, SrcBlendMode) and SetState(VXRENDERSTATE_DESTBLEND, DestBlendMode). +Alpha testing is set,SetState(VXRENDERSTATE_ALPHATESTENABLE,AlphaTestEnabled),SetState(VXRENDERSTATE_ALPHAFUNC, AlphaFunc),SetState(VXRENDERSTATE_ALPHAREF, AlphaRef);

See Also

CKRenderContext::SetCurrentMaterial,CKTexture::SetAsCurrent,CKRenderContext::SetState


CKMaterial::AlphaBlendEnabled

Pure Virtual Method Method CKMaterial::AlphaBlendEnabled

virtual CKBOOL CKMaterial::AlphaBlendEnabled()

Checks whether alpha blending is enabled or not.

Returns

TRUE, if it enables.

Remarks

See VXBLEND_MODE documentation for more details on the blend modes.

See Also

EnableAlphaBlend,SetSourceBlend


CKMaterial::EnableAlphaBlend

Pure Virtual Method Method CKMaterial::EnableAlphaBlend

virtual void CKMaterial::EnableAlphaBlend(CKBOOL Blend=TRUE)

Enables or disables blending.

Parameters

Input argument Blend

TRUE to enable blending, FALSE otherwise.

Remarks

See VXBLEND_MODE documentation for more details on the blend modes.

See Also

AlphaBlendEnabled,Set


CKMaterial::GetDestBlend

Pure Virtual Method Method CKMaterial::GetDestBlend

virtual VXBLEND_MODE CKMaterial::GetDestBlend()

Gets destination blend factor.

Returns

Destination blend factor

Remarks

See VXBLEND_MODE documentation for more details on the blend modes.

See Also

SetDestBlend, VXBLEND_MODE


CKMaterial::GetSourceBlend

Pure Virtual Method Method CKMaterial::GetSourceBlend

virtual VXBLEND_MODE CKMaterial::GetSourceBlend()

Gets source blend factor.

Returns

Source blend factor

Remarks

See VXBLEND_MODE documentation for more details on the blend modes.

See Also

SetSourceBlend, VXBLEND_MODE


CKMaterial::IsAlphaTransparent

Pure Virtual Method Method CKMaterial::IsAlphaTransparent

virtual CKBOOL CKMaterial::IsAlphaTransparent()

Checks whether this material has transparency.

Returns

TRUE if the blending is enabled and the destination blend mode is different from VXBLEND_ZERO.

Remarks

This method is used by the engine to identify objects that should be rendered last (transparent objects).

See Also

SetDestBlend,EnableAlphaBlend


CKMaterial::SetDestBlend

Pure Virtual Method Method CKMaterial::SetDestBlend

virtual void CKMaterial::SetDestBlend(VXBLEND_MODE BlendMode)

Sets destination blend factor.

Parameters

Input argument BlendMode

Destination blend factor

Remarks

See VXBLEND_MODE documentation for more details on the blend modes.

See Also

GetDestBlend, VXBLEND_MODE


CKMaterial::SetSourceBlend

Pure Virtual Method Method CKMaterial::SetSourceBlend

virtual void CKMaterial::SetSourceBlend(VXBLEND_MODE BlendMode)

Sets source blend factor.

Parameters

Input argument BlendMode

Source blend factor

Remarks

See VXBLEND_MODE documentation for more details on the blend modes.

See Also

GetSourceBlend, VXBLEND_MODE


CKMaterial::EnableZWrite

Pure Virtual Method Method CKMaterial::EnableZWrite

virtual void CKMaterial::EnableZWrite(CKBOOL ZWrite=TRUE)

Enables writing in Zbuffer

Parameters

Input argument ZWrite

TRUE to enable writing in the ZBuffer.

See Also

ZWriteEnabled


CKMaterial::GetFillMode

Pure Virtual Method Method CKMaterial::GetFillMode

virtual VXFILL_MODE CKMaterial::GetFillMode()

Gets the fill mode.

Returns

Fill mode

See Also

SetFillMode


CKMaterial::GetShadeMode

Pure Virtual Method Method CKMaterial::GetShadeMode

virtual VXSHADE_MODE CKMaterial::GetShadeMode()

Gets the shade mode.

Returns

Shade mode.

See Also

VXSHADE_MODE, SetShadeMode


CKMaterial::GetZFunc

Pure Virtual Method Method CKMaterial::GetZFunc

virtual VXCMPFUNC CKMaterial::GetZFunc()

Gets the Z comparison function.

Returns

Z Comparison function.

See Also

SetZFunc, VXCMPFUNC


CKMaterial::IsLightingTwoSided

Pure Virtual Method Method CKMaterial::IsLightingTwoSided

virtual CKBOOL CKMaterial::IsLightingTwoSided()

Checks whether this material should use 2 sided lighting. This feature will have effect with an OpenGL rasterizer only.

Returns

TRUE, if material uses 2 sided lighting

See Also

SetTwoSidedLighting


CKMaterial::IsTwoSided

Pure Virtual Method Method CKMaterial::IsTwoSided

virtual CKBOOL CKMaterial::IsTwoSided()

Checks whether the material is both sided or not

Returns

TRUE, if it is two sided

See Also

SetTwoSided


CKMaterial::SetFillMode

Pure Virtual Method Method CKMaterial::SetFillMode

virtual void CKMaterial::SetFillMode(VXFILL_MODE FillMode)

Sets the fill mode.

See Also

GetFillMode


CKMaterial::SetShadeMode

Pure Virtual Method Method CKMaterial::SetShadeMode

virtual void CKMaterial::SetShadeMode(VXSHADE_MODE ShadeMode)

Sets the shade mode.

See Also

VXSHADE_MODE, GetShadeMode


CKMaterial::SetTwoSided

Pure Virtual Method Method CKMaterial::SetTwoSided

virtual void CKMaterial::SetTwoSided(CKBOOL TwoSided)

Sets the material in both sided mode.

Parameters

Input argument TwoSided

TRUE to set the material to both sided, FALSE otherwise.

See Also

IsTwoSided


CKMaterial::SetTwoSidedLighting

Pure Virtual Method Method CKMaterial::SetTwoSidedLighting

virtual void CKMaterial::SetTwoSidedLighting(CKBOOL TwoSided)

Sets the material in both sided lighting mode. This feature will have effect with an OpenGL rasterizer only.

Parameters

Input argument TwoSided

TRUE to set the material lighting should be both sided, FALSE otherwise.

See Also

IsLightingTwoSided


CKMaterial::SetZFunc

Pure Virtual Method Method CKMaterial::SetZFunc

virtual void CKMaterial::SetZFunc(VXCMPFUNC ZFunc=VXCMP_LESSEQUAL)

Sets the Z comparison function.

Parameters

Input argument ZFunc

Z comparison function

Remarks

+When rendering a primitive a pixel will be written to the screen only if the Z comparison function returns TRUE. +The default value is VXCMP_LESSEQUAL where to be written a fragment must have a Z value inferior at what is already on the screen (that is must be closer to the viewpoint).

See Also

GetZFunc, VXCMPFUNC


CKMaterial::ZWriteEnabled

Pure Virtual Method Method CKMaterial::ZWriteEnabled

virtual CKBOOL CKMaterial::ZWriteEnabled()

Checks whether writing in ZBuffer is enabled.

Returns

TRUE, if it is enabled.

See Also

EnableZWrite


CKMaterial::AlphaTestEnabled

Pure Virtual Method Method CKMaterial::AlphaTestEnabled

virtual CKBOOL CKMaterial::AlphaTestEnabled()

Checks whether the alpha test is enabled

Returns

TRUE, if it is enabled, FALSE otherwise

See Also

EnableAlphaTest,GetAlphaFunc,GetAlphaRef


CKMaterial::EnableAlphaTest

Pure Virtual Method Method CKMaterial::EnableAlphaTest

virtual void CKMaterial::EnableAlphaTest(CKBOOL Enable = TRUE)

Enables or disables alpha testing.

See Also

AlphaTestEnabled, SetAlphaFunc,SetAlphaRef


CKMaterial::GetAlphaFunc

Pure Virtual Method Method CKMaterial::GetAlphaFunc

virtual VXCMPFUNC CKMaterial::GetAlphaFunc()

Gets alpha comparision function.

Returns

Alpha comparision function

See Also

VXCMPFUNC, SetAlphaFunc,EnableAlphaTest,SetAlphaRef


CKMaterial::GetAlphaRef

Pure Virtual Method Method CKMaterial::GetAlphaRef

virtual CKBYTE CKMaterial::GetAlphaRef()

Gets alpha referential value.

Returns

Alpha referential value.

See Also

SetAlphaRef,SetAlphaFunc,EnableAlphaTest


CKMaterial::SetAlphaFunc

Pure Virtual Method Method CKMaterial::SetAlphaFunc

virtual void CKMaterial::SetAlphaFunc(VXCMPFUNC AlphaFunc=VXCMP_ALWAYS)

Sets alpha comparison function.

Parameters

Input argument AlphaFunc

Alpha comparison function.

See Also

VXCMPFUNC,SetAlphaRef,GetAlphaFunc,EnableAlphaTest


CKMaterial::SetAlphaRef

Pure Virtual Method Method CKMaterial::SetAlphaRef

virtual void CKMaterial::SetAlphaRef(CKBYTE AlphaRef=0)

Sets alpha referential value for alpha testing.

Parameters

Input argument AlphaRef

Alpha referential value (0..255)

See Also

GetAlphaRef,SetAlphaFunc,EnableAlphaTest


CKMaterial::Cast

Static Object Method CKMaterial::Cast

static CKMaterial* CKMaterial::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKMaterial::SetEffect

Pure Virtual Method Method CKMaterial::SetEffect

virtual void CKMaterial::SetEffect(VX_EFFECT Effect)
virtual VX_EFFECT CKMaterial::GetEffect()

Sets a special effect on a material.

Remarks

Some additional effects were added on a CKMaterial to support new graphics features such as bump mapping and cube maps. When en effect is set it may override default features

See Also

VxEffectDescription,GetEffectParameter,CKRenderManager::GetEffectDescription


CKMaterial::DestroyCKMaterialShader

Pure Virtual Method Method CKMaterial::DestroyCKMaterialShader

virtual void CKMaterial::DestroyCKMaterialShader( CKMaterialShader*& mfx )

Destroy a CKMaterialShader, and set the input pointer (mfx) to NULL

Remarks

You must call this function in order to destroy a CKMaterialShader (attached or not to the material). When a Material Effect is set, it uses a CKShader and a CKShaderTechnique that is used as pipeline configuration for rendering the mesh. If supported by the current rasterizer (DX9 for example) the effect completly overrides the settings of the material.

See Also

SetMaterialShader,GetMaterialShader


CKMaterial::GetMaterialShader

Pure Virtual Method Method CKMaterial::GetMaterialShader

virtual CKMaterialShader* CKMaterial::GetMaterialShader(bool LinkParams = FALSE)

Gets the material shader (DirectX 9 Effect Extension)

Parameters

Input argument LinkParams

The first time it is used for rendering a material shader parameters must be linked in case the effect was recompiled so this parameter must be set to TRUE. Other calls to GetMaterialShader in the same frame can be made with LinParams set to FALSE.

Returns

The current CKMaterialShader set on the material.

Remarks

When a Material Effect is set, it uses a CKShader and a CKShaderTechnique that is used as pipeline configuration for rendering the mesh. If supported by the current rasterizer (DX9 for example) the effect completly overrides the settings of the material.al.

See Also

SetMaterialShader,DestroyCKMaterialShader


CKMaterial::GetShaderParamObject

Pure Virtual Method Method CKMaterial::GetShaderParamObject

virtual CKObject* CKMaterial::GetShaderParamObject( char* iParamName )


CKMaterial::GetShaderParamValue

Pure Virtual Method Method CKMaterial::GetShaderParamValue

virtual void CKMaterial::GetShaderParamValue( char* iParamName, void* oBuffer )


CKMaterial::SetMaterialShader

Pure Virtual Method Method CKMaterial::SetMaterialShader

virtual void CKMaterial::SetMaterialShader(CKMaterialShader* shader)

Sets the material shader (DirectX 9 Effect Extension)

Parameters

effect:The CKMaterialShader to use or null to disable usage of material effects..

Remarks

When a Material Effect is set, it uses a CKShader and a CKShaderTechnique that is used as pipeline configuration for rendering the mesh. If supported by the current rasterizer (DX9 for example) the effect completly overrides the settings of the material.

See Also

DestroyCKMaterialShader,GetMaterialShader


CKMaterial::SetShader

Pure Virtual Method Method CKMaterial::SetShader

virtual void CKMaterial::SetShader( CKShader* shader )

Applies a shader to the material (DirectX 9 Effect Extension)

Parameters

shader

The CKShader to apply to the material (can be null to remove a shader)

Remarks

The SetShader function won't perform any action if the material has already be assigned with the same shader.


CKMaterial::SetShaderByName

Pure Virtual Method Method CKMaterial::SetShaderByName

virtual void CKMaterial::SetShaderByName( char* iName )


CKMaterial::SetShaderParamObject

Pure Virtual Method Method CKMaterial::SetShaderParamObject

virtual void CKMaterial::SetShaderParamObject( char* iParamName, CKObject* iObj )


CKMaterial::SetShaderParamValue

Pure Virtual Method Method CKMaterial::SetShaderParamValue

virtual void CKMaterial::SetShaderParamValue( char* iParamName, void* iBuffer )


CKBlendShapeSet

Class CKBlendShapeSet

A set of blend shapes affecting a mesh. This object can be given to CKMesh::SetBlendShapeSet to set the group of blend shapes affecting that mesh.

Groups

Data Members
Member Variable m_InitialVerts
Member Variable m_LogicalBlendShapeNames
Member Variable m_PhysicalBlendShapes
Operations
Method Clear
Generated by the DocJet Source Code Documentation System version 6.1.3 Thursday, February 26, 2009
C++
C#
VB
JScript
All
Group Class Hierarchy

Class CKBlendShapeVertexDelta

Position and normal deltas for a specific vertex / blend shape

Groups

Data Members
Member Variable m_Index
Member Variable m_NormalDelta
Member Variable m_PosDelta
Operations
Method Scale
Generated by the DocJet Source Code Documentation System version 6.1.3 Thursday, February 26, 2009
C++
C#
VB
JScript
All
Group Class Hierarchy

Class CKMesh

Representation of the geometry of a 3D object

CKObject

CKSceneObject

CKBeObject
Show brief derivation trees

CKMesh

CKPatchMesh

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKMesh

Subclasses

CKPatchMesh

Remarks

The CKMesh class is the class describing geometrical representation of an object. It can be a mesh made up of faces or lines. Description of a mesh includes vertices (Position,color,texture coordinates,normal),faces or lines

A CKMesh can have up to 8 additionals material channels that is textures that are blended together on the mesh. Material Channels can be used to produce light maps for example.

A CKMesh can have callbacks attached to it. A PreRender or PostRender Callback can be set to do specific operations before or after the rendering of the mesh is done (A mesh could be rendered several times in a single frame if more than one CK3dEntity use it !). A render callback can be set to replace the default rendering.

Its class id is CKCID_MESH

Groups

Modifying geometry | Vertices | Faces | Lines | Material Channels | Materials | Progressive Mesh | Utilities | Bounding Volumes | Callbacks | Vertex Weights | Blend shapes | Cast operator | Constructors | Operations | Rendering | Settings

Modifying geometry
Pure Virtual Method Method GetModifierUVs | Returns a pointer to the vertices texture coordinates.
Pure Virtual Method Method GetModifierVertices | Returns a pointer to the vertex positions.
Pure Virtual Method Method ModifierUVMove | Notifies when texture coordinates have been changed.
Pure Virtual Method Method ModifierVertexMove | Notifies when vertices in the mesh have been moved.
Vertices
Pure Virtual Method Method ColorChanged | Notifies vertex color modifications.
Pure Virtual Method Method GetColorsPtr | Returns the array of vertices colors
Pure Virtual Method Method GetNormalsPtr | Returns the array of normals.
Pure Virtual Method Method GetPositionsPtr | Returns the array of vertex positions
Pure Virtual Method Method GetSpecularColorsPtr | Returns the array of vertices specular colors
Pure Virtual Method Method GetTextureCoordinatesPtr | Returns the array of texture coordinates.
Pure Virtual Method Method GetVertexColor | Gets the color of a given vertex.
Pure Virtual Method Method GetVertexCount | Returns the number of vertices.
Pure Virtual Method Method GetVertexData | Gets the data of a vertex (can be 1 float or 2 or 3 or 4).
Pure Virtual Method Method GetVertexNormal | Gets the Normal of a given vertex.
Pure Virtual Method Method GetVertexPosition | Gets the position of a given vertex.
Pure Virtual Method Method GetVertexSpecularColor | Gets the specular color of a given vertex.
Pure Virtual Method Method GetVertexTextureCoordinates | Gets the texture coordinates of a given vertex.
Pure Virtual Method Method NormalChanged | Notifies normal modifications.
Pure Virtual Method Method SetVertexColor | Sets the color of a vertex.
Pure Virtual Method Method SetVertexCount | Sets the number of vertices.
Pure Virtual Method Method SetVertexData | Sets the data of a vertex (can be 1 float or 2 or 3 or 4).
Pure Virtual Method Method SetVertexNormal | Sets the normal for vertex.
Pure Virtual Method Method SetVertexPosition | Sets the position of a vertex.
Pure Virtual Method Method SetVertexSpecularColor | Sets the specular color of a vertex.
Pure Virtual Method Method SetVertexTextureCoordinates | Sets the texture coordinates of a vertex.
Pure Virtual Method Method UVChanged | Notifies texture coordinates modifications
Pure Virtual Method Method VertexMove | Notifies vertex movement.
Faces
Pure Virtual Method Method ApplyGlobalMaterial | Sets the same material to all faces.
Pure Virtual Method Method GetFaceCount | Returns number of faces in the mesh.
Pure Virtual Method Method GetFaceMaterial | Gets the material of a face.
Pure Virtual Method Method GetFaceNormal | Gets the normal of a given face.
Pure Virtual Method Method GetFaceNormalsPtr | Returns the pointer to the list of face normals.
Pure Virtual Method Method GetFacesIndices | Gets all the face indices of the mesh.
Pure Virtual Method Method GetFaceVertex | Gets a vertex from face.
Pure Virtual Method Method GetFaceVertexIndex | Gets the vertices making a given face.
Pure Virtual Method Method SetFaceCount | Sets the number of faces for the mesh.
Pure Virtual Method Method SetFaceMaterial | Sets the material for one or more faces.
Pure Virtual Method Method SetFaceVertexIndex | Sets the vertex indices for a face.
Lines
Pure Virtual Method Method CreateLineStrip | Creates a line strip.
Pure Virtual Method Method GetLine | Gets the vertex indices of a line.
Pure Virtual Method Method GetLineCount | Returns the number of lines in the mesh.
Pure Virtual Method Method GetLineIndices | Returns the list of line indices.
Pure Virtual Method Method SetLine | Sets the vertex indices to a line.
Pure Virtual Method Method SetLineCount | Sets the number of lines in the mesh.
Material Channels
Pure Virtual Method Method ActivateAllChannels | Sets the active flag for all channels.
Pure Virtual Method Method ActivateChannel | Sets the active flag of the specified channel.
Pure Virtual Method Method AddChannel | Adds a channel to the mesh.
Pure Virtual Method Method AddChannelExt | Adds a channel to the mesh and specify its type.
Pure Virtual Method Method GetChannelByMaterial | Returns the index of a channel given its material.
Pure Virtual Method Method GetChannelCount | Returns the number of channels in the mesh.
Pure Virtual Method Method GetChannelDestBlend | Returns the destination blend mode of a specific channel.
Pure Virtual Method Method GetChannelFlags | Returns the Channel flags of a channel.
Pure Virtual Method Method GetChannelMaterial | Returns the material of a channel.
Pure Virtual Method Method GetChannelShaderOverride | Returns the shader that overrides a channel material (possibly NULL)
Pure Virtual Method Method GetChannelSourceBlend | Returns the source blend mode of a specific channel.
Pure Virtual Method Method GetChannelType | Retrieves the channel type
Pure Virtual Method Method GetOverridenChannelByMaterial | Returns the index of a channel given its material, and 'shader override'
Pure Virtual Method Method IsChannelActive | Returns the active flag of a specific channel.
Pure Virtual Method Method IsChannelLit | Returns whether a specific channel is to be lit.
Pure Virtual Method Method LitChannel | Sets the lighting flag of the specified channel.
Pure Virtual Method Method OverrideChannelTechnique | Force a channel to be rendered using a different technique than that of its material shader (if any). if altTechnique is < 0 or if there is no shader, then 'altShader' will replace the material when the channel is rendered. The shader will have access to this channel material parameters, however. This way it is possible to mimic some material property such as alpha test settings, diffuse color etc. in a channel with a shader. (The material will usually be that of the underlying mesh). At least, if altShader is NULL, then no override will take place, and the channel will be rendered as usual.
Pure Virtual Method Method RemoveChannel | Removes a channel from the mesh.
Pure Virtual Method Method SetChannelDestBlend | Sets the destination blend mode of a specific channel.
Pure Virtual Method Method SetChannelFaceIndices | Sets the indices for a given channel.
Pure Virtual Method Method SetChannelFaceIndicesByMeshMaterials | Sets the indices for a given channel so that it covers all triangles of the mesh that use a given set of materials. If you plan to reuse the mesh VB as it in the channel, then it may be best to include VXCHANNEL_HINT_USEORIGINALMESHVB in the channel flags. This way the engine will only maintain a list of material instead of a full list of vertex indices, as long as indices, flags and material remain unmodified.
Pure Virtual Method Method SetChannelFlags | Sets the Channel flags of a channel.
Pure Virtual Method Method SetChannelMaterial | Sets material of a given channel.
Pure Virtual Method Method SetChannelSourceBlend | Sets the source blend mode of a specific channel.
Pure Virtual Method Method SetChannelType | Set the channel type
Materials
Pure Virtual Method Method GetMaterial | Returns the material given its index.
Pure Virtual Method Method GetMaterialCount | Returns the number of different materials.
Pure Virtual Method Method GetMaterialFaces | Returns an array of the faces on which a material is applied
Pure Virtual Method Method ReplaceMaterial | Replaces any reference to a material by a new.
Progressive Mesh
Pure Virtual Method Method CreatePM | Creates the progressive mesh data for the mesh.
Pure Virtual Method Method DestroyPM | Destroy the progressive mesh data for the mesh.
Pure Virtual Method Method EnablePMGeoMorph | Sets the progressive mesh to proceed geomorphic transition when changing level.
Pure Virtual Method Method GetPMGeoMorphStep | Gets the geomorph steps.
Pure Virtual Method Method GetVerticesRendered | Gets the number of vertices actually rendered.
Pure Virtual Method Method IsPM | Returns if the mesh is progressive.
Pure Virtual Method Method IsPMGeoMorphEnabled | Returns if the progressive mesh enable geomorphic transition.
Pure Virtual Method Method SetPMGeoMorphStep | Sets the geomorph steps.
Pure Virtual Method Method SetVerticesRendered | Sets the number of vertices to be rendered.
Utilities
Pure Virtual Method Method BuildFaceNormals | Calculates face normals of all faces in the mesh.
Pure Virtual Method Method BuildNormals | Calculates vertex normals of all vertices of the mesh.
Pure Virtual Method Method Clean | Removes all primitives(faces,lines,material channels)
Pure Virtual Method Method Consolidate | Removes the degenerate faces and the isolated vertices of a mesh.
Pure Virtual Method Method DissociateAllFaces | Dissociates all faces.
Pure Virtual Method Method InverseWinding | Inverse the faces by changing the winding order of the vertices.
Pure Virtual Method Method LoadVertices | Restores the vertices from a chunk.
Pure Virtual Method Method MergeIdenticalVertices | Merge Identical Vertices
Pure Virtual Method Method RotateVertices | Rotates all vertices of the mesh by given angle.
Pure Virtual Method Method ScaleVertices | Scales all vertices of the mesh by given vector.
Pure Virtual Method Method TranslateVertices | Translates all vertices of the mesh by given vector
Pure Virtual Method Method UnOptimize | Marks the mesh as to be re-optimized.
Bounding Volumes
Pure Virtual Method Method GetBaryCenter | Returns the barycenter of the mesh.
Pure Virtual Method Method GetLocalBox | Returns the bounding box of the mesh.
Pure Virtual Method Method GetRadius | Returns the radius of the mesh.
Callbacks
Pure Virtual Method Method AddPostRenderCallBack | Adds a function to be called after rendering the mesh.
Pure Virtual Method Method AddPreRenderCallBack | Adds a function to be called before rendering the mesh.
Pure Virtual Method Method RemoveAllCallbacks | Removes all the callback functions.
Pure Virtual Method Method RemovePostRenderCallBack | Removes a post-render callback function.
Pure Virtual Method Method RemovePreRenderCallBack | Removes a pre-render callback function.
Pure Virtual Method Method SetDefaultRenderCallBack | Restores the default rendering function.
Pure Virtual Method Method SetRenderCallBack | Sets the mesh rendering function.
Vertex Weights
Pure Virtual Method Method GetVertexWeight | Returns the vertex weight of a given vertex.
Pure Virtual Method Method GetVertexWeightsCount | Returns the number of vertex weights.
Pure Virtual Method Method GetVertexWeightsPtr | Returns a pointer to the list of vertex weights.
Pure Virtual Method Method SetVertexWeight | Sets the vertex weight at a given position.
Pure Virtual Method Method SetVertexWeightsCount | Sets the number of vertex weights.
Blend shapes
Pure Virtual Method Method GetBlendShapeCount | Retrieve the number of blend shapes for this mesh
Pure Virtual Method Method GetBlendShapeIndexFromName | Retrieve a blend shape index from its name
Pure Virtual Method Method GetBlendShapeNameFromIndex | Retrieve the name of a blend shape from its index.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Constructors
Method CKMesh | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Pure Virtual Method Method GetBlendShapeSet | Get a copy of the blend shapes description for this mesh
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method SetBlendShapeSet | Build the blend shapes for this mesh
Rendering
Pure Virtual Method Method Render | Renders the mesh.
Settings
Pure Virtual Method Method GetFlags | Returns the Mesh flags.
Pure Virtual Method Method GetLitMode | Returns the mesh Lighting mode.
Pure Virtual Method Method GetWrapMode | Returns the mesh texture wrapping mode.
Pure Virtual Method Method IsTransparent | Checks whether the mesh is considered transparent
Pure Virtual Method Method SetFlags | Sets the Mesh flags.
Pure Virtual Method Method SetLitMode | Sets the mesh lighting mode.
Pure Virtual Method Method SetTransparent | Forces the mesh to be considered transparent.
Pure Virtual Method Method SetWrapMode | Sets the mesh texture wrapping mode.

See Also

Using Meshes,CK3dEntity

Generated by the DocJet Source Code Documentation System version 6.1.3 Thursday, February 26, 2009
C++
C#
VB
JScript
All
Class Hierarchy

Structure CKBlendShape

class CKBlendShape
{
public:
XClassArray<CKBlendShapeVertexDelta> m_Deltas;
int m_LogicalBlendShape;
float m_Weight;
float m_InSlope;
float m_OutSlope;
}

A physical blend shape. A logical blend shape may be made of one or several physical blend shapes, each having a weight for which they have full influence. This allows to have “progressive morph targets”, with several intermediate morphs, controlled by a single value.

Members

m_Deltas |
m_InSlope |
m_LogicalBlendShape |
m_OutSlope |
m_Weight | weight of the “parent logical blend shape” at which this blend shape has full influence
Generated by the DocJet Source Code Documentation System version 6.1.3 Thursday, February 26, 2009
C++
C#
VB
JScript
All
Class Hierarchy

Structure CKBlendShapeInitialVertex

class CKBlendShapeInitialVertex
{
public:
int m_Index;
VxVector m_Pos;
VxVector m_Normal;
}

Initial position of a vertex in a mesh, at a location where one or several blend shapes may operate

Members

m_Index
m_Normal
m_Pos


CKMesh::GetModifierUVs

Pure Virtual Method Method CKMesh::GetModifierUVs

virtual BYTE* CKMesh::GetModifierUVs(CKDWORD* Stride,int channel=-1)
virtual int CKMesh::GetModifierUVCount(int channel=-1)
virtual void CKMesh::GetModifierUV(int iIndex, float* oU, float *oV, int channel=-1)
virtual void CKMesh::SetModifierUV(int iIndex, float iU, float iV, int channel=-1)

Returns a pointer to the vertices texture coordinates.

Parameters

Input argument Stride | Size in byte between each texture coordinate in the returned buffer.
Input argument channel | Index of the texture channel whose coordinates should be returned. -1 means the default texture coordinates, additional channels are accessed from 0 to MAX_CHANNELS

Returns

A pointer to the texture coordinates list

Remarks

+Use this method along with GetModifierUVCount rather than using GetTextureCoordinatesPtr to access texture coordinates so that you code will work on any type of mesh (CKMesh and CKPatchMesh for example). +For a pure CKMesh this methods is the same than GetTextureCoordinatesPtr.

Example

Translates all the uvs of a mesh by a given translation vector

           VxUV Translation(0.01f,0);
           int VCount = mesh->GetModifierUVCount();
           CKDWORD Stride;
           BYTE* VPtr = mesh->GetModifierUVs(&Stride);

           if (VPtr) {
               for (int i = 0; i < VCount; ++i ,VPtr+=Stride) {
                   (* ((VxUV*) VPtr )) += Translation;
               }
           }

Since texture coordinates were changed we need to notify the mesh...
           mesh->ModifierUVMove();

See Also

ModifierUVMove, GetTextureCoordinatesPtr


CKMesh::GetModifierVertices

Pure Virtual Method Method CKMesh::GetModifierVertices

virtual BYTE* CKMesh::GetModifierVertices(CKDWORD* Stride)
virtual int CKMesh::GetModifierVertexCount()
virtual void CKMesh::GetModifierVertex(int iIndex, VxVector* oPosition)
virtual void CKMesh::SetModifierVertex(int iIndex, VxVector* iPosition)

Returns a pointer to the vertex positions.

Parameters

Input argument Stride

Size in byte between each position in the returned buffer. iIndex: Index of the vertex to set or get. oPosition: Position to set.

Returns

A pointer to the vertices list

Remarks

Use this method along with GetModifierVertexCount rather than using GetPositionsPtr to move the vertices so that you code will work on any type of mesh (CKMesh and CKPatchMesh for example). For a pure CKMesh this methods is the same than GetPositionsPtr.

Example

Translates all the vertices of a mesh by a given translation vector

           VxVector Translation(10.0f,0,0);
           int VCount = mesh->GetModifierVertexCount();
           CKDWORD Stride;
           BYTE* VPtr = mesh->GetModifierVertices(&Stride);

           if (VPtr) {
               for (int i = 0; i < VCount; ++i ,VPtr+=Stride) {
                   (*( (VxVector*) VPtr )) += Translation;
               }
           }
Since vertices was only translated there is no need to
rebuild the normals, we only notify the mesh that the
the vertices moved.
           mesh->ModifierVertexMove(FALSE,FALSE);

See Also

GetModifierUVs, ModifierVertexMove, GetPositionsPtr


CKMesh::ModifierUVMove

Pure Virtual Method Method CKMesh::ModifierUVMove

virtual void CKMesh::ModifierUVMove (int Channel = -1)

Notifies when texture coordinates have been changed.

Parameters

channel: Channel index.

Remarks

channel -1 means the base mesh texture coordinates, additional channels start at index 0.

See Also

UVChanged,GetModifierUVs,GetModifierUVCount


CKMesh::ModifierVertexMove

Pure Virtual Method Method CKMesh::ModifierVertexMove

virtual void CKMesh::ModifierVertexMove (CKBOOL RebuildNormals,CKBOOL RebuildFaceNormals)

Notifies when vertices in the mesh have been moved.

Parameters

Input argument RebuildNormals | TRUE if vertex normals have to be re-calculated, FALSE otherwise.
Input argument RebuildFaceNormals | TRUE if face normals have to be re-calculated, FALSE otherwise.

See Also

GetModifierVertices,ModifierUVMove,VertexMove


CKMesh::ColorChanged

Pure Virtual Method Method CKMesh::ColorChanged

virtual void CKMesh::ColorChanged()

Notifies vertex color modifications.

Remarks

+Notifies at least a vertex color has changed. +This should be called if a vertex normal was changed after a call to GetColorsPtr.

See Also

GetColorsPtr,GetSpecularColorsPtr


CKMesh::GetColorsPtr

Pure Virtual Method Method CKMesh::GetColorsPtr

virtual void* CKMesh::GetColorsPtr(CKDWORD* Stride, int channel=-1)

Returns the array of vertices colors

Parameters

Input argument Stride

A pointer to a CKDWORD that will be filled with the amount in bytes between each color stored in returned array.

Returns

A pointer to the color list.

Remarks

+The vertex color depends on the light state (VX_LITMODE) of the mesh. If that state is VX_LITMESH and no call to SetLitMode(VX_PRELITMESH) was done before, then there is no colors to return. +If you used this method to change the vertex color you must call ColorChanged to warn the Render engine.

See Also

SetVertexColor, SetLitMode,GetSpecularColorsPtr


CKMesh::GetNormalsPtr

Pure Virtual Method Method CKMesh::GetNormalsPtr

virtual void* CKMesh::GetNormalsPtr(CKDWORD* Stride)

Returns the array of normals.

Parameters

Input argument Stride

A pointer to a CKDWORD that will be filled with the amount in bytes between each normals stored in the returned array.

Returns

A pointer to the normals list.

Remarks

If you used this method to change some colors you must call ColorChanged to warn the Render engine.

See Also

GetVertexNormal,SetVertexNormal


CKMesh::GetPositionsPtr

Pure Virtual Method Method CKMesh::GetPositionsPtr

virtual void* CKMesh::GetPositionsPtr(CKDWORD* Stride)

Returns the array of vertex positions

Parameters

Input argument Stride

A pointer to a CKDWORD that will be filled with the amount in bytes between each vertex positions stored in the returned array.

Returns

A pointer to the vertex position list.

See Also

SetVertexPosition,GetVertexPosition


CKMesh::GetSpecularColorsPtr

Pure Virtual Method Method CKMesh::GetSpecularColorsPtr

virtual void* CKMesh::GetSpecularColorsPtr(CKDWORD* Stride)

Returns the array of vertices specular colors

Parameters

Input argument Stride

A pointer to a CKDWORD that will be filled with the amount in bytes between each specular color stored in the array returned

Returns

A pointer to the specular color list.

Remarks

+The vertex color depends on the light state (VX_LITMODE) of the mesh. If that state is VX_LITMESH and no call to SetLitMode(VX_PRELITMESH) was done before, then there is no colors to return. +If you used this method to change some colors you must call ColorChanged to warn the Render engine.

See Also

SetVertexColor, SetLitMode,GetSpecularColorsPtr


CKMesh::GetTextureCoordinatesPtr

Pure Virtual Method Method CKMesh::GetTextureCoordinatesPtr

virtual void* CKMesh::GetTextureCoordinatesPtr(CKDWORD* Stride,int channel=-1)

Returns the array of texture coordinates.

Parameters

Input argument Stride | A pointer to a CKDWORD that will be filled with the amount in bytes between each texture coordinate stored in the returned array.
Input argument channel | Channel index for which the list is to obtained (See Remarks).

Returns

A pointer to the Texture coordinates list.

Remarks

+If channel = -1, list of texture coordinates of each vertex is returned,else channel's texture coordinates list is returned. +Returns NULL for invalid channel.

See Also

SetVertexTextureCoordinates,AddChannel


CKMesh::GetVertexColor

Pure Virtual Method Method CKMesh::GetVertexColor

virtual CKDWORD CKMesh::GetVertexColor(int Index)

Gets the color of a given vertex.

Parameters

Input argument Index

Index of the vertex in the mesh.

Returns

Color value of vertex (ARGB 32 Bits).

See Also

SetVertexColor,GetColorsPtr


CKMesh::GetVertexCount

Pure Virtual Method Method CKMesh::GetVertexCount

virtual int CKMesh::GetVertexCount()

Returns the number of vertices.

Returns

Returns the number of vertices.

See Also

SetVertexCount


CKMesh::GetVertexData

Pure Virtual Method Method CKMesh::GetVertexData

virtual void CKMesh::GetVertexData(int Index, int ChanIndex, void* dest )

Gets the data of a vertex (can be 1 float or 2 or 3 or 4).

Parameters

Input argument Index | Index of the vertex.
Input argument ChanIndex | Index of the channel from 0 to MAX_CHANNELS Data: Pointer to the destination vertex's data. If channel type is FLOATN, the dest pointer should point to N floats.

See Also

GetVertexTextureCoordinates, GetTextureCoordinatesPtr, SetVertexData


CKMesh::GetVertexNormal

Pure Virtual Method Method CKMesh::GetVertexNormal

virtual void CKMesh::GetVertexNormal(int Index, VxVector *Vector)

Gets the Normal of a given vertex.

Parameters

Input argument Index | Index of the vertex in the mesh which normal should be returned.
Input argument Vector | A pointer to be filled with normal of the vertex.

See Also

SetVertexNormal,GetNormalsPtr


CKMesh::GetVertexPosition

Pure Virtual Method Method CKMesh::GetVertexPosition

virtual void CKMesh::GetVertexPosition(int Index, VxVector *Vector)

Gets the position of a given vertex.

Parameters

Input argument Index | Index of the vertex in the mesh which position should be returned.
Input argument Vector | A pointer to be filled with the position of the vertex.

See Also

SetVertexPosition,GetPositionsPtr,GetModifierVertices


CKMesh::GetVertexSpecularColor

Pure Virtual Method Method CKMesh::GetVertexSpecularColor

virtual CKDWORD CKMesh::GetVertexSpecularColor(int Index)

Gets the specular color of a given vertex.

Parameters

Input argument Index

Index of the vertex in the mesh.

Returns

Specular color value of vertex (ARGB 32 Bits).

See Also

SetVertexSpecularColor,GetSpecularColorsPtr


CKMesh::GetVertexTextureCoordinates

Pure Virtual Method Method CKMesh::GetVertexTextureCoordinates

virtual void CKMesh::GetVertexTextureCoordinates(int Index, float *u,float *v,int channel=-1)

Gets the texture coordinates of a given vertex.

Parameters

Input argument Index | Index of the vertex in mesh.
Input argument u | Texture coordinate value.
Input argument v | Texture coordinate value.
Input argument channel | Channel index.

See Also

SetVertexTextureCoordinates,GetTextureCoordinatesPtr,GetModifierUVs


CKMesh::NormalChanged

Pure Virtual Method Method CKMesh::NormalChanged

virtual void CKMesh::NormalChanged()

Notifies normal modifications.

Remarks

+Notifies at least a vertex normal has changed. +This should be called if a vertex normal was changed after a call to GetNormalsPtr.

See Also

GetNormalsPtr


CKMesh::SetVertexColor

Pure Virtual Method Method CKMesh::SetVertexColor

virtual void CKMesh::SetVertexColor(int Index, CKDWORD Color)

Sets the color of a vertex.

Parameters

Input argument Index | Index of the vertex.
Input argument Color | Color to be set to the vertex (CKDWORD ARGB).

Remarks

Vertex colors are only used if the mesh is set in prelit mode (see SetLitMode).

See Also

GetVertexColor,SetVertexSpecularColor,SetLitMode


CKMesh::SetVertexCount

Pure Virtual Method Method CKMesh::SetVertexCount

virtual CKBOOL CKMesh::SetVertexCount(int Count)

Sets the number of vertices.

Parameters

Input argument Count

Required number of vertices.

Returns

TRUE if successful.

Remarks

This method updates the number of vertices in the mesh while keeping any previous vertices.

See Also

GetVertexCount


CKMesh::SetVertexData

Pure Virtual Method Method CKMesh::SetVertexData

virtual void CKMesh::SetVertexData(int Index, int ChanIndex, void* src )

Sets the data of a vertex (can be 1 float or 2 or 3 or 4).

Parameters

Input argument Index | Index of the vertex.
Input argument ChanIndex | Index of the channel from 0 to MAX_CHANNELS Data: Pointer to the source vertex's data. If channel type is FLOATN, the src pointer should point to N floats.

See Also

GetVertexTextureCoordinates, GetTextureCoordinatesPtr, GetVertexData


CKMesh::SetVertexNormal

Pure Virtual Method Method CKMesh::SetVertexNormal

virtual void CKMesh::SetVertexNormal(int Index, VxVector *Vector)

Sets the normal for vertex.

Parameters

Input argument Index | Index of the vertex.
Input argument Vector | A pointer to the normal vector that is to be set to the vertex.

Remarks

Vertex normals are only used if the mesh is set in lit mode (see SetLitMode).

See Also

GetVertexNormal,GetNormalsPtr


CKMesh::SetVertexPosition

Pure Virtual Method Method CKMesh::SetVertexPosition

virtual void CKMesh::SetVertexPosition(int Index, VxVector *Vector)

Sets the position of a vertex.

Parameters

Input argument Index | Index of the vertex in the mesh.
Input argument Vector | A pointer to the position vector that is to be set to the vertex.

See Also

GetVertexPosition,GetPositionsPtr,GetModifierVertices


CKMesh::SetVertexSpecularColor

Pure Virtual Method Method CKMesh::SetVertexSpecularColor

virtual void CKMesh::SetVertexSpecularColor(int Index, CKDWORD Color)

Sets the specular color of a vertex.

Parameters

Input argument Index | Index of the vertex.
Input argument Color | Specular color to be set to the vertex.

Remarks

Vertex colors are only used if the mesh is set in prelit mode (see SetLitMode).

See Also

GetVertexSpecularColor,SetVertexColor


CKMesh::SetVertexTextureCoordinates

Pure Virtual Method Method CKMesh::SetVertexTextureCoordinates

virtual void CKMesh::SetVertexTextureCoordinates(int Index, float u,float v,int channel=-1)

Sets the texture coordinates of a vertex.

Parameters

Input argument Index | Index of the vertex.
Input argument u | U Texture coordinate .
Input argument v | V Texture coordinate.
Input argument channel | Index of the texture channel whose coordinates should be set. -1 means the default texture coordinates, additional channels are accessed from 0 to MAX_CHANNELS

See Also

GetVertexTextureCoordinates,GetTextureCoordinatesPtr


CKMesh::UVChanged

Pure Virtual Method Method CKMesh::UVChanged

virtual void CKMesh::UVChanged(int Channel = -1)

Notifies texture coordinates modifications

Parameters

channel: Channel index.

Remarks

+Channel -1 means the base mesh texture coordinates, additional channels start at index 0. +Notifies at least a vertex texture coordinates have changed. +This should be called if a vertex texture coordinates were changed after a call to GetTextureCoordinatesPtr.

See Also

GetTextureCoordinatesPtr


CKMesh::VertexMove

Pure Virtual Method Method CKMesh::VertexMove

virtual void CKMesh::VertexMove()

Notifies vertex movement.

Remarks

+Notifies at least a vertex position has changed. +This should be called if a position was changed after a call to GetPositionsPtr.

See Also

GetPositionsPtr


CKMesh::ApplyGlobalMaterial

Pure Virtual Method Method CKMesh::ApplyGlobalMaterial

virtual void CKMesh::ApplyGlobalMaterial(CKMaterial *Mat)

Sets the same material to all faces.

Parameters

Input argument Mat

A pointer to the material to be set.

See Also

SetFaceMaterial,GetFaceMaterial,


CKMesh::GetFaceCount

Pure Virtual Method Method CKMesh::GetFaceCount

virtual int CKMesh::GetFaceCount()

Returns number of faces in the mesh.

Returns

Number of faces.

See Also

SetFaceCount


CKMesh::GetFaceMaterial

Pure Virtual Method Method CKMesh::GetFaceMaterial

virtual CKMaterial* CKMesh::GetFaceMaterial(int Index)

Gets the material of a face.

Parameters

Input argument Index

Index of face which material is to be returned.

Returns

Pointer to Material

Remarks

The material of a face defines the way the face will be drawn, as a general rule it is best to avoid having too different materials on a given mesh.

See Also

GetFaceCount,SetFaceMaterial


CKMesh::GetFaceNormal

Pure Virtual Method Method CKMesh::GetFaceNormal

virtual const VxVector& CKMesh::GetFaceNormal(int Index)

Gets the normal of a given face.

Parameters

Input argument Index

Index of face for which normal has to be obtained.

Returns

Normal of the face.

See Also

SetFaceNormal,BuildNormals,BuildFaceNormals


CKMesh::GetFaceNormalsPtr

Pure Virtual Method Method CKMesh::GetFaceNormalsPtr

virtual BYTE* CKMesh::GetFaceNormalsPtr(CKDWORD* Stride)

Returns the pointer to the list of face normals.

Parameters

Input argument Stride

Size in byte between each normals in the returned array .

Returns

BYTE Pointer containing the address of the normal of the first face.

Remarks

+the returned pointer is the address of an array containing VxVector normals for each face, Stride contains the size in bytes between each normal. +see GetModifierVertices for example usage of the Stride value.

See Also

GetFaceNormal, SetFaceNormal


CKMesh::GetFacesIndices

Pure Virtual Method Method CKMesh::GetFacesIndices

virtual CKVINDEX* CKMesh::GetFacesIndices()

Gets all the face indices of the mesh.

Returns

A pointer to an array of CKVINDEX (DWORD on all platform except PSP (WORD)) containing the face indices.

Remarks

The size of the returned array is 3 times the number of faces in the mesh. Each face is made up of three vertices which indices are given in the array. The returned array content must not be modify.

See Also

GetFaceCount,GetFaceVertexIndex


CKMesh::GetFaceVertex

Pure Virtual Method Method CKMesh::GetFaceVertex

virtual VxVector& CKMesh::GetFaceVertex(int FaceIndex,int VIndex)

Gets a vertex from face.

Parameters

Input argument FaceIndex | Index of face in which vertex has to be obtained.
Input argument VIndex | Index of vertex in the face (0..2)

Returns

Vertex of the given face.

Remarks

+This method is a shortcut to return directly the vertex position of the vertex used by a face. It is equivalent to using GetFaceVertexIndex then GetVertexPosition with the result indices.

See Also

SetFaceVertexIndex,GetFaceVertexIndex,GetVertexPosition


CKMesh::GetFaceVertexIndex

Pure Virtual Method Method CKMesh::GetFaceVertexIndex

virtual void CKMesh::GetFaceVertexIndex(int Index,int& Vertex1,int& Vertex2,int& Vertex3)

Gets the vertices making a given face.

Parameters

Input argument Index | Index of the face which the vertex indices have to be obtained.
Input argument Vertex1 | First vertex
Input argument Vertex2 | Second vertex
Input argument Vertex3 | Third vertex

Remarks

Fills 3 vertices supplied with the vertices found at the specified position in face index list.

See Also

GetFaceCount,GetFacesIndices


CKMesh::SetFaceCount

Pure Virtual Method Method CKMesh::SetFaceCount

virtual CKBOOL CKMesh::SetFaceCount(int Count)

Sets the number of faces for the mesh.

Parameters

Input argument Count

Number of faces (triangles) to be set for the mesh.

Returns

TRUE if successful.

See Also

GetFaceCount


CKMesh::SetFaceMaterial

Pure Virtual Method Method CKMesh::SetFaceMaterial

virtual void CKMesh::SetFaceMaterial(int FaceIndex, CKMaterial *Mat)
virtual void CKMesh::SetFaceMaterial(int* FaceIndices,int FaceCount, CKMaterial *Mat)

Sets the material for one or more faces.

Parameters

Input argument FaceIndex | Index of the face for which material has to be set.
Input argument FaceIndices | List of face indices for which material has to be set.
Input argument FaceCount | Number of faces submitted.
Mat | A pointer to the material to be set.

Remarks

If a material has to be changed frequently on a mesh, you must use ReplaceMaterial instead of this methods as they force the reconstruction of runtime specific structures each time a face have its material changed.

See Also

GetFaceMaterial,ReplaceMaterial


CKMesh::SetFaceVertexIndex

Pure Virtual Method Method CKMesh::SetFaceVertexIndex

virtual void CKMesh::SetFaceVertexIndex(int FaceIndex,int Vertex1,int Vertex2,int Vertex3)

Sets the vertex indices for a face.

Parameters

Input argument FaceIndex | Index of face for which vertex indices have to be set.
Input argument Vertex1 | First vertex index in the face.
Input argument Vertex2 | Second vertex index in the face.
Input argument Vertex3 | Third vertex index in the face.

See Also

GetFaceVertexIndex,GetFacesIndices


CKMesh::CreateLineStrip

Pure Virtual Method Method CKMesh::CreateLineStrip

virtual void CKMesh::CreateLineStrip(int StartingLine,int Count,int StartingVertexIndex)

Creates a line strip.

Parameters

Input argument StartingLine | Starting position of line in line segment array.
Input argument Count | Number of segments to be created.
Input argument StartingVertexIndex | Starting index of the line segment.

Remarks

+Creates a line strip with specified number of line segments. +CreateLineStrip(0,3,14) will generate 3 lines (0,1,2) whose vertex indices will respectively be : {(14,15),(15,16),(16,17)}

See Also

SetLine,GetLineIndices,GetLineCount


CKMesh::GetLine

Pure Virtual Method Method CKMesh::GetLine

virtual void CKMesh::GetLine(int LineIndex,int *VIndex1,int *VIndex2)

Gets the vertex indices of a line.

Parameters

Input argument LineIndex | Index of the line whose vertices are to be obtained.
Input argument VIndex1 | First vertex index, to be filled.
Input argument VIndex2 | Second vertex index, to be filled.

See Also

SetLine,GetLineIndices,GetLineCount


CKMesh::GetLineCount

Pure Virtual Method Method CKMesh::GetLineCount

virtual int CKMesh::GetLineCount()

Returns the number of lines in the mesh.

Returns

Number of lines in mesh.

See Also

SetLineCount


CKMesh::GetLineIndices

Pure Virtual Method Method CKMesh::GetLineIndices

virtual CKVINDEX* CKMesh::GetLineIndices()

Returns the list of line indices.

Returns

Pointer to vertex indices of lines in mesh.

Remarks

The returned array size is 2*GetLineCount WORD indices.

See Also

SetLine,GetLine


CKMesh::SetLine

Pure Virtual Method Method CKMesh::SetLine

virtual void CKMesh::SetLine(int LineIndex,int VIndex1,int VIndex2)

Sets the vertex indices to a line.

Parameters

Input argument LineIndex | Index of the line which vertex indices have to be set.
Input argument VIndex1 | First vertex index.
Input argument VIndex2 | Second vertex index.

See Also

GetLineIndices,GetLineCount


CKMesh::SetLineCount

Pure Virtual Method Method CKMesh::SetLineCount

virtual CKBOOL CKMesh::SetLineCount(int Count)

Sets the number of lines in the mesh.

Parameters

Input argument Count

Number of lines.

Returns

TRUE if successful.

See Also

GetLineCount


CKMesh::ActivateAllChannels

Pure Virtual Method Method CKMesh::ActivateAllChannels

virtual void CKMesh::ActivateAllChannels(CKBOOL Active=TRUE)

Sets the active flag for all channels.

Parameters

Input argument Active

Active flag, TRUE is active, FALSE deactivates it.

Remarks

Shows or hides all the channels at once.

See Also

ActivateChannel, IsChannelActive, AddChannel, RemoveChannel,VXCHANNEL_FLAGS


CKMesh::ActivateChannel

Pure Virtual Method Method CKMesh::ActivateChannel

virtual void CKMesh::ActivateChannel(int Index,CKBOOL Active=TRUE)

Sets the active flag of the specified channel.

Parameters

Input argument Index | Channel index.
Input argument Active | Active flag, TRUE activates, FALSE deactivates it.

Remarks

This method sets or removes the VXCHANNEL_ACTIVE flags for this channel. A deactivated channel is not drawn.

See Also

ActivateAllChannels, IsChannelActive, AddChannel, RemoveChannel


CKMesh::AddChannel

Pure Virtual Method Method CKMesh::AddChannel

virtual int CKMesh::AddChannel(CKMaterial *Mat,CKBOOL CopySrcUv=TRUE)

Adds a channel to the mesh.

Parameters

Input argument Mat | A pointer to the material used by the channel.
Input argument CopySrcUv | TRUE if default texture coordinates have to be copied to this channel, FALSE otherwise.

Returns

Index of the newly created channel.

See Also

RemoveChannel, GetChannelCount


CKMesh::AddChannelExt

Pure Virtual Method Method CKMesh::AddChannelExt

virtual int CKMesh::AddChannelExt(CKMaterial *Mat,CKBOOL CopySrcUv=TRUE, ChannelType ChanType=CHANNELTYPE_MATERIAL )

Adds a channel to the mesh and specify its type.

Parameters

Input argument Mat | A pointer to the material used by the channel.
Input argument CopySrcUv | TRUE if default texture coordinates have to be copied to this channel, FALSE otherwise.

Returns

Index of the newly created channel.

See Also

RemoveChannel, GetChannelCount, GetChannelType, SetChannelType


CKMesh::GetChannelByMaterial

Pure Virtual Method Method CKMesh::GetChannelByMaterial

virtual int CKMesh::GetChannelByMaterial(CKMaterial *mat)

Returns the index of a channel given its material.

Parameters

Mat: A pointer to material, channel corresponding to this material will be returned.

Returns

Channel index, -1 if not found

See Also

AddChannel, GetChannelCount


CKMesh::GetChannelCount

Pure Virtual Method Method CKMesh::GetChannelCount

virtual int CKMesh::GetChannelCount()

Returns the number of channels in the mesh.

Returns

Number of additional channels in the mesh.

See Also

AddChannel, RemoveChannel


CKMesh::GetChannelDestBlend

Pure Virtual Method Method CKMesh::GetChannelDestBlend

virtual VXBLEND_MODE CKMesh::GetChannelDestBlend(int Index)

Returns the destination blend mode of a specific channel.

Parameters

Input argument Index

Channel index.

Returns

Destination blending factor.

Remarks

When a mesh with channels is rendered, the color of what is already drawn and the color of this mesh are combined as shown for each pixel :

(destination blend factor) * (what is already drawn) (source blend factor) * (what is to be drawn).

See Also

GetChannelSourceBlend, SetChannelDestBlend


CKMesh::GetChannelFlags

Pure Virtual Method Method CKMesh::GetChannelFlags

virtual CKDWORD CKMesh::GetChannelFlags(int Index)

Returns the Channel flags of a channel.

Parameters

Input argument Index

Index of the channel

Returns

VXCHANNEL_FLAGS for the given channel .

Remarks

The channel flags contain the activation and lighting flags and also some hint or information set by the render engine. For example is the channel was render along with the default faces in mono pass multi-texturing.

See Also

SetChannelFlags,VXCHANNEL_FLAGS


CKMesh::GetChannelMaterial

Pure Virtual Method Method CKMesh::GetChannelMaterial

virtual CKMaterial* CKMesh::GetChannelMaterial(int Index)

Returns the material of a channel.

Parameters

Input argument Index

Index of the channel.

Returns

A pointer to the CKMaterial which is used by the channel.

See Also

SetChannelMaterial


CKMesh::GetChannelShaderOverride

Pure Virtual Method Method CKMesh::GetChannelShaderOverride

virtual CKMaterialShader* CKMesh::GetChannelShaderOverride(int ChanIndex)

Returns the shader that overrides a channel material (possibly NULL)

Parameters

Input argument ChanIndex

The channel of intersest

Returns

A pointer to the shader that is to override that channel material

See Also

OverrideChannelTechnique


CKMesh::GetChannelSourceBlend

Pure Virtual Method Method CKMesh::GetChannelSourceBlend

virtual VXBLEND_MODE CKMesh::GetChannelSourceBlend(int Index)

Returns the source blend mode of a specific channel.

Parameters

Input argument Index

Channel index.

Returns

Source blending factor.

Remarks

When a mesh with channels is rendered, the color of what is already drawn and the color of this mesh are combined as shown for each pixel :

(destination blend factor) * (what is already drawn) (source blend factor) * (what is to be drawn).

See Also

GetChannelDestBlend, SetChannelSourceBlend


CKMesh::GetChannelType

Pure Virtual Method Method CKMesh::GetChannelType

virtual ChannelType CKMesh::GetChannelType( int ChanIndex )

Retrieves the channel type

Parameters

Input argument ChanIndex

Index of the channel to retrieve the type from.

Returns

The channel type.

See Also

RemoveChannel, GetChannelCount, AddChannelExt, SetChannelType


CKMesh::GetOverridenChannelByMaterial

Pure Virtual Method Method CKMesh::GetOverridenChannelByMaterial

virtual int CKMesh::GetOverridenChannelByMaterial(CKMaterial* Mat, class CKMaterialShader* ShaderOverride)

Returns the index of a channel given its material, and 'shader override'

Parameters

Input argument Mat | A pointer to the material of the channel to be found
Input argument ShaderOverride | A pointer to the shader that override the shader to be found

Returns

Channel index.

See Also

OverrideChannelTechnique


CKMesh::IsChannelActive

Pure Virtual Method Method CKMesh::IsChannelActive

virtual CKBOOL CKMesh::IsChannelActive(int Index)

Returns the active flag of a specific channel.

Parameters

Input argument Index

Channel index.

Returns

TRUE if the specified channel is active, otherwise FALSE.

Remarks

If channel Index parameter is invalid then the method returns FALSE.

See Also

ActivateChannel, ActivateAllChannels, AddChannel, RemoveChannel,VXCHANNEL_FLAGS


CKMesh::IsChannelLit

Pure Virtual Method Method CKMesh::IsChannelLit

virtual CKBOOL CKMesh::IsChannelLit(int Index)

Returns whether a specific channel is to be lit.

Parameters

Input argument Index

Channel index.

Returns

TRUE if the specified channel is lit, otherwise FALSE.

Remarks

This method checks the VXCHANNEL_NOTLIT flags for this channel. If channel Index parameter is invalid then the method returns FALSE.

See Also

LitChannel, AddChannel, RemoveChannel,VXCHANNEL_FLAGS


CKMesh::LitChannel

Pure Virtual Method Method CKMesh::LitChannel

virtual void CKMesh::LitChannel(int Index,CKBOOL Lit=TRUE)

Sets the lighting flag of the specified channel.

Parameters

Input argument Index | Channel index.
Input argument Lit | Lighting flag, TRUE for the channel to be lit, FALSE otherwise.

Remarks

+This method sets or removes the VXCHANNEL_NOTLIT flags for this channel. +A additional channel can be drawn with as a decal ( only the texture color is used) or be lit (influenced by lights) as for the vertices of the mesh.

See Also

IsChannelLit, AddChannel, RemoveChannel,VXCHANNEL_FLAGS


CKMesh::OverrideChannelTechnique

Pure Virtual Method Method CKMesh::OverrideChannelTechnique

virtual void CKMesh::OverrideChannelTechnique(int Index, int AltTechnique, class CKMaterialShader* altShader)

Force a channel to be rendered using a different technique than that of its material shader (if any). if altTechnique is < 0 or if there is no shader, then 'altShader' will replace the material when the channel is rendered. The shader will have access to this channel material parameters, however. This way it is possible to mimic some material property such as alpha test settings, diffuse color etc. in a channel with a shader. (The material will usually be that of the underlying mesh). At least, if altShader is NULL, then no override will take place, and the channel will be rendered as usual.

Parameters

Input argument Index | Channel index.
Input argument AltTechnique | The replacement technique. AltShader: The replacement shader, if replacement technique couldn't operate (no shader on channel material, or < 0)

See Also

GetOverridenChannelByMaterial


CKMesh::RemoveChannel

Pure Virtual Method Method CKMesh::RemoveChannel

virtual void CKMesh::RemoveChannel(CKMaterial *Mat)
virtual void CKMesh::RemoveChannel(int Index)
virtual void CKMesh::RemoveChannel(class CKMaterialShader* ShaderOverride)

Removes a channel from the mesh.

Parameters

Input argument Mat | A pointer to material, channel corresponding to this material will be removed.
Input argument Index | Channel index in the mesh.

See Also

AddChannel, GetChannelCount


CKMesh::SetChannelDestBlend

Pure Virtual Method Method CKMesh::SetChannelDestBlend

virtual void CKMesh::SetChannelDestBlend(int Index,VXBLEND_MODE BlendMode)

Sets the destination blend mode of a specific channel.

Parameters

Input argument Index | Channel index.
Input argument BlendMode | A VXBLEND_MODE type.

Returns

Current destination blend mode.

Remarks

When a mesh with channels is rendered, the color of what is already drawn and the color of this mesh are combined as shown for each pixel :

(destination blend) * (what is already drawn)
(source blend) * (what is to be drawn).

See Also

SetChannelSourceBlend, GetChannelDestBlend


CKMesh::SetChannelFaceIndices

Pure Virtual Method Method CKMesh::SetChannelFaceIndices

virtual void CKMesh::SetChannelFaceIndices(int Index,int IndexCount,CKVINDEX* Indices)

Sets the indices for a given channel.

Parameters

Input argument Index | Index of the channel
Input argument IndexCount | Number of face indices being set (should be number of faces * 3).
Input argument Indices | A set of NbFace*3 indices into the vertex array for each face being on which the channel should be applied.

Remarks

If IndexCount is 0 and Indices is NULL , the channel will be applied to all faces. This function takes the place of ChangeFaceChannelMask, SetFaceChannelMask to indicate which on which faces the channel should be applied..

See Also

GetFacesIndices, SetChannelFaceIndicesByMaterials


CKMesh::SetChannelFaceIndicesByMeshMaterials

Pure Virtual Method Method CKMesh::SetChannelFaceIndicesByMeshMaterials

virtual void CKMesh::SetChannelFaceIndicesByMeshMaterials(int ChannelIndex, const int* MaterialIndexArray, int MaterialCount)

Sets the indices for a given channel so that it covers all triangles of the mesh that use a given set of materials. If you plan to reuse the mesh VB as it in the channel, then it may be best to include VXCHANNEL_HINT_USEORIGINALMESHVB in the channel flags. This way the engine will only maintain a list of material instead of a full list of vertex indices, as long as indices, flags and material remain unmodified.

Parameters

Input argument ChannelIndex | Index of the channel
Input argument MaterialIndexArray | An array that contains the indices to which the channel should apply
Input argument MaterialCount | The number of material indices in 'MaterialIndexArray'

See Also

SetChannelFaceIndices


CKMesh::SetChannelFlags

Pure Virtual Method Method CKMesh::SetChannelFlags

virtual void CKMesh::SetChannelFlags(int Index,CKDWORD Flags)

Sets the Channel flags of a channel.

Parameters

Input argument Index | Index of the channel
Input argument Flags | VXCHANNEL_FLAGS to be set for the channel.

Remarks

The channel flags contain the activation and lighting flags and also some hint or information set by the render engine. For example is the channel was render along with the default faces in mono pass multi-texturing.

See Also

GetChannelFlags,VXCHANNEL_FLAGS


CKMesh::SetChannelMaterial

Pure Virtual Method Method CKMesh::SetChannelMaterial

virtual void CKMesh::SetChannelMaterial(int Index,CKMaterial *Mat)

Sets material of a given channel.

Parameters

Input argument Index | Channel index.
Input argument Mat | New CKMaterial which will be assigned to the channel.

See Also

GetChannelByMaterial


CKMesh::SetChannelSourceBlend

Pure Virtual Method Method CKMesh::SetChannelSourceBlend

virtual void CKMesh::SetChannelSourceBlend(int Index,VXBLEND_MODE BlendMode)

Sets the source blend mode of a specific channel.

Parameters

Input argument Index | Channel index.
Input argument BlendMode | A VXBLEND_MODE type.

Remarks

When a mesh with channels is rendered, the color of what is already drawn and the color of this mesh are combined as shown for each pixel :

(destination blend) * (what is already drawn)
(source blend) * (what is to be drawn).

See Also

SetChannelDestBlend, GetChannelSourceBlend


CKMesh::SetChannelType

Pure Virtual Method Method CKMesh::SetChannelType

virtual void CKMesh::SetChannelType( int ChanIndex, ChannelType ChanType, BOOL ForceReallocation=FALSE )

Set the channel type

Parameters

Input argument ChanIndex | Index of the channel to modify.
Input argument ChanType | New channel type.

Returns

The channel type.

See Also

RemoveChannel, GetChannelCount, AddChannelExt, GetChannelType


CKMesh::GetMaterial

Pure Virtual Method Method CKMesh::GetMaterial

virtual CKMaterial* CKMesh::GetMaterial(int index)

Returns the material given its index.

Parameters

Input argument index

Index at which material is to be obtained.

Returns

Pointer to material.

See Also

GetMaterialCount

GetMaterialFaces


CKMesh::GetMaterialCount

Pure Virtual Method Method CKMesh::GetMaterialCount

virtual int CKMesh::GetMaterialCount()

Returns the number of different materials.

Returns

Number of materials used in the mesh.

Remarks

The function only returns the number of materials used by the faces of the mesh, not the channels.

See Also

GetMaterial


CKMesh::GetMaterialFaces

Pure Virtual Method Method CKMesh::GetMaterialFaces

virtual const CKDWORD* CKMesh::GetMaterialFaces(int index, int& count)

Returns an array of the faces on which a material is applied

Parameters

Input argument index | Index at which material is to be obtained.
Input argument count | Will be filled with the number of faces in the returned array

Returns

Array of face indices, NULL if the material index is invalid

See Also

GetMaterialCount

GetMaterial


CKMesh::ReplaceMaterial

Pure Virtual Method Method CKMesh::ReplaceMaterial

virtual void CKMesh::ReplaceMaterial(CKMaterial *oldMat, CKMaterial *newMat,CKBOOL Merge = FALSE)

Replaces any reference to a material by a new.

Parameters

Input argument oldMat | A pointer to the old material to be replaced.
Input argument newMat | A pointer to the new material to be set.

Remarks

Using this method is recommended to set a new material to some faces which previously used oldMat. The replace operation does not force the render engine to re-sort its per-material runtime specific structures so it's much faster than using SetFaceMaterial. If the mesh is already having faces using newMat, replacing oldMat by newMat could cause internal rendering structures to be rebuild if decided to merge all the faces sharing the same material.

See Also

GetFaceMaterial, SetFaceMaterial


CKMesh::CreatePM

Pure Virtual Method Method CKMesh::CreatePM

virtual CKERROR CKMesh::CreatePM()

Creates the progressive mesh data for the mesh.

Returns

CK_OK if it successful or an error code otherwise.

Remarks

Progressive mesh allow you to generates level of detail meshes seamlessly and continuously, by variating the number of vertices to be rendered, rendering less when the mesh is far away.

See Also

SetVerticesRendered, DestroyPM


CKMesh::DestroyPM

Pure Virtual Method Method CKMesh::DestroyPM

virtual void CKMesh::DestroyPM()

Destroy the progressive mesh data for the mesh.

See Also

CreatePM


CKMesh::EnablePMGeoMorph

Pure Virtual Method Method CKMesh::EnablePMGeoMorph

virtual void CKMesh::EnablePMGeoMorph(CKBOOL enable)

Sets the progressive mesh to proceed geomorphic transition when changing level.

See Also

IsPMGeoMorphEnabled


CKMesh::GetPMGeoMorphStep

Pure Virtual Method Method CKMesh::GetPMGeoMorphStep

virtual int CKMesh::GetPMGeoMorphStep()

Gets the geomorph steps.

Returns

steps for the geomorphic progressive decimation.

See Also

SetPMGeoMorphStep


CKMesh::GetVerticesRendered

Pure Virtual Method Method CKMesh::GetVerticesRendered

virtual int CKMesh::GetVerticesRendered()

Gets the number of vertices actually rendered.

Returns

Number of vertices that will actually be rendered.

Remarks

This function works only if the mesh has been transformed to a progressive mesh, using CreatePM()

See Also

SetVerticesRendered, CreatePM


CKMesh::IsPM

Pure Virtual Method Method CKMesh::IsPM

virtual CKBOOL CKMesh::IsPM()

Returns if the mesh is progressive.

Returns

TRUE if the mesh is a progressive mesh.

See Also

CreatePM, DestroyPM


CKMesh::IsPMGeoMorphEnabled

Pure Virtual Method Method CKMesh::IsPMGeoMorphEnabled

virtual CKBOOL CKMesh::IsPMGeoMorphEnabled()

Returns if the progressive mesh enable geomorphic transition.

Returns

TRUE if the progressive mesh enable geomorphic transition.

See Also

EnablePMGeoMorph


CKMesh::SetPMGeoMorphStep

Pure Virtual Method Method CKMesh::SetPMGeoMorphStep

virtual void CKMesh::SetPMGeoMorphStep(int gs)

Sets the geomorph steps.

Parameters

Input argument gs

steps for the geomorphic progressive decimation.

Remarks

0 means the mesh will morph between level by dichotomy : nv <-> nv/2, then nv/2 <-> nv/4, etc. Values greater than 0 means a linear degradation of the mesh step by step : nv <-> nv - gs, then nv - gs <-> nv - 2*gs, etc.

See Also

EnablePMGeoMorph


CKMesh::SetVerticesRendered

Pure Virtual Method Method CKMesh::SetVerticesRendered

virtual void CKMesh::SetVerticesRendered(int count)

Sets the number of vertices to be rendered.

Parameters

Input argument count

Number of vertices that will actually be rendered.

Remarks

This function works only if the mesh has been transformed to a progressive mesh, using CreatePM()

See Also

GetVerticesRendered, CreatePM


CKMesh::BuildFaceNormals

Pure Virtual Method Method CKMesh::BuildFaceNormals

virtual void CKMesh::BuildFaceNormals()

Calculates face normals of all faces in the mesh.

See Also

BuildNormals


CKMesh::BuildNormals

Pure Virtual Method Method CKMesh::BuildNormals

virtual void CKMesh::BuildNormals()

Calculates vertex normals of all vertices of the mesh.

See Also

BuildFaceNormals


CKMesh::Clean

Pure Virtual Method Method CKMesh::Clean

virtual void CKMesh::Clean(CKBOOL KeepVertices = FALSE)

Removes all primitives(faces,lines,material channels)

Parameters

Input argument KeepVertices

A flag specifying whether to retain vertices or not.

Remarks

This removes all data related to mesh, such as faces, lines and material channels. The vertices can be kept in order to reconstruct the mesh.


CKMesh::Consolidate

Pure Virtual Method Method CKMesh::Consolidate

virtual void CKMesh::Consolidate()

Removes the degenerate faces and the isolated vertices of a mesh.

Remarks

Removes degenerates faces ( lines, points or 0 normal faces) and unused vertices.


CKMesh::DissociateAllFaces

Pure Virtual Method Method CKMesh::DissociateAllFaces

virtual void CKMesh::DissociateAllFaces()

Dissociates all faces.

Remarks

This method duplicates vertices so that faces do not share any vertices any more. The number of vertices then becomes 3 times the number of faces in the mesh. Using this method in conjunction with 'MergeIdenticalVertices' allows to easily apply a non continuous mapping on the mesh, by operating on each independent triangle corners. The following features are included in the dissociation :

 Blend shapes
 Additionnal channels (extra uvs)
 Additionnal material channels
 Skins thazt refer to that mesh
    Notes :
 Progressive meshs are not supported : the progressive mesh datas will be removed by this operation.
 Do not use this method on meshs that have a morph controller (prefer the usage of blend shapes), their conversion is not
      handled and they will be made inoperant because of a mismatch in vertices count.

See Also

GetFaceVertexIndices, MergeIdenticalVertices


CKMesh::InverseWinding

Pure Virtual Method Method CKMesh::InverseWinding

virtual void CKMesh::InverseWinding()

Inverse the faces by changing the winding order of the vertices.

Remarks

This method also updates the normals of the faces and vertices.

See Also

GetFacesIndices,GetFaceNormal,GetFaceVertexIndex


CKMesh::LoadVertices

Pure Virtual Method Method CKMesh::LoadVertices

virtual void CKMesh::LoadVertices(CKStateChunk *chunk)

Restores the vertices from a chunk.

Parameters

Input argument chunk

a CKStateChunk holding mesh data.

Remarks

This method restores the vertex data (positions,normals and texture coordinates,...)

See Also

BuildNormals


CKMesh::MergeIdenticalVertices

Pure Virtual Method Method CKMesh::MergeIdenticalVertices

virtual void CKMesh::MergeIdenticalVertices()

Merge Identical Vertices

Remarks

This method merge all vertices that have the same attributes (position, normal, vertex color, uvs, blend weights) . The following features are included in the merge :

 Blend shapes
 Additionnal channels (extra uvs)
 Additionnal material channels
 Skins that refer to that mesh
    Note :
 Progressive meshs are not supported : the progressive mesh datas will be removed by this operation.
 Do not use this method on meshs that have a morph controller (prefer the usage of blend shapes), their conversion is not
      handled and they will be made inoperant because of a mismatch in vertices count.
    This is the reciprocal operation of 'DissociateAllFaces'

See Also

GetFaceVertexIndices, DissociateAllFaces


CKMesh::RotateVertices

Pure Virtual Method Method CKMesh::RotateVertices

virtual void CKMesh::RotateVertices(VxVector *Vector, float Angle)

Rotates all vertices of the mesh by given angle.

Parameters

Input argument Vector | Axis of rotation.
Input argument Angle | Angle by which the vertices have to be rotated.

See Also

ScaleVertices,TranslateVertices


CKMesh::ScaleVertices

Pure Virtual Method Method CKMesh::ScaleVertices

virtual void CKMesh::ScaleVertices(VxVector *Vector,VxVector *Pivot = NULL)
virtual void CKMesh::ScaleVertices(float X,float Y,float Z,VxVector *Pivot = NULL)

Scales all vertices of the mesh by given vector.

Parameters

Input argument Vector | A pointer to a vector by which mesh vertices should be scaled.
Input argument X | Scaling factor for X direction.
Input argument Y | Scaling factor for Y direction.
Input argument Z | Scaling factor for Z direction.
Pivot | A pointer to a vector giving the pivot of the scale operation.

Remarks

+Scaling ratios in x,y,z directions can be controlled by Vector or by independent X, Y, Z factors. +Scaling of vertices is done with respect to the pivot point provided.

See Also

TranslateVertices,RotateVertices


CKMesh::TranslateVertices

Pure Virtual Method Method CKMesh::TranslateVertices

virtual void CKMesh::TranslateVertices(VxVector *Vector)

Translates all vertices of the mesh by given vector

Parameters

Input argument Vector

A pointer to vector by which mesh vertices should be translated.

See Also

ScaleVertices,RotateVertices


CKMesh::UnOptimize

Pure Virtual Method Method CKMesh::UnOptimize

virtual void CKMesh::UnOptimize()

Marks the mesh as to be re-optimized.

Remarks

+Before rendering a mesh is optimized according to its material and face organization to minimize render state changes. +This method is automatically called by the framework when necessary.


CKMesh::GetBaryCenter

Pure Virtual Method Method CKMesh::GetBaryCenter

virtual void CKMesh::GetBaryCenter(VxVector *Vector)

Returns the barycenter of the mesh.

Returns

Barycenter of the mesh.

Remarks

The barycenter of the mesh is the average of all the vertices positions.

See Also

GetLocalBox, GetRadius


CKMesh::GetLocalBox

Pure Virtual Method Method CKMesh::GetLocalBox

virtual const VxBbox& CKMesh::GetLocalBox()

Returns the bounding box of the mesh.

Returns

Returns the bounding box of the mesh in its local frame.

See Also

GetRadius, GetBaryCenter,VxBbox


CKMesh::GetRadius

Pure Virtual Method Method CKMesh::GetRadius

virtual float CKMesh::GetRadius()

Returns the radius of the mesh.

Returns

Radius of mesh.

See Also

GetLocalBox, GetBaryCenter


CKMesh::AddPostRenderCallBack

Pure Virtual Method Method CKMesh::AddPostRenderCallBack

virtual CKBOOL CKMesh::AddPostRenderCallBack(CK_MESHRENDERCALLBACK Function,void *Argument,BOOL Temporary = FALSE)

Adds a function to be called after rendering the mesh.

Parameters

Argument | that will be passed to the function.
Temporary | A Boolean to indicate if the callback should be called only once and then removed

Returns

TRUE if successful, FALSE otherwise.

See Also

RemovePostRenderCallBack, SetRenderCallBack


CKMesh::AddPreRenderCallBack

Pure Virtual Method Method CKMesh::AddPreRenderCallBack

virtual CKBOOL CKMesh::AddPreRenderCallBack(CK_MESHRENDERCALLBACK Function,void *Argument,BOOL Temporary = FALSE)

Adds a function to be called before rendering the mesh.

Parameters

Argument | that will be passed to the function.
Temporary | A Boolean to indicate if the callback should be called only once and then removed

Returns

TRUE if successful, FALSE otherwise.

See Also

RemovePreRenderCallBack, SetRenderCallBack


CKMesh::RemoveAllCallbacks

Pure Virtual Method Method CKMesh::RemoveAllCallbacks

virtual void CKMesh::RemoveAllCallbacks()

Removes all the callback functions.

Remarks

All Pre,Postand RenderCallback functions are removed.

See Also

SetRenderCallBack, AddPreRenderCallBack, AddPostRenderCallBack


CKMesh::RemovePostRenderCallBack

Pure Virtual Method Method CKMesh::RemovePostRenderCallBack

virtual CKBOOL CKMesh::RemovePostRenderCallBack(CK_MESHRENDERCALLBACK Function,void *Argument)

Removes a post-render callback function.

Parameters

Argument

of that function (as passed to AddPostRenderCallBack).

Returns

TRUE if successful, FALSE otherwise.

See Also

AddPostRenderCallBack, SetRenderCallBack


CKMesh::RemovePreRenderCallBack

Pure Virtual Method Method CKMesh::RemovePreRenderCallBack

virtual CKBOOL CKMesh::RemovePreRenderCallBack(CK_MESHRENDERCALLBACK Function,void *Argument)

Removes a pre-render callback function.

Parameters

Argument

of that function (as passed to AddPreRenderCallBack).

Returns

TRUE if successful, FALSE otherwise.

See Also

AddPreRenderCallBack, SetRenderCallBack


CKMesh::SetDefaultRenderCallBack

Pure Virtual Method Method CKMesh::SetDefaultRenderCallBack

virtual void CKMesh::SetDefaultRenderCallBack()

Restores the default rendering function.

See Also

SetRenderCallBack


CKMesh::SetRenderCallBack

Pure Virtual Method Method CKMesh::SetRenderCallBack

virtual void CKMesh::SetRenderCallBack(CK_MESHRENDERCALLBACK Function,void *Argument)

Sets the mesh rendering function.

Parameters

Argument

of that function.

Remarks

The given function will replace the default rendering method for the mesh. To restore it use SetDefaultRenderCallBack

See Also

SetDefaultRenderCallBack


CKMesh::GetVertexWeight

Pure Virtual Method Method CKMesh::GetVertexWeight

virtual float CKMesh::GetVertexWeight(int index)

Returns the vertex weight of a given vertex.

Parameters

Input argument index

Position from which vertex weight is to be obtained.

Returns

Vertex weight at given index.

See Also

SetVertexWeightsCount, GetVertexWeightsPtr, SetVertexWeight


CKMesh::GetVertexWeightsCount

Pure Virtual Method Method CKMesh::GetVertexWeightsCount

virtual int CKMesh::GetVertexWeightsCount()

Returns the number of vertex weights.

Returns

Number of vertex weights available.

Remarks

Normally the number of vertex weight is to be the same than the number of vertices.

See Also

SetVertexWeightsCount, GetVertexWeightsPtr, SetVertexWeight


CKMesh::GetVertexWeightsPtr

Pure Virtual Method Method CKMesh::GetVertexWeightsPtr

virtual float* CKMesh::GetVertexWeightsPtr()

Returns a pointer to the list of vertex weights.

Returns

A pointer to an array of float containing each vertex weight or NULL if there are no weights.

See Also

GetVertexWeightsCount, SetVertexWeightsCount, GetVertexWeight, SetVertexWeight


CKMesh::SetVertexWeight

Pure Virtual Method Method CKMesh::SetVertexWeight

virtual void CKMesh::SetVertexWeight(int index,float w)

Sets the vertex weight at a given position.

Parameters

Input argument index | Position from which vertex weight is to be set.
Input argument w | Vertex Weight value.

See Also

SetVertexWeightsCount, GetVertexWeightsPtr, GetVertexWeight


CKMesh::SetVertexWeightsCount

Pure Virtual Method Method CKMesh::SetVertexWeightsCount

virtual void CKMesh::SetVertexWeightsCount(int count)

Sets the number of vertex weights.

Parameters

Input argument count

Number of vertex weights required.

See Also

GetVertexWeightsCount, GetVertexWeightsPtr, GetVertexWeight, SetVertexWeight


CKMesh::GetBlendShapeCount

Pure Virtual Method Method CKMesh::GetBlendShapeCount

virtual CKDWORD CKMesh::GetBlendShapeCount() const

Retrieve the number of blend shapes for this mesh

Returns

The number of blend shapes


CKMesh::GetBlendShapeIndexFromName

Pure Virtual Method Method CKMesh::GetBlendShapeIndexFromName

virtual int CKMesh::GetBlendShapeIndexFromName(const XString& name) const

Retrieve a blend shape index from its name

Returns

The blend shape index or -1 if not found.


CKMesh::GetBlendShapeNameFromIndex

Pure Virtual Method Method CKMesh::GetBlendShapeNameFromIndex

virtual const XString& CKMesh::GetBlendShapeNameFromIndex(int bsIndex) const

Retrieve the name of a blend shape from its index.

Returns

The blend shape name, or an empty string if the index is invalid


CKMesh::Cast

Static Object Method CKMesh::Cast

static CKMesh* CKMesh::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKMesh::CKMesh

Method CKMesh::CKMesh

CKMesh::CKMesh(CKContext *Context,CKSTRING name=NULL)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKMesh::GetBlendShapeSet

Pure Virtual Method Method CKMesh::GetBlendShapeSet

virtual void CKMesh::GetBlendShapeSet(CKBlendShapeSet& bss) const

Get a copy of the blend shapes description for this mesh

Parameters

Input argument bss

A CKBlendShapeSet object that will be filled with the description of this mesh blend shapes


CKMesh::SetBlendShapeSet

Pure Virtual Method Method CKMesh::SetBlendShapeSet

virtual void CKMesh::SetBlendShapeSet(const CKBlendShapeSet& bss)

Build the blend shapes for this mesh

Parameters

Input argument bss

A CKBlendShapeSet object that gives the description of blend shapes. A copy of these datas will be made, no reference will be kept on that


CKMesh::Render

Pure Virtual Method Method CKMesh::Render

virtual CKERROR CKMesh::Render(CKRenderContext *Dev,CK3dEntity *Mov)

Renders the mesh.

Parameters

Input argument Dev | A CKrenderContext on which the mesh should be rendered.
Input argument Mov | A optional 3dEntity for position, scaling, rotation... information.

Returns

CK_OK if successful, an error code otherwise.

Remarks

+This method works as following: first, it calls pre-render callbacks, then it renders the mesh or it calls a user defined procedure and last, it calls post-render callbacks. +The current world transformation matrix (See CKRenderContext::SetWorldTransformationMatrix) is used to transform the vertices.

See Also

CKRenderContext::Render;CK3dEntity::Render


CKMesh::GetFlags

Pure Virtual Method Method CKMesh::GetFlags

virtual CKDWORD CKMesh::GetFlags()

Returns the Mesh flags.

Returns

Mesh flags (VXMESH_FLAGS).

Remarks

Most of the flags can be set or asked with the appropriate method of CKMesh, see the VXMESH_FLAGS documentation.

See Also

SetFlags,VXMESH_FLAGS


CKMesh::GetLitMode

Pure Virtual Method Method CKMesh::GetLitMode

virtual VXMESH_LITMODE CKMesh::GetLitMode()

Returns the mesh Lighting mode.

Returns

Lighting mode of the mesh.

See Also

SetLitMode, VXMESH_LITMODE


CKMesh::GetWrapMode

Pure Virtual Method Method CKMesh::GetWrapMode

virtual VXTEXTURE_WRAPMODE CKMesh::GetWrapMode()

Returns the mesh texture wrapping mode.

Returns

Texture wrapping mode of the mesh.

See Also

SetWrapMode,VXTEXTURE_WRAPMODE


CKMesh::IsTransparent

Pure Virtual Method Method CKMesh::IsTransparent

virtual CKBOOL CKMesh::IsTransparent()

Checks whether the mesh is considered transparent

Returns

Returns TRUE if the mesh uses a transparent material, FALSE otherwise.

Remarks

The method returns TRUE if the mesh uses a transparent material or its transparency is forced using SetTransparent.

See Also

SetTransparent,CKMaterial


CKMesh::SetFlags

Pure Virtual Method Method CKMesh::SetFlags

virtual void CKMesh::SetFlags(CKDWORD Flags)

Sets the Mesh flags.

Parameters

Input argument Flags

Mesh flags to be set (VXMESH_FLAGS).

Remarks

Most of the flags can be set or asked with the appropriate method of CKMesh, see the VXMESH_FLAGS documentation.

See Also

GetFlags,VXMESH_FLAGS


CKMesh::SetLitMode

Pure Virtual Method Method CKMesh::SetLitMode

virtual void CKMesh::SetLitMode(VXMESH_LITMODE Mode)

Sets the mesh lighting mode.

Parameters

Input argument Mode

Lighting mode of the mesh.

Remarks

+A mesh can lit using its normals or the colors of each vertex can be given. +This method sets or removes the VXMESH_PRELITMODE flag.

See Also

GetLitMode,,GetFlags,VXMESH_LITMODE


CKMesh::SetTransparent

Pure Virtual Method Method CKMesh::SetTransparent

virtual void CKMesh::SetTransparent(CKBOOL Transparency)

Forces the mesh to be considered transparent.

Parameters

Input argument Transparency

TRUE to force or FALSE otherwise

Remarks

+A mesh that does not contain any transparent materials can be forced to be considered transparent by using this method. This way the entities that use this mesh will be rendered after the opaque objects for correct results. +This method sets or removes the VXMESH_FORCETRANSPARENCY flag.

See Also

IsTransparent,GetFlags


CKMesh::SetWrapMode

Pure Virtual Method Method CKMesh::SetWrapMode

virtual void CKMesh::SetWrapMode(VXTEXTURE_WRAPMODE Mode)

Sets the mesh texture wrapping mode.

Parameters

Input argument Mode

wrapping mode to be set.

Remarks

This methods sets or removes the VXMESH_WRAPU and VXMESH_WRAPV

See Also

GetWrapMode,,GetFlags,VXTEXTURE_WRAPMODE


CKPatchMesh

Class CKPatchMesh

Representation of the geometry of a 3Dobject using bezier patches.

CKObject

CKSceneObject

CKBeObject

CKMesh
Show brief derivation trees

CKPatchMesh

CKObject

CKSceneObject

CKBeObject

CKMesh
Show full derivation trees

CKPatchMesh

Remarks

The CKPatchMesh Class derives from the CKMesh class. It is made up of array of bezier patches (triangular or quadrangular) which can be tesselated given an iteration count to construct a standard mesh made up of triangles. In the current implementation only the uniform tesselation is supported. It generates a list of strip primitives per material for maximum performances.

The advantages of a patch mesh is that it use less memory on disk.

Its class id is CKCID_PATCHMESH

Groups

Control Points | Edges | Patches | Patches texture mapping | Texture coordinates | Mesh building

Control Points
Virtual Method Method GetVec | Gets a edge control point position.
Virtual Method Method GetVecCount | Gets vecs (edge and interior control points) count of the mesh.
Virtual Method Method GetVecs | Gets all edge and interiors control points
Virtual Method Method GetVert | Gets a corner control point position.
Virtual Method Method GetVertCount | Gets verts (corner control points) count of the mesh.
Virtual Method Method GetVerts | Gets all corner control points
Virtual Method Method SetVec | Sets a edge control point position.
Virtual Method Method SetVert | Sets a corner control point position.
Virtual Method Method SetVertVecCount | Sets verts and vecs counts of the patchmesh.
Edges
Virtual Method Method GetEdge | Gets a given edge data.
Virtual Method Method GetEdgeCount | Returns the number of edges.
Virtual Method Method GetEdges | Gets a pointer to the list of edges.
Virtual Method Method SetEdge | Sets a given edge data.
Virtual Method Method SetEdgeCount | Sets the number of edges.
Patches
Virtual Method Method GetPatch | Gets the description of a given patch.
Virtual Method Method GetPatchCount | Gets the number of patches.
Virtual Method Method GetPatches | Gets a pointer to the list of patches.
Virtual Method Method GetPatchMaterial | Gets the material used on a given patch.
Virtual Method Method GetPatchSM | Gets the smoothing group of a patch.
Virtual Method Method SetPatch | Sets the description of a given patch.
Virtual Method Method SetPatchCount | Sets the number of patches.
Virtual Method Method SetPatchMaterial | Sets the material used for a given patch.
Virtual Method Method SetPatchSM | Sets the smoothing group for the patch.
Patches texture mapping
Virtual Method Method GetTVPatch | Gets the mapping of a given patch.
Virtual Method Method GetTVPatchCount | Gets the number of texture patches
Virtual Method Method GetTVPatches | Gets a pointer to the list of texture patches.
Virtual Method Method GetTVs | Gets a pointer to the list of texture coordinates.
Virtual Method Method SetTVPatch | Sets the mapping of a given patch.
Virtual Method Method SetTVPatchCount | Sets the number of texture patches
Texture coordinates
Virtual Method Method GetTV | Gets the texture coordinate values.
Virtual Method Method GetTVCount | Returns the number of the texture coordinates for a given channel.
Virtual Method Method SetTV | Sets the texture coordinate values.
Virtual Method Method SetTVCount | Sets the number of the texture coordinates for a given channel.
Mesh building
Virtual Method Method BuildRenderMesh | Builds the base mesh for rendering.

See Also

Using Meshes,CK3dEntity,CKMesh,CKPatch


CKPatchMesh::GetVec

Virtual Method Method CKPatchMesh::GetVec

virtual void CKPatchMesh::GetVec(int index,VxVector* cp) CK_PURE

Gets a edge control point position.

Parameters

Input argument index | Index of the vec whose position is to be get.
Input argument cp | Position to be filled.

See Also

SetVec, GetVecs,GetVecCount


CKPatchMesh::GetVecCount

Virtual Method Method CKPatchMesh::GetVecCount

virtual int CKPatchMesh::GetVecCount() CK_PURE

Gets vecs (edge and interior control points) count of the mesh.

Returns

Number of verts in the patchmesh.

See Also

CKPatch,GetVecCount,SetVert,GetVert,SetVec,GetVec


CKPatchMesh::GetVecs

Virtual Method Method CKPatchMesh::GetVecs

virtual VxVector* CKPatchMesh::GetVecs() CK_PURE

Gets all edge and interiors control points

Returns

A pointer to the list of vecs (edge and interior control points).

See Also

SetVec,GetVec,GetVecCount


CKPatchMesh::GetVert

Virtual Method Method CKPatchMesh::GetVert

virtual void CKPatchMesh::GetVert(int index,VxVector* cp) CK_PURE

Gets a corner control point position.

Parameters

Input argument index | Index of the vert whose position is to be get.
Input argument cp | Position to be filled.

See Also

SetVert, GetVerts,GetVertCount


CKPatchMesh::GetVertCount

Virtual Method Method CKPatchMesh::GetVertCount

virtual int CKPatchMesh::GetVertCount() CK_PURE

Gets verts (corner control points) count of the mesh.

Returns

Number of verts in the patchmesh.

See Also

CKPatch,GetVecCount,SetVert,GetVert,SetVec,GetVec


CKPatchMesh::GetVerts

Virtual Method Method CKPatchMesh::GetVerts

virtual VxVector* CKPatchMesh::GetVerts() CK_PURE

Gets all corner control points

Returns

A pointer to the list of verts (corner control points).

See Also

SetVert,GetVert,GetVertCount


CKPatchMesh::SetVec

Virtual Method Method CKPatchMesh::SetVec

virtual void CKPatchMesh::SetVec(int index,VxVector* cp) CK_PURE

Sets a edge control point position.

Parameters

Input argument index | Index of the vec whose position is to be set.
Input argument cp | Position.

See Also

SetVec, GetVecs,GetVecCount


CKPatchMesh::SetVert

Virtual Method Method CKPatchMesh::SetVert

virtual void CKPatchMesh::SetVert(int index,VxVector* cp) CK_PURE

Sets a corner control point position.

Parameters

Input argument index | Index of the vert whose position is to be set.
Input argument cp | Position.

See Also

GetVert, GetVerts,GetVertCount


CKPatchMesh::SetVertVecCount

Virtual Method Method CKPatchMesh::SetVertVecCount

virtual void CKPatchMesh::SetVertVecCount(int VertCount,int VecCount) CK_PURE

Sets verts and vecs counts of the patchmesh.

Parameters

Input argument VertCount | Number of verts (corner control points) to be set.
Input argument VecCount | Number of vects (edge and interior control points) to be set.

Remarks

See CKPatch for more details on the difference between verts and vecs.

See Also

CKPatch,GetVertCount,SetVert,GetVert,SetVec,GetVec


CKPatchMesh::GetEdge

Virtual Method Method CKPatchMesh::GetEdge

virtual void CKPatchMesh::GetEdge(int index,CKPatchEdge* edge) CK_PURE

Gets a given edge data.

Parameters

Input argument index | Index of the edge to be get.
Input argument edge | A pointer to a CKPatchEdge structure that will be filled with the edge data.

See Also

SetEdgeCount,GetEdgeCount,SetEdge,GetEdges,CKPatchEdge


CKPatchMesh::GetEdgeCount

Virtual Method Method CKPatchMesh::GetEdgeCount

virtual int CKPatchMesh::GetEdgeCount() CK_PURE

Returns the number of edges.

Returns

Number of edges.

See Also

SetEdgeCount,SetEdge,GetEdge,GetEdges


CKPatchMesh::GetEdges

Virtual Method Method CKPatchMesh::GetEdges

virtual CKPatchEdge* CKPatchMesh::GetEdges() CK_PURE

Gets a pointer to the list of edges.

See Also

SetEdgeCount,GetEdgeCount,SetEdge,GetEdge,CKPatchEdge


CKPatchMesh::SetEdge

Virtual Method Method CKPatchMesh::SetEdge

virtual void CKPatchMesh::SetEdge(int index,CKPatchEdge* edge) CK_PURE

Sets a given edge data.

Parameters

Input argument index | Index of the edge to be set.
Input argument edge | A pointer to a CKPatchEdge structure containing the edge data.

See Also

SetEdgeCount,GetEdgeCount,GetEdge,GetEdges,CKPatchEdge


CKPatchMesh::SetEdgeCount

Virtual Method Method CKPatchMesh::SetEdgeCount

virtual void CKPatchMesh::SetEdgeCount(int count) CK_PURE

Sets the number of edges.

Parameters

Input argument count

Number of edges to be set.

See Also

GetEdgeCount,SetEdge,GetEdge,GetEdges


CKPatchMesh::GetPatch

Virtual Method Method CKPatchMesh::GetPatch

virtual void CKPatchMesh::GetPatch(int index,CKPatch* p) CK_PURE

Gets the description of a given patch.

Parameters

Input argument index | Index of the patch to be set.
Input argument p | A pointer to a CKPatch structure to be filled with the description of the patch.

See Also

CKPatch,SetPatchCount,SetPatch,GetPatches,SetPatchSM,SetPatchMaterial


CKPatchMesh::GetPatchCount

Virtual Method Method CKPatchMesh::GetPatchCount

virtual int CKPatchMesh::GetPatchCount() CK_PURE

Gets the number of patches.

Returns

Number of patches.

See Also

SetPatchCount,SetPatch,GetPatch,GetPatches


CKPatchMesh::GetPatches

Virtual Method Method CKPatchMesh::GetPatches

virtual CKPatch* CKPatchMesh::GetPatches() CK_PURE

Gets a pointer to the list of patches.

See Also

CKPatch,SetPatchCount,SetPatch,GetPatch


CKPatchMesh::GetPatchMaterial

Virtual Method Method CKPatchMesh::GetPatchMaterial

virtual CKMaterial* CKPatchMesh::GetPatchMaterial(int index) CK_PURE

Gets the material used on a given patch.

Parameters

Index: Index of patch whose material is to be obtained.

Returns

Pointer to the material.

See Also

SetPatchMaterial,CKPatch


CKPatchMesh::GetPatchSM

Virtual Method Method CKPatchMesh::GetPatchSM

virtual CKDWORD CKPatchMesh::GetPatchSM(int index) CK_PURE

Gets the smoothing group of a patch.

Parameters

Index: Index of patch whose smoothing group is to be obtained.

Returns

Smoothing group of the patch.

Remarks

The smoothing group is a DWORD mask, if the binary AND of the smoothing group value of two adjacent patches is not 0 then they are smoothed together otherwise there is a sharp edge between the two patches. The default value of a patch smoothing group is 0xFFFFFFFF which means all patches are smoothed together.

See Also

SetPatchSM,SetPatch,CKPatch


CKPatchMesh::SetPatch

Virtual Method Method CKPatchMesh::SetPatch

virtual void CKPatchMesh::SetPatch(int index,CKPatch* p) CK_PURE

Sets the description of a given patch.

Parameters

Input argument index | Index of the patch to be set.
Input argument p | A pointer to a CKPatch structure containing the description of the patch.

See Also

CKPatch,SetPatchCount,GetPatch,GetPatches,SetPatchSM,SetPatchMaterial


CKPatchMesh::SetPatchCount

Virtual Method Method CKPatchMesh::SetPatchCount

virtual void CKPatchMesh::SetPatchCount(int count) CK_PURE

Sets the number of patches.

Parameters

Input argument count

Number of patches to be set for the patchmesh.

See Also

GetPatchCount,SetPatch,GetPatch,GetPatches


CKPatchMesh::SetPatchMaterial

Virtual Method Method CKPatchMesh::SetPatchMaterial

virtual void CKPatchMesh::SetPatchMaterial(int index,CKMaterial* mat) CK_PURE

Sets the material used for a given patch.

Parameters

Input argument index | Index of patch whose material is to be obtained.
Input argument mat | A Pointer to the material to use for this patch.

See Also

GetPatchMaterial,CKPatch


CKPatchMesh::SetPatchSM

Virtual Method Method CKPatchMesh::SetPatchSM

virtual void CKPatchMesh::SetPatchSM(int index,CKDWORD smoothing) CK_PURE

Sets the smoothing group for the patch.

Parameters

Input argument index | Index of patch whose smoothing group is to be set.
Input argument smoothing | Smoothing group of the patch to be set.

Remarks

The smoothing group is a DWORD mask, if the binary AND of the smoothing group value of two adjacent patches is not 0 then they are smoothed together otherwise there is a sharp edge between the two patches. The default value of a patch smoothing group is 0xFFFFFFFF which means all patches are smoothed together.

See Also

GetPatchSM,SetPatch,CKPatch


CKPatchMesh::GetTVPatch

Virtual Method Method CKPatchMesh::GetTVPatch

virtual void CKPatchMesh::GetTVPatch(int index,CKTVPatch* tvpatch,int Channel=-1) CK_PURE

Gets the mapping of a given patch.

Parameters

Input argument index | Index of the patch which mapping should be set.
Input argument tvpatch | A pointer to a CKTVPatch structure that will be filled with the indices of the texture coordinates of the corner points of the patch.
Input argument Channel | Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

See Also

SetTVPatch, GetTVPatches,GetTVPatchCount,SetTVPatchCount,SetTVCount


CKPatchMesh::GetTVPatchCount

Virtual Method Method CKPatchMesh::GetTVPatchCount

virtual int CKPatchMesh::GetTVPatchCount(int Channel=-1) CK_PURE

Gets the number of texture patches

Parameters

Input argument Channel

Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

Remarks

The number of texture patches can be 0 (no texturing ) otherwise it must be equal to the number of patches.

See Also

SetPatchCount,SetTVPatchCount


CKPatchMesh::GetTVPatches

Virtual Method Method CKPatchMesh::GetTVPatches

virtual CKTVPatch* CKPatchMesh::GetTVPatches(int Channel=-1) CK_PURE

Gets a pointer to the list of texture patches.

Parameters

Input argument Channel

Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

See Also

SetTVPatch, GetTVPatch,GetTVPatchCount,SetTVPatchCount,SetTVCount


CKPatchMesh::GetTVs

Virtual Method Method CKPatchMesh::GetTVs

virtual VxUV* CKPatchMesh::GetTVs(int Channel=-1) CK_PURE

Gets a pointer to the list of texture coordinates.

Parameters

Input argument Channel

Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

See Also

GetTV, SetTV,GetTVCount,GetTVPatchCount


CKPatchMesh::SetTVPatch

Virtual Method Method CKPatchMesh::SetTVPatch

virtual void CKPatchMesh::SetTVPatch(int index,CKTVPatch* tvpatch,int Channel=-1) CK_PURE

Sets the mapping of a given patch.

Parameters

Input argument index | Index of the patch which mapping should be set.
Input argument tvpatch | A pointer to a CKTVPatch structure that contains the indices of the texture coordinates of the corner points of the patch.
Input argument Channel | Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

See Also

GetTVPatch, GetTVPatches,GetTVPatchCount,SetTVPatchCount,SetTVCount


CKPatchMesh::SetTVPatchCount

Virtual Method Method CKPatchMesh::SetTVPatchCount

virtual void CKPatchMesh::SetTVPatchCount(int count,int Channel=-1) CK_PURE

Sets the number of texture patches

Parameters

Input argument count | Number of texture patches to be set.
Input argument Channel | Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

Remarks

The number of texture patches can be 0 (no texturing ) otherwise it must be equal to the number of patches.

See Also

SetPatchCount,GetTVPatchCount


CKPatchMesh::GetTV

Virtual Method Method CKPatchMesh::GetTV

virtual void CKPatchMesh::GetTV(int index,float* u,float* v,int Channel=-1) CK_PURE

Gets the texture coordinate values.

Parameters

Input argument index | Index of the texture vertex whose value has to be retrieve.
Input argument u | U texture coordinate value.
Input argument v | V texture coordinate value.
Input argument Channel | Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

See Also

GetTV, GetTVs,SetTVCount,SetTVPatch


CKPatchMesh::GetTVCount

Virtual Method Method CKPatchMesh::GetTVCount

virtual int CKPatchMesh::GetTVCount(int Channel=-1) CK_PURE

Returns the number of the texture coordinates for a given channel.

Parameters

Input argument Channel

Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

Returns

Number of texture coordinates.

See Also

SetTVCount,SetTV,GetTV,GetTVs,GetTVPatchCount


CKPatchMesh::SetTV

Virtual Method Method CKPatchMesh::SetTV

virtual void CKPatchMesh::SetTV(int index,float u,float v,int Channel=-1) CK_PURE

Sets the texture coordinate values.

Parameters

Input argument index | Index of the texture vertex whose value has to be set.
Input argument u | U texture coordinate value.
Input argument v | V texture coordinate value.
Input argument Channel | Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

See Also

GetTV, GetTVs,SetTVCount,SetTVPatch


CKPatchMesh::SetTVCount

Virtual Method Method CKPatchMesh::SetTVCount

virtual void CKPatchMesh::SetTVCount(int count,int Channel=-1) CK_PURE

Sets the number of the texture coordinates for a given channel.

Parameters

Input argument count | Number of texture vertices to be set.
Input argument Channel | Index of the channel (-1 for default texture coordinates or >=0 for an additionnal material channel).

See Also

GetTVCount,GetTVPatchCount,SetTV,GetTV,GetTVs


CKPatchMesh::BuildRenderMesh

Virtual Method Method CKPatchMesh::BuildRenderMesh

virtual void CKPatchMesh::BuildRenderMesh() CK_PURE

Builds the base mesh for rendering.

Remarks

This method computes the base mesh vertices and face data to be rendered. This method is automatically called when vertices have been moved (notified by CKMesh::ModifierVertexMove for example) or the tesselation level has changed before rendering.

See Also

CleanRenderMesh


CKPlace

Class CKPlace

Group of 3D entities.

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CKPlace

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CKPlace

Remarks

CKPlaces are the basic bricks for the logical grouping of 3D entities, and for attaching behaviors to groups of entities.

Every objects that are children of a place are marked as belonging to this place.

3D entities, like ligths, cameras, 3D objects, characters, etc... are logically grouped into places. A 3d entity cannot belong to more than one place, but some entities may be attached to no place. They will be displayed and activated if they are global to the curent scene or level or to the whole game.

Portals can be used to declare the links between places so that a quick rejection can be performed by a portal manager to remove unseen places from a given place.

Portals are represented by a CK3dEntity and are considered as a unit box in the entity referential.

The class id of CKPlace is CKCID_PLACE.

Groups

Operations
Static Object Method Cast | Dynamic Cast method (returns NULL if the object can't be casted)
Virtual Method Method ComputeBestFitBBox | Automatically computes a matrix standing for the portal boundaries between place1 and place2.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Virtual Method Method GetOrientation | Returns the entity orientation axes.
Virtual Method Method GetPosition | Returns the entity position in a given referential.
Pure Virtual Method Method IsInRenderContext | Checks if this render object is referenced in a CKRenderContext.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method SetZOrder | Sets the Z order (priority) for this object.
Virtual Method Method ViewportClip | Clipping rectangle.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Portals
Virtual Method Method AddPortal | Adds a portal.
Virtual Method Method GetPortal | Returns the place seen by a given portal.
Virtual Method Method GetPortalCount | Returns the number of portals in this place.
Virtual Method Method RemovePortal | Removes a portal.

See Also

CKLevel,CK3dEntity


CKPlace::ComputeBestFitBBox

Virtual Method Method CKPlace::ComputeBestFitBBox

virtual CKBOOL CKPlace::ComputeBestFitBBox( CKPlace *p2, VxMatrix &BBoxMatrix ) CK_PURE

Automatically computes a matrix standing for the portal boundaries between place1 and place2.

Parameters

Input argument p2 | Second place.
Input argument BBoxMatrix | a reference to a matrix in which the calculation will be put.

Returns

Value | Meaning
TRUE | if the bounding box matrix was generated correctly,
FALSE | if some problem occured.

Remarks

The position and orientation of BBoxMatrix will match the best fitting bounding box between Place1 and Place2. The scale of BBoxMatrix match the world half-size of the best fitting bounding box between Place1 and Place2. More simply, if you set an unitary object's world matrix to BBoxMatrix after calling ComputeBestFitBBox() function, this object (if it's a cube) should wrap up the common vertices between Place1 and Place2.

See Also

AddPortal


CKPlace::ViewportClip

Virtual Method Method CKPlace::ViewportClip

virtual VxRect& CKPlace::ViewportClip() CK_PURE

Clipping rectangle.

Returns

A VxRect that contains the extents that can be seen when in this place.

Remarks

The portal manager updates this clipping rect when parsing the places. For example if a given place as only one portal the clipping rect will be reduce to enclose only this portal so that rendering of the remaining places are clipped to this portal.

See Also

AddPortal,GetPortalCount,GetPortal


CKPlace::Cast

Static Object Method CKPlace::Cast

static CKPlace* CKPlace::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKPlace::AddPortal

Virtual Method Method CKPlace::AddPortal

virtual void CKPlace::AddPortal(CKPlace* place,CK3dEntity* portal) CK_PURE

Adds a portal.

Parameters

Input argument place | A pointer to the CKPlace that is seen through the given portal.
Input argument portal | A pointer to the CK3DEntity that represents the portal extents.

Remarks

There can be more than one portal linking this place to a given place. Adding a portal between one place and another automatically adds the portal from the other place to this one. if portal is NULL, the given place is considered to be seen wherever the camera is in this place.

See Also

RemovePortal,GetPortalCount,GetPortal,ViewportClip


CKPlace::GetPortal

Virtual Method Method CKPlace::GetPortal

virtual CKPlace* CKPlace::GetPortal(int i,CK3dEntity** portal) CK_PURE

Returns the place seen by a given portal.

Parameters

Input argument i | Index of the portal to return.
Input argument portal | Address of a pointer to a CK3dEntity that will be filled with the result portal.

Returns

A pointer to the place seen by the portal.

See Also

AddPortal,GetPortalCount,ViewportClip


CKPlace::GetPortalCount

Virtual Method Method CKPlace::GetPortalCount

virtual int CKPlace::GetPortalCount() CK_PURE

Returns the number of portals in this place.

Returns

Number of portals in this place.

See Also

AddPortal,GetPortalCount,GetPortal,ViewportClip


CKPlace::RemovePortal

Virtual Method Method CKPlace::RemovePortal

virtual void CKPlace::RemovePortal(CKPlace* place,CK3dEntity* portal) CK_PURE

Removes a portal.

Parameters

Input argument place | A pointer to the CKPlace that is seen through the given portal.
Input argument portal | A pointer to the CK3DEntity that represents the portal extents.

See Also

AddPortal,GetPortalCount,GetPortal,ViewportClip


CKRenderContext

Class CKRenderContext

Managing device for rendering

CKObject
Show brief derivation trees

CKRenderContext

CKObject
Show full derivation trees

CKRenderContext

Remarks

+A CKRenderContext is where rendering occurs. It manages a list of objects to be rendered.

+At Creation time, a render context is attached to a window from which it will take size information. At anytime the rendercontext can be switch forth and back to fullscreen mode.

+CKRenderContext provides methods for Fog management, Primitive drawing, ambient lighting and cameras management.

+Callbacks can be set to have functions called before and after rendering occurs.

+The rendercontext contains a list of objects to be rendered. When creating a level all the objects of the level will be added to its render contextes (attached through the function CKLevel::AddRenderContext). If a rendercontext is used without a level the user must attach the objects he wants to be rendered.

+CKRenderContext is created through the CKRenderManager::CreateRenderContext() method.

+The class ID of CKRenderContext is CKCID_RENDERCONTEXT.

Groups

Objects Management | Rendering | Settings | Size | Ambient Settings | Cameras | Cast operator | Operations | Picking | Type Definitions | Callbacks | Utilities | User Clip Planes

Objects Management
Pure Virtual Method Method AddObject | Adds an object to the render context.
Pure Virtual Method Method AddObjectWithHierarchy | Adds an object to the rendercontext along with its hierarchy.
Pure Virtual Method Method AddRemoveSequence | Warns the engine that several objects are being added or removed.
Pure Virtual Method Method Compute2dRootObjects | Computes the list of root 2D Entities.
Pure Virtual Method Method Compute3dRootObjects | Computes the list of root 3D Entities.
Pure Virtual Method Method DetachAll | Removes all the objects from the rendercontext.
Pure Virtual Method Method Get2dRoot | Gets the root of the 2D entities.
Pure Virtual Method Method IsObjectAttached | Returns whether an object is attached to the render context.
Pure Virtual Method Method RemoveObject | Removes an object from the rendercontext
Rendering
Pure Virtual Method Method BackToFront | Copies the backbuffer to the frontbuffer
Pure Virtual Method Method Clear | Clears the render context
Pure Virtual Method Method DrawPrimitive | Draws a list of primitives (point,line,triangle).
Pure Virtual Method Method DrawScene | Renders the scene.
Pure Virtual Method Method ForceCameraSettingsUpdate | Updates render context settings according to the current camera.
Pure Virtual Method Method GetState | Returns a rendering state value.
Pure Virtual Method Method PrepareCameras | Prepares cameras positions before rendering
Pure Virtual Method Method Render | Render a single frame
Pure Virtual Method Method ScreenToViewpoint | Calculate a 3D point from a 2D Point, located on the near plane of the camera.
Pure Virtual Method Method SetCurrentMaterial | Specifies the current material to use when drawing primitives.
Pure Virtual Method Method SetProjectionTransformationMatrix | Sets the current projection transformation matrix
Pure Virtual Method Method SetState | Sets a rendering state value.
Pure Virtual Method Method SetTexture | Specifies the current texture to use when drawing primitives.
Pure Virtual Method Method SetTextureMatrix | Sets the current texture transformation matrix
Pure Virtual Method Method SetTextureStageState | Sets the rendering state for the current texture.
Pure Virtual Method Method SetupLights | Setup the lights position and activity.
Pure Virtual Method Method SetViewport | Sets the viewport to the window
Pure Virtual Method Method SetViewTransformationMatrix | Sets the current view transformation matrix
Pure Virtual Method Method SetWorldTransformationMatrix | Sets the current world transformation matrix
Settings
Pure Virtual Method Method ChangeCurrentRenderOptions | Sets the current rendering options.
Pure Virtual Method Method ChangeDriver | Changes the current driver used by a context.
Pure Virtual Method Method GetDriverIndex | Returns the index of the driver used by this context.
Pure Virtual Method Method GetPixelFormat | Returns the current pixel format of the context.
Pure Virtual Method Method GetWindowHandle | Returns the handle of the window used to create the context.
Pure Virtual Method Method SetClearBackground | Specifies whether backbuffer should be cleared.
Pure Virtual Method Method SetClearZBuffer | Specifies whether backbuffer should be cleared.
Pure Virtual Method Method SetGlobalRenderMode | Forces render settings for all objects.
Pure Virtual Method Method SetRenderTarget | Sets a texture as target for the rendering
Size
Pure Virtual Method Method GetHeight | Returns the height of the context.
Pure Virtual Method Method GetViewRect | Returns the viewport dimensions.
Pure Virtual Method Method GetWidth | Returns the width of the context.
Pure Virtual Method Method GetWindowRect | Returns the render context dimensions.
Pure Virtual Method Method GoFullScreen | Switches the context to FullScreen Mode.
Pure Virtual Method Method IsFullScreen | Returns whether the context is in FullScreen mode.
Pure Virtual Method Method Resize | Changes the size of the render context.
Pure Virtual Method Method SetViewRect | Sets the viewport dimensions.
Pure Virtual Method Method SetWindowRect | Sets the context dimensions inside the window.
Pure Virtual Method Method StopFullScreen | Switches back from FullScreen mode to windowed mode
Ambient Settings
Pure Virtual Method Method GetBackgroundMaterial | Returns the material used to clear the background.
Pure Virtual Method Method SetAmbientLight | Sets or gets the ambient light parameters
Pure Virtual Method Method SetFogColor | Sets or gets the fog color
Pure Virtual Method Method SetFogDensity | Sets or gets the fog density
Pure Virtual Method Method SetFogEnd | Sets or gets the depth at which the fog is at its maximum.
Pure Virtual Method Method SetFogMode | Sets or gets the fog mode.
Pure Virtual Method Method SetFogStart | Sets or gets the depth at which the fog starts.
Cameras
Pure Virtual Method Method AttachViewpointToCamera | Sets the active camera.
Pure Virtual Method Method DetachViewpointFromCamera | Detachs the viewpoint from its camera.
Pure Virtual Method Method GetAttachedCamera | Returns the camera to which the viewpoint is attached.
Pure Virtual Method Method GetViewpoint | Returns the 3dEntity which represents the viewpoint.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Operations
Pure Virtual Method Method _MatchStereoTextureRightToLeft | For internal use only. Ensure that the right stereo texture match the left one size and formatanar reflections.
Pure Virtual Method Method FlushPendingGPUCommands | Wait for any pending rendering command (in GPU) to finish.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Pure Virtual Method Method GetStereoRenderMode | Get the current Stereo Render mode (possibly none)
Pure Virtual Method Method GetStereoTextureRightEye | Return the right eye for a stereo texture, or NULL is the texture is not stereo, and if it is in debug mode (that is, wether the 'Render In RT View' BB should copy the result of the right eye rendering to the texture second slot, when its 'Update System Memory' flag is on)
Pure Virtual Method Method GetSurfacesVideoMemoryOccupation | Returns, in bytes, the video memory occupation of the rasterizer surfaces. NbTextures will contain the number of textures in Video memory (including the Sprites sub textures) NbSprites will contain the number of sprites in Video memory TextureSize will contain the Video memory used by textures and sprites (including Render Targets Z buffers) SpriteSize will contain the Video memory used by Sprites
Pure Virtual Method Method IsLost | Determine if the rasterizer is lost or not, if lost then it must be destroyed then re-created
Pure Virtual Method Method IsRenderingShaderBatch |
Pure Virtual Method Method IsStereoRenderingLeftEye | For internal use only. Test whether current stereo rendering is performed on left eye.
Pure Virtual Method Method IsStereoTexture | Check whether a texture has been registered as a stereo texture.
Pure Virtual Method Method MatchRightEyeToLeftEyeStereoTexturePairs | Make sure that all right eye texture match the left eye texture dimension and format, update them if necessary
Pure Virtual Method Method OverrideMaterial |
Pure Virtual Method Method RegisterStereoTexture | Register a stereo texture. Such a texture pair will be 'swapped' when rendering right eye a stereo view (anaglyph mode, checkerboard mode ...), then 'swapped' again. The render context has ownership for the counterpart texture. When doing a 'render in RT view', if a texture is part of a stereo pair, then both textures will be rendered.
Pure Virtual Method Method ScreenToCamera |
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method SetOverriddenRendering | Overrides the rendering of objects.
Pure Virtual Method Method SetStereoRenderMode | For internal use only. Set the current stereo render mode
Pure Virtual Method Method SetUpdate2DProjEnableFlag |
Pure Virtual Method Method SetValuesOfUsedAutomatics | Set values of all automatic parameters used by the “iFx” shader.
Pure Virtual Method Method SwapStereoTexturePairs | Swap all registered stereo texture pairs. (right become left, and left become right) The swapping occurs on the CKTexture internal members, using CKtexture::Swap, so it is transparent for any render using them. (this implies also, that no pixels are copied) Usually, such a call will be done before and after rendering a right-eye view that display planar reflections.
Pure Virtual Method Method UnregisterAllStereoTextures | Unregister a stereo texture. This will remove the associated right eye texture.
Pure Virtual Method Method UnregisterStereoTexture | Unregister a stereo texture. This will remove the associated right eye texture.
Picking
Pure Virtual Method Method Pick | Returns information about object at a specific position.
Pure Virtual Method Method Pick2D | Returns information about 2D entities at a specific position.
Pure Virtual Method Method RectPick | Returns the list of objects contained in a rectangle.
Type Definitions
Enumerated Type CK_ANAGLYPH_MODE | When the render context is in anaglyph mode, specify the kind of anaglyph to be used
Enumerated Type CK_STEREO_MODE | Specify the current type of stereo render mode
Callbacks
Pure Virtual Method Method AddPostRenderCallBack | Adds or removes a function to call after 3D rendering is done and before sprites are drawn.
Pure Virtual Method Method AddPostSpriteRenderCallBack | Adds or removes a callback to be called after the foreground sprites rendering.
Pure Virtual Method Method AddPreRenderCallBack | Adds or removes a function to call before rendering begins.
Utilities
Pure Virtual Method Method CopyToVideo | Copies an image to the specified video buffer (Back or Z )
Pure Virtual Method Method DumpToFile | Saves the content of a video-buffer to the disk.
Pure Virtual Method Method DumpToMemory | Creates an image from the specified video buffer (Back or Z ).
Pure Virtual Method Method GetBoundingBox | Returns the bounding box of every objects referenced in the context.
Pure Virtual Method Method GetDirectXInfo | Returns pointers to the DirectX objects.
Pure Virtual Method Method GetDrawPrimitiveIndices | Returns a pre-allocated list of indices
Pure Virtual Method Method GetDrawPrimitiveStructure | Returns a pre-allocated VxDrawPrimitive structure
Pure Virtual Method Method GetRasterizerContext | Gets the rasterization context.
Pure Virtual Method Method GetStats | Returns statistics about the last rendered frame .
Pure Virtual Method Method LockCurrentVB | Gets write access to the latest allocated vertex buffer
Pure Virtual Method Method ScreenToClient | Converts screen coordinates to render context window coordinates
Pure Virtual Method Method Transform | Transform vertices to screen coordinates.
Pure Virtual Method Method TransformVertices | Transforms an array of vertices to screen coordinates
Pure Virtual Method Method WarnEnterThread | Multi thread specific
User Clip Planes
Pure Virtual Method Method GetUserClipPlane | Returns a user clip plane equation
Pure Virtual Method Method SetUserClipPlane | Sets a user clip plane equation

See Also

CKRenderManager


CKRenderContext::AddObject

Pure Virtual Method Method CKRenderContext::AddObject

virtual void CKRenderContext::AddObject (CKRenderObject *obj)

Adds an object to the render context.

Parameters

Input argument obj

A pointer to a CKRenderObject to attach to the rendercontext.

Remarks

This function does not need to be called if you are using scenes, since every objects in a scene are automatically added to the render contextes a level use. But you may need to render objects without them being added to the level in which case you must attach them to the rendercontext. Both 2dEntities (Sprites) and 3dEntities can be added to a rendercontext.

See Also

IsObjectAttached,RemoveObject,AddObjectWithHierarchy,DetachAll,AddRemoveSequence


CKRenderContext::AddObjectWithHierarchy

Pure Virtual Method Method CKRenderContext::AddObjectWithHierarchy

virtual void CKRenderContext::AddObjectWithHierarchy(CKRenderObject *obj)

Adds an object to the rendercontext along with its hierarchy.

Parameters

Input argument obj

A pointer to a CKRenderObject to attach to the rendercontext.

Remarks

Adds obj and all its children to the render context.

See Also

IsObjectAttached,RemoveObject,AddObject,DetachAll


CKRenderContext::AddRemoveSequence

Pure Virtual Method Method CKRenderContext::AddRemoveSequence

virtual void CKRenderContext::AddRemoveSequence(CKBOOL Start)

Warns the engine that several objects are being added or removed.

Parameters

Input argument Start

TRUE to warn the start of the sequence, FALSE to end it.

Remarks

When an object is added to the render context it is inserted the scene graph. This operation can be slow if it must be repeated for each object. This method enables the user to warn the engine that several call to AddObjects or RemoveObjects are about to occur so that it can update the scene graph only once when all the objects have been added or removed.

See Also

AddObject,RemoveObject


CKRenderContext::Compute2dRootObjects

Pure Virtual Method Method CKRenderContext::Compute2dRootObjects

virtual const XObjectArray& CKRenderContext::Compute2dRootObjects()

Computes the list of root 2D Entities.

Returns

A reference to an XObjectArray containing the list of root 2D Entities.

Remarks

Fills list with the 2D Entities that do not have a parent.

See Also

Compute3dRootObjects,XObjectArray


CKRenderContext::Compute3dRootObjects

Pure Virtual Method Method CKRenderContext::Compute3dRootObjects

virtual const XObjectArray& CKRenderContext::Compute3dRootObjects()

Computes the list of root 3D Entities.

Returns

A reference to an XObjectArray containing the list of root 3D Entities.

Remarks

Return list with the 3D Entities that do not have a parent.

See Also

Compute2dRootObjects,XObjectArray


CKRenderContext::DetachAll

Pure Virtual Method Method CKRenderContext::DetachAll

virtual void CKRenderContext::DetachAll()

Removes all the objects from the rendercontext.

See Also

IsObjectAttached,AddObjectWithHierarchy,AddObject,RemoveObject


CKRenderContext::Get2dRoot

Pure Virtual Method Method CKRenderContext::Get2dRoot

virtual CK2dEntity* CKRenderContext::Get2dRoot(CKBOOL background)

Gets the root of the 2D entities.

Parameters

Input argument background

either background or foreground root.

Returns

A pointer to either the background or foreground 2D root CK2dEntity

See Also

Compute2dRootObjects


CKRenderContext::IsObjectAttached

Pure Virtual Method Method CKRenderContext::IsObjectAttached

virtual CKBOOL CKRenderContext::IsObjectAttached(CKRenderObject *obj)

Returns whether an object is attached to the render context.

Parameters

Input argument obj

A pointer to a CKRenderObject

Returns

Value | Meaning
TRUE | if the object is attached to the Rendercontext,
FALSE | otherwise.

See Also

AddObject,RemoveObject,AddObjectWithHierarchy,DetachAll


CKRenderContext::RemoveObject

Pure Virtual Method Method CKRenderContext::RemoveObject

virtual void CKRenderContext::RemoveObject (CKRenderObject *obj)

Removes an object from the rendercontext

Parameters

Input argument obj

Object to be removed from the rendercontext.

See Also

IsObjectAttached,AddObjectWithHierarchy,AddObject,DetachAll


CKRenderContext::BackToFront

Pure Virtual Method Method CKRenderContext::BackToFront

virtual CKERROR CKRenderContext::BackToFront(CK_RENDER_FLAGS Flags=CK_RENDER_USECURRENTSETTINGS)

Copies the backbuffer to the frontbuffer

Parameters

Input argument Flags

A combination of CK_RENDER_FLAGS.

Returns

CK_OK if successful or an error code otherwise.

See Also

Clear,Render,DrawScene,Understanding the Render Loop


CKRenderContext::Clear

Pure Virtual Method Method CKRenderContext::Clear

virtual CKERROR CKRenderContext::Clear(CK_RENDER_FLAGS Flags=CK_RENDER_USECURRENTSETTINGS, CKDWORD Stencil = 0)

Clears the render context

Parameters

Input argument Flags | A combination of CK_RENDER_FLAGS specifying which buffers should be cleared.
Input argument Stencil | Stencil value to use to clear the stencil.

Returns

CK_OK if successful or an error code otherwise.

Remarks

The render engine uses the current background material settings (diffuse color and texture) to clear the background. If Flags is CK_RENDER_USECURRENTSETTINGS (default) the rendering is done using the current render options (See GetCurrentRenderOptions). See Understanding the Render Loop paper for more details on the rendering operations.

See Also

Render,DrawScene,BackToFront,Understanding the Render Loop


CKRenderContext::DrawPrimitive

Pure Virtual Method Method CKRenderContext::DrawPrimitive

virtual CKBOOL CKRenderContext::DrawPrimitive (VXPRIMITIVETYPE pType,WORD* indices,int indexcount,VxDrawPrimitiveData* data)
virtual CKBOOL CKRenderContext::DrawPrimitive (VXPRIMITIVETYPE pType,DWORD* indices,int indexcount,VxDrawPrimitiveData* data)

Draws a list of primitives (point,line,triangle).

Parameters

pType | Type of primitive to draw.
indices | A pointer to a list of WORD or DWORD that will be used as indices to vertices or NULL.
indexcount | Number of indices
data | A pointer to a VxDrawPrimitiveData structure that contains pointer to vertices to draw and transformation flags.

Returns

TRUE if successful.

Remarks

Instead of allocating memory for vertices each time primitives are to be drawn, you can use the GetDrawPrimitiveStructure and GetDrawPrimitiveIndices which return ready-to-use VxDrawPrimitiveData structure. Even when using DWORD indices, the maximum value for a vertex index is currently 65535

See Also

VXPRIMITIVETYPE,Custom Rendering,SetWorldTransformationMatrix,VxDrawPrimitiveData


CKRenderContext::DrawScene

Pure Virtual Method Method CKRenderContext::DrawScene

virtual CKERROR CKRenderContext::DrawScene(CK_RENDER_FLAGS Flags=CK_RENDER_USECURRENTSETTINGS)

Renders the scene.

Returns

CK_OK if successful or an error code otherwise.

Remarks

Rendering the scene consists in drawing the 2D and 3D entities attached to this render context. See Understanding the Render Loop paper for more details on the rendering operations.

See Also

Clear,Render,BackToFront,Understanding the Render Loop


CKRenderContext::ForceCameraSettingsUpdate

Pure Virtual Method Method CKRenderContext::ForceCameraSettingsUpdate

virtual void CKRenderContext::ForceCameraSettingsUpdate()

Updates render context settings according to the current camera.

Remarks

Every frame the settings of the current camera are used to update the current render context (Position,Fov,Aspect Ration,Clip Planes,etc...). This function force the settings to be updated immediatly.

See Also

PrepareCameras


CKRenderContext::GetState

Pure Virtual Method Method CKRenderContext::GetState

virtual CKDWORD CKRenderContext::GetState(VXRENDERSTATETYPE State)

Returns a rendering state value.

Parameters

Input argument State

VXRENDERSTATETYPE to get the value of.

Returns

Current value of the given render state.

Remarks

Rendering states include filtering,blending,lighting,fog modes and many others, see VXRENDERSTATETYPE for more details.

See Also

SetState,CKMaterial::SetAsCurrent,VXRENDERSTATETYPE


CKRenderContext::PrepareCameras

Pure Virtual Method Method CKRenderContext::PrepareCameras

virtual void CKRenderContext::PrepareCameras(CK_RENDER_FLAGS Flags=CK_RENDER_USECURRENTSETTINGS)

Prepares cameras positions before rendering

Remarks

This function updates the orientation of all target lights and cameras so that they point toward their targets. If there is an active camera to which the viewpoint is attached, the rendercontext is updated according to the camera settings (Field of View,Type of projection (Perspective or Orthographic),Clip planes). It finally updates the size of the viewport according to active camera aspect ratio. This method is automatically called by the Render method.

See Also

Render,ForceCameraSettingsUpdate,SetViewRect,Understanding the Render Loop


CKRenderContext::Render

Pure Virtual Method Method CKRenderContext::Render

virtual CKERROR CKRenderContext::Render(CK_RENDER_FLAGS Flags=CK_RENDER_USECURRENTSETTINGS)

Render a single frame

Parameters

Input argument Flags

A combination of CK_RENDER_FLAGS.

Returns

CK_OK if successful or an error code otherwise.

Remarks

+If Flags is CK_RENDER_USECURRENTSETTINGS (default) the rendering is done using the current render options (See GetCurrentRenderOptions). +The main actions performed by this function is to call respectively : +PrepareCameras(Flags); +Clear(Flags); +DrawScene(Flags); +BackToFront(Flags); +See Understanding the Render Loop paper for more details about the operations done by this function.

See Also

Understanding the Render Loop,


CKRenderContext::ScreenToViewpoint

Pure Virtual Method Method CKRenderContext::ScreenToViewpoint

virtual void CKRenderContext::ScreenToViewpoint(const Vx2DVector& i2DPosition, VxVector* o3DPosition, CKBOOL iScreen = TRUE)

Calculate a 3D point from a 2D Point, located on the near plane of the camera.

Parameters

Input argument i2DPosition | Position in the screen coordinates (or in the viewport).
Input argument o3DPosition | Position in the viewpoint system coordinates.
Input argument iScreen | TRUE if the position is given in the screen coordinates, FALSE if it is given in client coordinates.

See Also

SetViewRect


CKRenderContext::SetCurrentMaterial

Pure Virtual Method Method CKRenderContext::SetCurrentMaterial

virtual void CKRenderContext::SetCurrentMaterial(CKMaterial *mat,BOOL Lit=TRUE)

Specifies the current material to use when drawing primitives.

Parameters

Input argument mat | A pointer to a CKMaterial that will be used (a NULL material disables the texturing).
Input argument Lit | TRUE to set the color settings of the material or FALSE if they will not be used (when rendering prelitted primitives for example)

Remarks

When setting a material as current the lighting engine will use its parameters (Diffuse Color ,etc.) for lighting calculation if Lit is TRUE. But this function also sets the render state according to the material properties:

If the material has a texture it is set as current texture. If material is two-sided the culling is disabled : SetState(VXRENDERSTATE_CULLMODE,VXCULL_NONE) otherwise it is set to counter-clockwise SetState(VXRENDERSTATE_CULLMODE, VXCULL_CCW). The Texture Blend Mode is set : SetState(VXRENDERSTATE_TEXTUREMAPBLEND,TextureBlendMode); The Shade Mode is set : SetState(VXRENDERSTATE_SHADEMODE,ShadeMode) unless the render context has a global shade mode in which case this is the one used. The Filtering Mode is set :SetState(VXRENDERSTATE_TEXTUREMAG,TextureMagMode) and SetState(VXRENDERSTATE_TEXTUREMIN,TextureMinMode) Texture Border Color and Address Mode (Wrap,Clamp,etc.) are set : Dev->SetState(VXRENDERSTATE_BORDERCOLOR,BorderColor ) and Dev->SetState(VXRENDERSTATE_TEXTUREADDRESS,TextureAddressMode ) If Blending is enabled the blending is enabled through SetState(VXRENDERSTATE_BLENDENABLE, ...) Z buffer writing is disabled according to hte current flag SetState(VXRENDERSTATE_ZWRITEENABLE, ...) and the Blending Factors are set SetState(VXRENDERSTATE_SRCBLEND, SrcBlendMode) and SetState(VXRENDERSTATE_DESTBLEND, DestBlendMode). Alpha testing is set,SetState(VXRENDERSTATE_ALPHATESTENABLE,AlphaTestEnabled),SetState(VXRENDERSTATE_ALPHAFUNC, AlphaFunc),SetState(VXRENDERSTATE_ALPHAREF, AlphaRef);

See Also

DrawPrimitive,SetState,SetTexture,CKTexture::SetAsCurrent,CKMaterial::SetAsCurrent


CKRenderContext::SetProjectionTransformationMatrix

Pure Virtual Method Method CKRenderContext::SetProjectionTransformationMatrix

virtual void CKRenderContext::SetProjectionTransformationMatrix (const VxMatrix& M)
virtual const VxMatrix& CKRenderContext::GetProjectionTransformationMatrix ()

Sets the current projection transformation matrix

Parameters

Input argument M

A VxMatrix representation of the projection transformation.

Remarks

The world, view and projection matrices determine the way vertices are transformed respectively from local coordinate sytem to world, from world to camera and from camera to screen coordinates. When a scene is drawn the View (Camera) , Projection and World (Object) matrices are automatically set. If you need to use a custom matrix in a callback (for example a world identity matrix to draw primitives directly in world coordinates) you should take care of restoring the matrix afterwards for the other objects to be rendered correctly. This is especially true for view and projection matrices which are set once at the beginning of the render loop.

Perspective Projection:

A=Cos(Fov/2)/Sin(Fov/2)
W=ViewWidth
H=ViewHeight
F   =   Far clip plane
N   =   Near clip plane

        [ A         0           0           0]
        [ 0         A*W/H       0           0]
    M=  [ 0         0           F/F-N       1]
        [ 0         0           -F.N/F-N    0]

Orthographic Projection:

Z=Orthographic Zoom
W=ViewWidth
H=ViewHeight
F   =   Far clip plane
N   =   Near clip plane

        [ Z         0           0           0]
        [ 0         Z*W/H       0           0]
    M=  [ 0         0           1/F-N       0]
        [ 0         0           -N/F-N      1]

See Also

SetProjectionTransformationMatrix,SetViewTransformationMatrix,VxMatrix::Perspective


CKRenderContext::SetState

Pure Virtual Method Method CKRenderContext::SetState

virtual void CKRenderContext::SetState(VXRENDERSTATETYPE State,CKDWORD Value)

Sets a rendering state value.

Parameters

Input argument State | VXRENDERSTATETYPE to modify.
Input argument Value | New value for the state.

Remarks

Render states do not need to be modified if you are using materials since they are automatically set according to the material properties each time CKMaterial::SetAsCurrent is called (or an object with a given material is drawn). Rendering states include filtering,blending,lighting,fog modes and many others, see VXRENDERSTATETYPE for more details.

See Also

GetState,CKMaterial::SetAsCurrent,VXRENDERSTATETYPE


CKRenderContext::SetTexture

Pure Virtual Method Method CKRenderContext::SetTexture

virtual CKBOOL CKRenderContext::SetTexture(CKTexture* tex,CKBOOL Clamped=0,int Stage=0)

Specifies the current texture to use when drawing primitives.

Parameters

Input argument tex | A pointer to a CKTexture that will be used (a NULL texture disables the texturing).
Input argument Clamped | Some implementation require additionnal processing when texture address mode is set to clamping. This value must be set to true if the texture is to be used in clamping mode.
Input argument Stage | Texture stage on which this texture should be set, usually 0.

Returns

TRUE if successful.

Remarks

When setting a texture as current the render engine will use it when drawing primitives. If the texture is transparent alpha testing is enabled (SetState(VXRENDERSTATE_ALPHATESTENABLE,TRUE) Setting a material as current automatically sets its texture as current.

See Also

DrawPrimitive,SetTextureStageState,SetState,SetCurrentMaterial,CKTexture::SetAsCurrent,CKMaterial::SetAsCurrent


CKRenderContext::SetTextureMatrix

Pure Virtual Method Method CKRenderContext::SetTextureMatrix

virtual void CKRenderContext::SetTextureMatrix (const VxMatrix& M,int Stage =0)

Sets the current texture transformation matrix

Parameters

Input argument M | A VxMatrix representation of the texture transformation.
Input argument Stage | Index of the texture stage (0..7) which matrix should be set.

See Also

SetProjectionTransformationMatrix,SetViewTransformationMatrix,SetWorldTransformationMatrix


CKRenderContext::SetTextureStageState

Pure Virtual Method Method CKRenderContext::SetTextureStageState

virtual CKBOOL CKRenderContext::SetTextureStageState(CKRST_TEXTURESTAGESTATETYPE State,CKDWORD Value,int Stage=0)

Sets the rendering state for the current texture.

Parameters

Input argument State | CKRST_TEXTURESTAGESTATETYPE to modify the value of.
Input argument Value | New value.
Input argument Stage | Index of the texture stage.

Returns

TRUE if successful.

Remarks

The texture render states defines the texture filtering,blending or address modes for the currently active texture, so this method must be called after a call to CKTexture::SetAsCurrent or CKMaterial::SetAsCurrent. These states are automatically set when setting a material as current.

See Also

SetTexture,SetState,CKRST_TEXTURESTAGESTATETYPE,CKMaterial::SetAsCurrent


CKRenderContext::SetupLights

Pure Virtual Method Method CKRenderContext::SetupLights

virtual void CKRenderContext::SetupLights()

Setup the lights position and activity.

Remarks

This method is automatically called at the beginning of the scene rendering (DrawScene) and modifies the current World and View transformation matrices. It resets all the lights position and activity according to their flags and world matrices and pass the according parameters to the rasterizer. This should be used unless you specifically want to control which lights are on during a rendering


CKRenderContext::SetViewport

Pure Virtual Method Method CKRenderContext::SetViewport

virtual void CKRenderContext::SetViewport(const VxRect& iRect)

Sets the viewport to the window

Parameters

Input argument iRect

Rectangle of the viewport to set.

See Also

SetViewRect


CKRenderContext::SetViewTransformationMatrix

Pure Virtual Method Method CKRenderContext::SetViewTransformationMatrix

virtual void CKRenderContext::SetViewTransformationMatrix (const VxMatrix& M)
virtual const VxMatrix& CKRenderContext::GetViewTransformationMatrix ()

Sets the current view transformation matrix

Parameters

Input argument M

A VxMatrix representation of the view transformation.

Remarks

The world, view and projection matrices determine the way vertices are transformed respectively from local coordinate sytem to world, from world to camera and from camera to screen coordinates. When a scene is drawn the View (Camera) , Projection and World (Object) matrices are automatically set. If you need to use a custom matrix in a callback (for example a world identity matrix to draw primitives directly in world coordinates) you should take care of restoring the matrix afterwards for the other objects to be rendered correctly. This is especially true for view and projection matrices which are set once at the beginning of the render loop.

See Also

SetProjectionTransformationMatrix,SetViewTransformationMatrix


CKRenderContext::SetWorldTransformationMatrix

Pure Virtual Method Method CKRenderContext::SetWorldTransformationMatrix

virtual void CKRenderContext::SetWorldTransformationMatrix (const VxMatrix& M)
virtual const VxMatrix& CKRenderContext::GetWorldTransformationMatrix()

Sets the current world transformation matrix

Parameters

Input argument M

A VxMatrix representation of the world transformation.

Remarks

The world, view and projection matrices determine the way vertices are transformed respectively from local coordinate sytem to world, from world to camera and from camera to screen coordinates.

When a scene is drawn the View (Camera) , Projection and World (Object) matrices are automatically set.

If you need to use a custom matrix in a callback (for example a world identity matrix to draw primitives directly in world coordinates) you should take care of restoring the matrix afterwards for the other objects to be rendered correctly.

This is especially true for view and projection matrices which are set once at the beginning of the render loop.

See Also

SetProjectionTransformationMatrix,SetViewTransformationMatrix


CKRenderContext::ChangeCurrentRenderOptions

Pure Virtual Method Method CKRenderContext::ChangeCurrentRenderOptions

virtual void CKRenderContext::SetCurrentRenderOptions(CKDWORD flags)
virtual CKDWORD CKRenderContext::GetCurrentRenderOptions()
virtual void CKRenderContext::ChangeCurrentRenderOptions(CKDWORD Add,CKDWORD Remove)

Sets the current rendering options.

Parameters

flags: A combination of CK_RENDER_FLAGS.

Remarks

The default render options are:

Draw both foreground and background sprites (CK_RENDER_BACKGROUNDSPRITES & CK_RENDER_FOREGROUNDSPRITES) To automatically adjust the viewport rectangle according to the current camera aspect ratio (CK_RENDER_USECAMERARATIO). To clear Color,Z and stencil buffer at the beginning of each render loop (CK_RENDER_CLEARZ,CK_RENDER_CLEARBACK,CK_RENDER_CLEARSTENCIL) To blit the content of the back buffer to the screen at the end (CK_RENDER_DOBACKTOFRONT) This settings can be changed or overriden when calling the Render,Clear,DrawScene or BackToFront method.

See Also

ChangeCurrentRenderOptions,GetCurrentRenderOptions,CK_RENDER_FLAGS


CKRenderContext::ChangeDriver

Pure Virtual Method Method CKRenderContext::ChangeDriver

virtual CKBOOL CKRenderContext::ChangeDriver(int NewDriver)

Changes the current driver used by a context.

Parameters

DriverIndex: Index of new the driver to use or -1 to force the reconstruction of the current context.

Returns

TRUE if successful.

Remarks

This method can not change the driver of render context currently in fullscreen mode. The context keeps all its current settings.

See Also

GetDriverIndex,CKRenderManager::GetRenderDriverDescription.


CKRenderContext::GetDriverIndex

Pure Virtual Method Method CKRenderContext::GetDriverIndex

virtual int CKRenderContext::GetDriverIndex()

Returns the index of the driver used by this context.

Returns

Index of the driver.

Remarks

Information about the driver can be retrieved by the CKRenderManager::GetRenderDriverDescription.

See Also

ChangeDriver,CKRenderManager::GetRenderDriverDescription.


CKRenderContext::GetPixelFormat

Pure Virtual Method Method CKRenderContext::GetPixelFormat

virtual VX_PIXELFORMAT CKRenderContext::GetPixelFormat(int* Bpp=NULL,int* Zbpp=NULL,int* StencilBpp=NULL)

Returns the current pixel format of the context.

Parameters

Input argument Bpp | Optionnal integer to be filled with the number of color buffer bits per pixel.
Input argument Zbpp | Optionnal integer to be filled with the number of depth buffer bits per pixel.
Input argument StencilBpp | Optionnal integer to be filled with the number of stencil bits per pixel.

Returns

VX_PIXELFORMAT of the color buffer.

See Also

VX_PIXELFORMAT


CKRenderContext::GetWindowHandle

Pure Virtual Method Method CKRenderContext::GetWindowHandle

virtual WIN_HANDLE CKRenderContext::GetWindowHandle()

Returns the handle of the window used to create the context.

Returns

The handle of the render context window.

Remarks

The returned handle is the same that was given to CKRenderManager::CreateContext.

See Also

CKRenderManager::CreateContext


CKRenderContext::SetClearBackground

Pure Virtual Method Method CKRenderContext::SetClearBackground

virtual void CKRenderContext::SetClearBackground (CKBOOL ClearBack=TRUE)
virtual CKBOOL CKRenderContext::GetClearBackground ()

Specifies whether backbuffer should be cleared.

Parameters

Input argument ClearBack

A boolean specifying if the back buffer should be cleared.

Remarks

This function modifies the current render options and is a conveniency for ChangeCurrentRenderOptions(CK_RENDER_CLEARBACK)

See Also

SetClearZBuffer,ChangeCurrentRenderOptions


CKRenderContext::SetClearZBuffer

Pure Virtual Method Method CKRenderContext::SetClearZBuffer

virtual void CKRenderContext::SetClearZBuffer (CKBOOL ClearZ=TRUE)
virtual CKBOOL CKRenderContext::GetClearZBuffer ()

Specifies whether backbuffer should be cleared.

Parameters

ClearBack : A boolean specifying if the back buffer should be cleared.

Remarks

This function modifies the current render options and is a conveniency for ChangeCurrentRenderOptions(CK_RENDER_CLEARBACK)

See Also

SetClearZBuffer,ChangeCurrentRenderOptions


CKRenderContext::SetGlobalRenderMode

Pure Virtual Method Method CKRenderContext::SetGlobalRenderMode

virtual void CKRenderContext::GetGlobalRenderMode(VxShadeType *Shading,CKBOOL *Texture,CKBOOL *Wireframe)
virtual void CKRenderContext::SetGlobalRenderMode(VxShadeType Shading=GouraudShading,CKBOOL Texture=TRUE,CKBOOL Wireframe=FALSE)

Forces render settings for all objects.

Parameters

Input argument Shading | A global shade mode that all objects will use.
Input argument Texture | Enable or disables texturing for all objects.
Input argument Wireframe | Draws an additionnal wireframe layer on all the objects.

Remarks

This method can be used to override the material settings of every objects.

See Also

VxShadeType


CKRenderContext::SetRenderTarget

Pure Virtual Method Method CKRenderContext::SetRenderTarget

virtual CKBOOL CKRenderContext::SetRenderTarget(CKTexture* texture = NULL,int CubeMapFace = 0)

Sets a texture as target for the rendering

Parameters

Input argument texture | A CKTexture on which rendering should be targeted.
Input argument CubeMapFace | For a cube map texture index of the face on which the rendering should occur.

Returns

TRUE if successful,FALSE otherwise.

Remarks

Depending on the implementation, when a texture is set as the target for rendering, it either occurs directly in the texture video memory surface or is copied at the end of the frame from the back buffer to the texture video surface (which is a little bit slower) The texture system memory image is left unchanged and does not reflect any more what is in video memory. When dealing with cube map, a face index (0 : positive X axis, 1 negative X axis,2 : position Y axis, 3 negative Y axis, etc...) must be given to indicate which face to render to)

See Also

CKTexture


CKRenderContext::GetHeight

Pure Virtual Method Method CKRenderContext::GetHeight

virtual int CKRenderContext::GetHeight()

Returns the height of the context.

Returns

Height in pixels of the render context.

See Also

GetWidth,GetWindowRect,Resize,GetViewRect,


CKRenderContext::GetViewRect

Pure Virtual Method Method CKRenderContext::GetViewRect

virtual void CKRenderContext::GetViewRect(VxRect& rect)

Returns the viewport dimensions.

Parameters

Input argument rect

Viewport size and position inside the context.

Remarks

If the current render flags (see GetCurrentRenderOptions) contains CK_RENDER_USECAMERARATIO the viewport size is automatically set by PrepareCameras method according to camera aspect ratio and current size of the context at the beginning of each rendering loop.

See Also

SetViewRect,SetWindowRect,SetCurrentRenderOptions,PrepareCameras


CKRenderContext::GetWidth

Pure Virtual Method Method CKRenderContext::GetWidth

virtual int CKRenderContext::GetWidth()

Returns the width of the context.

Returns

Width in pixels of the render context.

See Also

GetHeight,GetWindowRect,Resize,GetViewRect,


CKRenderContext::GetWindowRect

Pure Virtual Method Method CKRenderContext::GetWindowRect

virtual void CKRenderContext::GetWindowRect(VxRect& rect,CKBOOL ScreenRelative=FALSE)

Returns the render context dimensions.

Parameters

Input argument rect | Rectangle to be filled context dimensions
Input argument ScreenRelative | See remarks.

Remarks

If ScreenRelative is FALSE coordinates are relative to top-left corner of the window containing the rendering context otherwise they are screen relative.

See Also

SetWindowRect,Resize,,GetWidth,GetHeight,GetViewRect


CKRenderContext::GoFullScreen

Pure Virtual Method Method CKRenderContext::GoFullScreen

virtual CKERROR CKRenderContext::GoFullScreen(int Width=640,int Height=480,int Bpp=-1,int Driver=0, int RefreshRate = 0)

Switches the context to FullScreen Mode.

Parameters

Input argument Width | width of the window and screen (Default : 640).
Input argument Height | height of the window and screen ( Default : 480).
Input argument Bpp | Desired Bit per pixel in FullScreen mode (Default : -1 specifies to keep current desktop Bit per pixel).
Input argument Driver | Index of the driver to use to create the fullscreen context (Default 0).
Input argument RefreshRate | Refresh rate to set for the fullscreen mode or 0 to use the system settings for the given display mode.

Returns

CK_OK if successful or an error code.

See Also

StopFullScreen,IsFullScreen


CKRenderContext::IsFullScreen

Pure Virtual Method Method CKRenderContext::IsFullScreen

virtual CKBOOL CKRenderContext::IsFullScreen()

Returns whether the context is in FullScreen mode.

Returns

TRUE if the context is in FullScreen mode, FALSE otherwise

See Also

StopFullScreen,GoFullScreen


CKRenderContext::Resize

Pure Virtual Method Method CKRenderContext::Resize

virtual CKERROR CKRenderContext::Resize(int PosX=0,int PosY=0,int SizeX=0,int SizeY=0,CKDWORD Flags=0)

Changes the size of the render context.

Parameters

Input argument PosX | Position of the left corner of the context in the window.
Input argument PosY | Position of the top corner of the context in the window.
Input argument SizeX | Optionnal new width of the context (0 to use the current size of the window).
Input argument SizeY | Optionnal new height of the context (0 to use the current size of the window).
Input argument Flags | See remarks.

Returns

CK_OK if successful or an error code otherwise.

Remarks

This function is usually called by the user to warn that the rendercontext window has changed its size. If the user does not specifies the new size the render engine will take the size of the client rect of the rendercontext window. If Flags contains VX_RESIZE_NOSIZE SizeX and SizeY arguments are ignored. If Flags contains VX_RESIZE_NOMOVE PosX and PosY arguments are ignored.

See Also

GetWindowHandle,SetWindowRect,GetWindowRect,SetViewRect,GetViewRect


CKRenderContext::SetViewRect

Pure Virtual Method Method CKRenderContext::SetViewRect

virtual void CKRenderContext::SetViewRect(VxRect& rect)

Sets the viewport dimensions.

Parameters

Input argument rect

Viewport size and position inside the context.

Remarks

Viewport Dimensions

If the current render flags (see GetCurrentRenderOptions) contains CK_RENDER_USECAMERARATIO the viewport size is automatically set by PrepareCameras method according to camera aspect ratio and current size of the context at the beginning of each rendering loop.

See Also

GetViewRect,SetWindowRect,SetCurrentRenderOptions,PrepareCameras


CKRenderContext::SetWindowRect

Pure Virtual Method Method CKRenderContext::SetWindowRect

virtual CKERROR CKRenderContext::SetWindowRect(VxRect& rect,CKDWORD Flags=0)

Sets the context dimensions inside the window.

Parameters

Input argument rect | Rectangle defining the desired context dimensions.
Input argument Flags | See Resize method comments.

Returns

CK_OK.

Remarks

Coordinates are relative to top-left corner of the window containing the rendering context. This method directly use the Resize method.

See Also

GetWindowRect,Resize,GetWidth,GetHeight,GetViewRect


CKRenderContext::StopFullScreen

Pure Virtual Method Method CKRenderContext::StopFullScreen

virtual CKERROR CKRenderContext::StopFullScreen()

Switches back from FullScreen mode to windowed mode

Returns

CK_OK if successful or an error code.

Remarks

This function restores the previous display mode.

See Also

GoFullScreen,IsFullScreen


CKRenderContext::GetBackgroundMaterial

Pure Virtual Method Method CKRenderContext::GetBackgroundMaterial

virtual CKMaterial* CKRenderContext::GetBackgroundMaterial()

Returns the material used to clear the background.

Returns

A pointer to the CKMaterial used to clear the background.

Remarks

When clearing the backbuffer, if the background material has a texture the backbuffer is filled with this texture otherwise the backbuffer is clear with the material diffuse color.

See Also

Clear


CKRenderContext::SetAmbientLight

Pure Virtual Method Method CKRenderContext::SetAmbientLight

virtual void CKRenderContext::SetAmbientLight(float R,float G,float B)
virtual void CKRenderContext::SetAmbientLight(CKDWORD Color)
virtual CKDWORD CKRenderContext::GetAmbientLight()

Sets or gets the ambient light parameters

Parameters

Input argument R | Red component of ambient light (0..1)
Input argument G | Green component of ambient light (0..1)
Input argument B | Blue component of ambient light (0..1)
Input argument Color | A packed ARGB dword containing the ambient light. Value: The new ambient light stored in ARGB format

Remarks

+The current ambient light stored in a ARGB CKDWORD +The ambient light settings is set at the beginning of each render loop to change it at runtime during a rendering use SetState(VXRENDERSTATE_AMBIENT,Value);


CKRenderContext::SetFogColor

Pure Virtual Method Method CKRenderContext::SetFogColor

virtual void CKRenderContext::SetFogColor(CKDWORD Color)
virtual CKDWORD CKRenderContext::GetFogColor()

Sets or gets the fog color

Parameters

Input argument Color

CKDWORD ARGB fog color.

Returns

Current fog color.

Remarks

The current implementation forces the fog to be in linear mode. The fog render states are set at the beginning of each render loop according to the value given by these methods. To modify the fog parameters at runtime during the rendering loop you must use the appropriate render states (VXRENDERSTATE_FOGENABLE,VXRENDERSTATE_FOGCOLOR,etc...)

See Also

SetFogMode,SetFogStart,SetFogEnd


CKRenderContext::SetFogDensity

Pure Virtual Method Method CKRenderContext::SetFogDensity

virtual void CKRenderContext::SetFogDensity(float Density)
virtual float CKRenderContext::GetFogDensity()

Sets or gets the fog density

Parameters

Input argument Density

Fog density (0..1)

Returns

Current fog density.

Remarks

The fog density is only used in exponential fog modes and is irrelevant otherwise. The current implementation forces the fog to be in linear mode. The fog render states are set at the beginning of each render loop according to the value given by these methods. To modify the fog parameters at runtime during the rendering loop you must use the appropriate render states (VXRENDERSTATE_FOGENABLE,VXRENDERSTATE_FOGCOLOR,etc...)

See Also

SetFogColor,SetFogMode,SetFogStart,SetFogEnd


CKRenderContext::SetFogEnd

Pure Virtual Method Method CKRenderContext::SetFogEnd

virtual void CKRenderContext::SetFogEnd(float End)
virtual float CKRenderContext::GetFogEnd()

Sets or gets the depth at which the fog is at its maximum.

Parameters

Input argument End

Distance at which fog should be maximum.

Remarks

+The start and end distance are only used in linear fog mode. +The current implementation forces the fog to be in linear mode. +The fog render states are set at the beginning of each render loop according to the value given by these methods. +To modify the fog parameters at runtime during the rendering loop you must use the appropriate render states (VXRENDERSTATE_FOGENABLE,VXRENDERSTATE_FOGCOLOR,etc...)

See Also

SetFogMode,SetFogStart,SetFogColor


CKRenderContext::SetFogMode

Pure Virtual Method Method CKRenderContext::SetFogMode

virtual void CKRenderContext::SetFogMode(VXFOG_MODE Mode)
virtual VXFOG_MODE CKRenderContext::GetFogMode()

Sets or gets the fog mode.

Parameters

Input argument Mode

A VXFOG_MODE value to enable or disable fog.

Returns

Current fog mode.

Remarks

The current implementation forces the fog to be in linear mode. The fog render states are set at the beginning of each render loop according to the value given by these methods. To modify the fog parameters at runtime during the rendering loop you must use the appropriate render states (VXRENDERSTATE_FOGENABLE,VXRENDERSTATE_FOGCOLOR,etc...)

See Also

SetFogStart,SetFogEnd,SetFogColor


CKRenderContext::SetFogStart

Pure Virtual Method Method CKRenderContext::SetFogStart

virtual void CKRenderContext::SetFogStart(float Start)
virtual float CKRenderContext::GetFogStart()

Sets or gets the depth at which the fog starts.

Parameters

Input argument Start

Distance at which fog should start.

Remarks

The start and end distance are only used in linear fog mode. The current implementation forces the fog to be in linear mode. The fog render states are set at the beginning of each render loop according to the value given by these methods. To modify the fog parameters at runtime during the rendering loop you must use the appropriate render states (VXRENDERSTATE_FOGENABLE,VXRENDERSTATE_FOGCOLOR,etc...)

See Also

SetFogMode,SetFogEnd,SetFogColor


CKRenderContext::AttachViewpointToCamera

Pure Virtual Method Method CKRenderContext::AttachViewpointToCamera

virtual void CKRenderContext::AttachViewpointToCamera(CKCamera *cam)

Sets the active camera.

Parameters

Input argument cam

A pointer to the CKCamera giving viewpoint information.

Remarks

Once the viewpoint is attached to a camera, it takes its position and orientation every frame. The render context takes the active camera aspect ratio into account to resize the viewport.

See Also

DetachViewpointFromCamera,GetViewpoint,GetAttachedCamera


CKRenderContext::DetachViewpointFromCamera

Pure Virtual Method Method CKRenderContext::DetachViewpointFromCamera

virtual void CKRenderContext::DetachViewpointFromCamera()

Detachs the viewpoint from its camera.

Remarks

Once detached the viewpoint does not follow anymore the position and orientation of the camera it was attached to. The field of view,near plane,far plane settings are those of the last camera attached.

See Also

AttachViewpointToCamera,GetViewpoint,GetAttachedCamera


CKRenderContext::GetAttachedCamera

Pure Virtual Method Method CKRenderContext::GetAttachedCamera

virtual CKCamera *CKRenderContext::GetAttachedCamera()

Returns the camera to which the viewpoint is attached.

Returns

A pointer to the CKCamera to which the viewpoint is attached or NULL.

Remarks

Most of the time the viewpoint is attached to a camera to specify other settings than position and orientation such as Field of view,Clip planes,Aspect ratio,etc...

See Also

AttachViewpointToCamera,GetViewpoint


CKRenderContext::GetViewpoint

Pure Virtual Method Method CKRenderContext::GetViewpoint

virtual CK3dEntity* CKRenderContext::GetViewpoint()

Returns the 3dEntity which represents the viewpoint.

Returns

A pointer to the CK3dEntity which is used as viewpoint.

Remarks

The viewpoint is not a CKCamera. It is only a 3DEntity which position and orientation gives the current viewpoint position. When the viewpoint is attached to a camera through AttachViewpointToCamera its position and orientation are set to the camera settings every frame.

See Also

GetAttachedCamera,AttachViewpointToCamera


CKRenderContext::Cast

Static Object Method CKRenderContext::Cast

static CKRenderContext* CKRenderContext::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKRenderContext::_MatchStereoTextureRightToLeft

Pure Virtual Method Method CKRenderContext::_MatchStereoTextureRightToLeft

virtual void CKRenderContext::_MatchStereoTextureRightToLeft(CKTexture& left, CKTexture& right)

For internal use only. Ensure that the right stereo texture match the left one size and formatanar reflections.


CKRenderContext::FlushPendingGPUCommands

Pure Virtual Method Method CKRenderContext::FlushPendingGPUCommands

virtual BOOL CKRenderContext::FlushPendingGPUCommands()

Wait for any pending rendering command (in GPU) to finish.

Remarks

This method can be called to ensure that all the pending GPU commands (primitive being drawn) are finished before returning. This can be helpful to synchronize multiple computers or to ensure the rendering of an object is finished at a given point but this prevent GPU parallelism for maximum performance.


CKRenderContext::GetStereoRenderMode

Pure Virtual Method Method CKRenderContext::GetStereoRenderMode

virtual CK_STEREO_MODE CKRenderContext::GetStereoRenderMode() const

Get the current Stereo Render mode (possibly none)

Returns

A value from the CK_STEREO_MODE enumerated type


CKRenderContext::GetStereoTextureRightEye

Pure Virtual Method Method CKRenderContext::GetStereoTextureRightEye

virtual CKTexture* CKRenderContext::GetStereoTextureRightEye(const CKTexture* tex) const

Return the right eye for a stereo texture, or NULL is the texture is not stereo, and if it is in debug mode (that is, wether the 'Render In RT View' BB should copy the result of the right eye rendering to the texture second slot, when its 'Update System Memory' flag is on)

Parameters

Input argument tex

A pointer to the texture to test.

Returns

A pointer to the associated right eye, NULL if not found.

Remarks

The render context has ownership over the right eye texture, you should not destroy it. Please use UnregisterStereoTexture instead


CKRenderContext::GetSurfacesVideoMemoryOccupation

Pure Virtual Method Method CKRenderContext::GetSurfacesVideoMemoryOccupation

virtual float CKRenderContext::GetSurfacesVideoMemoryOccupation(int* NbTextures,int* NbSprites,float* TextureSize,float* SpriteSize)

Returns, in bytes, the video memory occupation of the rasterizer surfaces. NbTextures will contain the number of textures in Video memory (including the Sprites sub textures) NbSprites will contain the number of sprites in Video memory TextureSize will contain the Video memory used by textures and sprites (including Render Targets Z buffers) SpriteSize will contain the Video memory used by Sprites

Remarks

This method does not take vertex buffers or index buffers into account. This value does not take other surfaces (Front buffer, Back buffer,Z Buffer) into account. The render Target Zbuffers are shared between the render targets. These render target Zbuffers exists only for the DX9,DX8,DX7 rasterizers


CKRenderContext::IsLost

Pure Virtual Method Method CKRenderContext::IsLost

virtual BOOL CKRenderContext::IsLost()

Determine if the rasterizer is lost or not, if lost then it must be destroyed then re-created


CKRenderContext::IsRenderingShaderBatch

Pure Virtual Method Method CKRenderContext::IsRenderingShaderBatch

virtual CKBOOL CKRenderContext::IsRenderingShaderBatch()


CKRenderContext::IsStereoRenderingLeftEye

Pure Virtual Method Method CKRenderContext::IsStereoRenderingLeftEye

virtual CKBOOL CKRenderContext::IsStereoRenderingLeftEye()

For internal use only. Test whether current stereo rendering is performed on left eye.

Returns

TRUE if current stereo render is done for left eye.


CKRenderContext::IsStereoTexture

Pure Virtual Method Method CKRenderContext::IsStereoTexture

virtual CKBOOL CKRenderContext::IsStereoTexture(const CKTexture* tex) const

Check whether a texture has been registered as a stereo texture.

Parameters

Input argument tex

A pointer to the texture to test.

Returns

TRUE if the texture has been registered as a stereo texture.


CKRenderContext::MatchRightEyeToLeftEyeStereoTexturePairs

Pure Virtual Method Method CKRenderContext::MatchRightEyeToLeftEyeStereoTexturePairs

virtual void CKRenderContext::MatchRightEyeToLeftEyeStereoTexturePairs()

Make sure that all right eye texture match the left eye texture dimension and format, update them if necessary

Remarks

This method is automatically called by the 'Render Scene In RT View' BB.


CKRenderContext::OverrideMaterial

Pure Virtual Method Method CKRenderContext::OverrideMaterial

virtual CKBOOL CKRenderContext::OverrideMaterial(CKMaterial* initialMat, OverridenMaterial& om) const


CKRenderContext::RegisterStereoTexture

Pure Virtual Method Method CKRenderContext::RegisterStereoTexture

virtual void CKRenderContext::RegisterStereoTexture(CKTexture* tex)

Register a stereo texture. Such a texture pair will be 'swapped' when rendering right eye a stereo view (anaglyph mode, checkerboard mode ...), then 'swapped' again. The render context has ownership for the counterpart texture. When doing a 'render in RT view', if a texture is part of a stereo pair, then both textures will be rendered.

Parameters

Input argument tex

A pointer to the texture that is to be registered.


CKRenderContext::ScreenToCamera

Pure Virtual Method Method CKRenderContext::ScreenToCamera

virtual void CKRenderContext::ScreenToCamera(const Vx2DVector& i2DPosition, VxVector* o3DPosition, CKCamera* camera, CKBOOL iScreen = TRUE)


CKRenderContext::SetOverriddenRendering

Pure Virtual Method Method CKRenderContext::SetOverriddenRendering

virtual void CKRenderContext::SetOverriddenRendering(CK_OVERRIDE_RENDERING Or, CKMaterial* mat = NULL, const char* pass = NULL)

Overrides the rendering of objects.

Remarks

This method enables to override the way objects are drawn during a CKRenderContext::DrawScene operation. Object Materials can be ignored,replaced by a unique material or a specific pass can be used when rendering object using material effects.

See Also

CK_OVERRIDE_RENDERING,CKMaterial,CKShader,Shaders and Effects


CKRenderContext::SetStereoRenderMode

Pure Virtual Method Method CKRenderContext::SetStereoRenderMode

virtual void CKRenderContext::SetStereoRenderMode(CK_STEREO_MODE iMode)

For internal use only. Set the current stereo render mode

Parameters

Input argument iMode

The new stereo mode


CKRenderContext::SetUpdate2DProjEnableFlag

Pure Virtual Method Method CKRenderContext::SetUpdate2DProjEnableFlag

virtual void CKRenderContext::SetUpdate2DProjEnableFlag(BOOL enable)


CKRenderContext::SetValuesOfUsedAutomatics

Pure Virtual Method Method CKRenderContext::SetValuesOfUsedAutomatics

virtual void CKRenderContext::SetValuesOfUsedAutomatics( CKShader& iFx,
CKMaterial* iMat,
CKMaterialShader* iMatShader,
CK3dEntity* iEnt )

Set values of all automatic parameters used by the “iFx” shader.

Remarks

Those values will be computed from “iMat” naterial (ex: for Diffuse or Texture), But also from “iEnt” entity (ex: for WORLD matrix), and the render context which is retrieved the shader manager. (ex: for VIEW matrix or EYEPOS vector)

Note that the Rasterizer's current TransformMatrix will be set to the world matrix of “iEnt”, or set to identity if “iEnt” is NULL. ModelViewMatrix and TotalMatrix are also recomputed.


CKRenderContext::SwapStereoTexturePairs

Pure Virtual Method Method CKRenderContext::SwapStereoTexturePairs

virtual void CKRenderContext::SwapStereoTexturePairs()

Swap all registered stereo texture pairs. (right become left, and left become right) The swapping occurs on the CKTexture internal members, using CKtexture::Swap, so it is transparent for any render using them. (this implies also, that no pixels are copied) Usually, such a call will be done before and after rendering a right-eye view that display planar reflections.

Remarks

This method is automatically called by the 'Render Scene In RT View' BB.


CKRenderContext::UnregisterAllStereoTextures

Pure Virtual Method Method CKRenderContext::UnregisterAllStereoTextures

virtual void CKRenderContext::UnregisterAllStereoTextures()

Unregister a stereo texture. This will remove the associated right eye texture.


CKRenderContext::UnregisterStereoTexture

Pure Virtual Method Method CKRenderContext::UnregisterStereoTexture

virtual void CKRenderContext::UnregisterStereoTexture(CKTexture* tex)

Unregister a stereo texture. This will remove the associated right eye texture.

Parameters

Input argument tex

A pointer to the texture that is to be registered.


CKRenderContext::Pick

Pure Virtual Method Method CKRenderContext::Pick

virtual CKRenderObject* CKRenderContext::Pick(int x,int y,VxIntersectionDesc* oRes,CKBOOL iIgnoreUnpickable = FALSE)

Returns information about object at a specific position.

Parameters

Input argument x | X coordinate (in context window coordinates).
Input argument y | Y coordinate (in context window coordinates). res: A pointer to a VxIntersectionDesc which will be filled with additional information (Face,Normal,Texture coordinates...)

Returns

A pointer to the CKRenderObject at specified position or NULL if no such object exists.

Remarks

Picking is done by calculating the intersection between a ray from viewpoint to screen position and all the objects in the scene. It uses the information from the last rendering to determines the list of objects that should be tested.

See Also

RectPick,Pick2D


CKRenderContext::Pick2D

Pure Virtual Method Method CKRenderContext::Pick2D

virtual CK2dEntity* CKRenderContext::Pick2D(const Vx2DVector& v)

Returns information about 2D entities at a specific position.

Parameters

Input argument v

A Vx2DVector containing the position in context window coordinates.

Returns

A pointer to the CK2dEntity at specified position or NULL if no such object exists.

Remarks

This method only test the 2D Entities (sprites,..) and returns the 2D Entity under the given position with the highest Z-order.

See Also

RectPick,Pick


CKRenderContext::RectPick

Pure Virtual Method Method CKRenderContext::RectPick

virtual CKERROR CKRenderContext::RectPick(const VxRect& r,XObjectPointerArray& oObjects,CKBOOL Intersect=TRUE)

Returns the list of objects contained in a rectangle.

Parameters

Input argument r | A VxRect giving the coordinates of the picking rectangle (in context window coordinates).
Input argument Intersect | Specifies whether objects must be entirely inside rectangle r to be listed. res: A pointer to a CKObjectArray that will be filled with the objects.

Returns

CK_OK if successful or an error code otherwise.

See Also

Pick


CKRenderContext::CK_ANAGLYPH_MODE

Enumerated Type CKRenderContext::CK_ANAGLYPH_MODE

enum CK_ANAGLYPH_MODE {
CK_ANAGLYPH_GRAY,
CK_ANAGLYPH_COLOR,
CK_ANAGLYPH_HALFCOLOR,
CK_ANAGLYPH_OPTIMIZED,
CK_ANAGLYPH_MANUAL
}

When the render context is in anaglyph mode, specify the kind of anaglyph to be used

Members

CK_ANAGLYPH_COLOR |
CK_ANAGLYPH_GRAY | CK_ANAGLYPH_TRUE,
CK_ANAGLYPH_HALFCOLOR |
CK_ANAGLYPH_MANUAL |
CK_ANAGLYPH_OPTIMIZED |


CKRenderContext::CK_STEREO_MODE

Enumerated Type CKRenderContext::CK_STEREO_MODE

enum CK_STEREO_MODE {
CK_STEREO_DEFAULT ,
CK_STEREO_LEFT ,
CK_STEREO_RIGHT ,
CK_STEREO_ACTIVE,
CK_STEREO_ANAGLYPH,
CK_STEREO_CHECKERBOARD
}

Specify the current type of stereo render mode

Members

CK_STEREO_ACTIVE
CK_STEREO_ANAGLYPH
CK_STEREO_CHECKERBOARD
CK_STEREO_DEFAULT
CK_STEREO_LEFT
CK_STEREO_RIGHT


CKRenderContext::AddPostRenderCallBack

Pure Virtual Method Method CKRenderContext::AddPostRenderCallBack

virtual void CKRenderContext::AddPostRenderCallBack(CK_RENDERCALLBACK Function,void *Argument,CKBOOL Temporary = FALSE,CKBOOL BeforeTransparent = FALSE)
virtual void CKRenderContext::RemovePostRenderCallBack(CK_RENDERCALLBACK Function,void *Argument)

Adds or removes a function to call after 3D rendering is done and before sprites are drawn.

Parameters

A void pointer that will be passed as argument to the function.

Remarks

See Understanding the Render Loop paper for more information on when callbacks function are called.

See Also

AddPreRenderCallBack,AddPostSpriteRenderCallBack


CKRenderContext::AddPostSpriteRenderCallBack

Pure Virtual Method Method CKRenderContext::AddPostSpriteRenderCallBack

virtual void CKRenderContext::AddPostSpriteRenderCallBack(CK_RENDERCALLBACK Function,void *Argument,CKBOOL Temporary = FALSE)
virtual void CKRenderContext::RemovePostSpriteRenderCallBack(CK_RENDERCALLBACK Function,void *Argument)

Adds or removes a callback to be called after the foreground sprites rendering.

Parameters

A void pointer that will be passed as argument when calling Function.

Remarks

See Understanding the Render Loop paper for more details on the rendering operations.

See Also

Understanding the Render Loop,AddPostRenderCallBack,AddPreRenderCallBack


CKRenderContext::AddPreRenderCallBack

Pure Virtual Method Method CKRenderContext::AddPreRenderCallBack

virtual void CKRenderContext::AddPreRenderCallBack(CK_RENDERCALLBACK Function,void *Argument,CKBOOL Temporary = FALSE)
virtual void CKRenderContext::RemovePreRenderCallBack(CK_RENDERCALLBACK Function,void *Argument)

Adds or removes a function to call before rendering begins.

Parameters

A void pointer that will be passed as argument to the function.

Remarks

See Understanding the Render Loop paper for more information on when callbacks function are called.

See Also

AddPostRenderCallBack,AddPostSpriteRenderCallBack


CKRenderContext::CopyToVideo

Pure Virtual Method Method CKRenderContext::CopyToVideo

virtual int CKRenderContext::CopyToVideo(const VxRect* iRect,VXBUFFER_TYPE buffer,VxImageDescEx& desc)

Copies an image to the specified video buffer (Back or Z )

Parameters

Input argument buffer | buffer to which copy should be done can be either VXBUFFER_BACKBUFFER or VXBUFFER_ZBUFFER
Input argument desc | A pointer to a VxImageDescEx giving the format in which image data was stored.Must not be NULL.

Returns

The size of the resultant buffer or 0 if an error occured.

Remarks

The desc parameter must contain information about image format. If the image stored in data does not have the same format than the video buffer the function will fail and return 0. In the same manner the size of the source image (as given in desc) must be the same that the destination rectangle.

See Also

CopyFromBuffer,DumpTo


CKRenderContext::DumpToFile

Pure Virtual Method Method CKRenderContext::DumpToFile

virtual CKERROR CKRenderContext::DumpToFile(CKSTRING filename,const VxRect* rect,VXBUFFER_TYPE buffer)

Saves the content of a video-buffer to the disk.

Parameters

Input argument filename | Filename of the bitmap file to save.
Input argument rect | A pointer to a VxRect specifiyng which part of the buffer should be saved. A NULL parameter takes the whole buffer.
Input argument buffer | Video buffer to save (can be back or depth buffer).

Returns

CK_OK if successful or an error code otherwise.

Remarks

DumpToFile locks the specified buffer and writes its data into a bitmap file. The file format can be of any type supported by Virtools but the extension must be given. If AntiAliasing is enabled, the back buffer can not be dumped

See Also

DumpToMemory


CKRenderContext::DumpToMemory

Pure Virtual Method Method CKRenderContext::DumpToMemory

virtual int CKRenderContext::DumpToMemory(const VxRect* iRect,VXBUFFER_TYPE buffer,VxImageDescEx& desc)

Creates an image from the specified video buffer (Back or Z ).

Parameters

Input argument buffer | Buffer from which copy should be done can be either VXBUFFER_BACKBUFFER or VXBUFFER_ZBUFFER
Input argument desc | A reference to a VxImageDescEx giving the format in which image data will be stored.

Returns

The size of the resultant buffer.

Remarks

First call this function with a desc.Image set to NULL to get the size of the buffer. You can then allocate your data buffer and call the function again with this parameter. If AntiAliasing is enabled, the back buffer can not be dumped

Example

       VxImageDescEx ImgDesc;
       BYTE* ImgBuffer = NULL;

       int ImageSize = rdctx->DumpToMemory(NULL,VXBUFFER_BACKBUFFER,ImgDesc);
       if (ImageSize) {
           ImgBuffer = new BYTE[ImageSize];
           ImgDesc.Image = ImgBuffer;

           rdctx->DumpToMemory(NULL,VXBUFFER_BACKBUFFER,ImgDesc);
       }

ImgDesc now contain the description (size and pixel format) of the image
and ImgDesc.Image contains the image pixels...

See Also

CopyToVideo,DumpToFile


CKRenderContext::GetBoundingBox

Pure Virtual Method Method CKRenderContext::GetBoundingBox

virtual void CKRenderContext::GetBoundingBox(VxBbox *BBox)

Returns the bounding box of every objects referenced in the context.

Parameters

box : A pointer to a VxBbox that will contain the extents of all the objects.

Remarks

This method computes the bounding box from the list of all the objects attached to the rendercontext. Computing this bounding box may be a slow operation especially if there is a great number of objects.

See Also

VxBbox,CK3dEntity::GetBoundingBox,CK3dEntity::GetHierarchicalBox


CKRenderContext::GetDirectXInfo

Pure Virtual Method Method CKRenderContext::GetDirectXInfo

virtual VxDirectXData* CKRenderContext::GetDirectXInfo()

Returns pointers to the DirectX objects.

Returns

A pointer to a VxDirectXData that contain the pointers to the DirectDraw and Direct3D objects.

Remarks

When using a DirectX based rasterizer, one can access the DirectDraw and Direct3D objects through this method.

See Also

VxDirectXData


CKRenderContext::GetDrawPrimitiveIndices

Pure Virtual Method Method CKRenderContext::GetDrawPrimitiveIndices

virtual CKWORD* CKRenderContext::GetDrawPrimitiveIndices(int IndicesCount)

Returns a pre-allocated list of indices

Returns

A pointer to an array of WORD.

Remarks

Returns a pre-allocated array of WORD to be filled with indices for primitives to be drawn with DrawPrimitive method.

See Also

Custom Rendering,GetDrawPrimitiveStructure,DrawPrimitive


CKRenderContext::GetDrawPrimitiveStructure

Pure Virtual Method Method CKRenderContext::GetDrawPrimitiveStructure

virtual VxDrawPrimitiveData* CKRenderContext::GetDrawPrimitiveStructure(CKRST_DPFLAGS Flags,int VertexCount)

Returns a pre-allocated VxDrawPrimitive structure

Parameters

Input argument Flags | A CKRST_DPFLAGS enumeration specifying the type of
Input argument VertexCount | Number of vertices to allocate.

Returns

A pointer to a VxDrawPrimitiveData structure that holds the data.

Remarks

To avoid re-allocation of memory each time user primitives are to be drawn this method returns a preallocated vertex pool that grows according to vertex count. According to the format flags the returned VxDrawPrimitiveData structure is ready to be use with the DrawPrimitive method : vertex count,vertex format and transformation,clipping,lighting flags are set. If the flags CKRST_DP_VBUFFER is set and the current context supports vertex buffers,the returned structure will point to a vertex buffer. The returned pointers must not be kept and should only be used to fill up the vertex data. Once the data have been set the vertex buffer must be unlocked before any call to DrawPrimitive via the ReleaseCurrentVB method. To see if the returned structure effectively points to a vertex buffer, check that the CKRST_DP_VBUFFER is present in the structure m_Flags member. Using vertex buffers enable you to directly write in driver optimal memory and avoid the overead of a recopy in temporary system memory. When using vertex buffers one should take care of filling up the vertex data in a sequential manner and avoid random write access to the returned memory pointers.

See Also

Custom Rendering,GetDrawPrimitiveIndices,LockCurrentVB,ReleaseCurrentVB,CKRST_DPFLAGS,VxDrawPrimitiveData,DrawPrimitive


CKRenderContext::GetRasterizerContext

Pure Virtual Method Method CKRenderContext::GetRasterizerContext

virtual CKRasterizerContext* CKRenderContext::GetRasterizerContext()

Gets the rasterization context.

Returns

A pointer to a CKRasterizerContext.

Remarks

This method is specific to the Virtools implementation of the render engine. It gives acces to the low-level rasterizer object. To use this object include the header files in CKRasterizerLib project given in the render engine source code.

See Also

Available Source Code


CKRenderContext::GetStats

Pure Virtual Method Method CKRenderContext::GetStats

virtual void CKRenderContext::GetStats(VxStats* stats)

Returns statistics about the last rendered frame .

Parameters

Input argument stats

A pointer to a VxStats structure to be filled.

Remarks

The number of Objects,faces,lines and vertices drawn during one frame can be retrieved though this method. The VxStats structure also contains profiling results of the time spent during the last render loop.

See Also

VxStats


CKRenderContext::LockCurrentVB

Pure Virtual Method Method CKRenderContext::LockCurrentVB

virtual VxDrawPrimitiveData* CKRenderContext::LockCurrentVB(CKDWORD VertexCount)
virtual BOOL CKRenderContext::ReleaseCurrentVB()

Gets write access to the latest allocated vertex buffer

Returns

A pointer to a VxDrawPrimitiveData containing the vertex buffer data.

Remarks

After a successful call to GetDrawPrimitiveStructure with CKRST_DP_VBUFFER flag set the returned pointers point to a vertex buffer which must be released with ReleaseCurrentVB before any rendering can occur. This method returns a pointer to a VxDrawPrimitiveData structure ( pointing to a vertex buffer) that can be used to update vertex data. ReleaseCurrentVB must be called once the data have been written.

A typical usage of this mehod is for users who want to render the same geometry twice and change only a subset of data between the two calls to draw primitive. Such a technique would look like

DataPtr

GetDrawPrimitiveStructure(Flags | CKRST_DP_VBUFFER...) //.. Fill vertex data //...............

DrawPrimitive(DataPtr);

            if (DataPtr->m_Flags & CKRST_DP_VBUFFER) {
                .. Returned pointer was a vertex buffer we must lock it before writting again
                LockCurrentVB()
            }

.. Fill vertex data ...

            if (DataPtr->m_Flags & CKRST_DP_VBUFFER) {
                .. Returned pointer was effectively a vertex buffer we must release it
                ReleaseCurrentVB()
            }

DrawPrimitive(DataPtr);

See Also

Custom Rendering,GetDrawPrimitiveStructure,VxDrawPrimitiveData,DrawPrimitive,CKVertexBuffer


CKRenderContext::ScreenToClient

Pure Virtual Method Method CKRenderContext::ScreenToClient

virtual void CKRenderContext::ScreenToClient(Vx2DVector* ioPoint)
virtual void CKRenderContext::ClientToScreen(Vx2DVector* ioPoint)

Converts screen coordinates to render context window coordinates

Parameters

pt: A pointer to Vx2DVector structure to convert.

See Also

GetWindowHandle


CKRenderContext::Transform

Pure Virtual Method Method CKRenderContext::Transform

virtual void CKRenderContext::Transform(VxVector *Dest,VxVector *Src,CK3dEntity *Ref=NULL)

Transform vertices to screen coordinates.

Parameters

Input argument Dest | A pointer to a VxVector that will be filled with the screen coordinates of Src
Input argument Src | A pointer to the VxVector to transform.
Input argument Ref | A optionnal pointer to CK3dEntity which is the referential in which Src is taken. If NULL Transform uses the current World Transformation Matrix.

Remarks

If no referential is given Transform takes the current world transformation (See SetWorldTransformationMatrix) matrix when converting from model coordinates to screen coordinates. If several vertices should be transformed use TransformVertices instead of this method.

See Also

TransformVertices,SetWorldTransformationMatrix,CK3dEntity


CKRenderContext::TransformVertices

Pure Virtual Method Method CKRenderContext::TransformVertices

virtual void CKRenderContext::TransformVertices(int VertexCount,VxTransformData* data,CK3dEntity *Ref=NULL)

Transforms an array of vertices to screen coordinates

Parameters

Input argument VertexCount | Number of vertices to transform
Input argument data | A pointer to a VxTransformData that describes the vectors to transform.
Input argument Ref | A optionnal pointer to CK3dEntity which is the referential from which . If NULL TransformVertices uses the current World Transformation Matrix.

Remarks

o If no referential is given Transform takes the current world transformation matrix for converting from model coordinates to screen coordinates

o The VxTransformData structure stores the pointer to the source vectors to transform and the results homogenous and/or screen coordinates. It can also contain a pointer to a list of clipping flags indicating the clipping status of every transformed vector.

See Also

Transform,VxTransformData,SetWorldTransformationMatrix,CK3dEntity


CKRenderContext::WarnEnterThread

Pure Virtual Method Method CKRenderContext::WarnEnterThread

virtual void CKRenderContext::WarnEnterThread()
virtual void CKRenderContext::WarnExitThread()

Multi thread specific

Remarks

Some rasterizers (OpenGL) functions will failed if called from 2 differents threads without changing the active thread before calling them. In a multi-thread application where more than one thread may access a render context you need to call these methods before and after any other methods if you are not in the thread that created the render context.


CKRenderContext::GetUserClipPlane

Pure Virtual Method Method CKRenderContext::GetUserClipPlane

virtual CKBOOL CKRenderContext::GetUserClipPlane(CKDWORD ClipPlaneIndex,VxPlane& PlaneEquation)

Returns a user clip plane equation

Returns

TRUE if successful,FALSE otherwise.

Remarks

The plane equation is given in world coordinates.

See Also

GetUserClipPlane,SetState,VXRENDERSTATE_CLIPPLANEENABLE


CKRenderContext::SetUserClipPlane

Pure Virtual Method Method CKRenderContext::SetUserClipPlane

virtual CKBOOL CKRenderContext::SetUserClipPlane(CKDWORD ClipPlaneIndex,const VxPlane& PlaneEquation)

Sets a user clip plane equation

Returns

TRUE if successful.

Remarks

The plane equation must be given in world coordinates. A clip plane must be enabled with the render state VXRENDERSTATE_CLIPPLANEENABLE: to enable the clip plane 0(1),1(2) and 3(8) one must set SetState(VXRENDERSTATE_CLIPPLANEENABLE,0xB); Not all drivers support user clip planes, you should check the MaxClipPlanes member of Vx3DCapsDesc before using them.

See Also

GetUserClipPlane,SetState,VXRENDERSTATE_CLIPPLANEENABLE


CKRenderManager

Class CKRenderManager

Manages all rendering contexts.

CKBaseManager
Show brief derivation trees

CKRenderManager

CKBaseManager
Show full derivation trees

CKRenderManager

Remarks

CKRenderManager stores a list of all render context and provides methods to render all of them, to create new ones or to destroy existing contexts.

At startup the available drivers are enumerated and can be retrieve along with their capabilities. There can be more than one driver per video card according to the installed rasterizers (OpenGL,DirectX or other..) which can propose themselves several sub drivers (Transform& Lighting, Hardware or Software rasterizers).

The unique instance of the RenderManager can accessed through the CKContext::GetRenderManager() method.

Groups

Debugging | Drivers | Effects | Render Contextes | Rendering | Settings | Textures | Vertex buffers

Debugging
Pure Virtual Method Method DrawAABB | Draw a bounding box, in the given referential.
Pure Virtual Method Method DrawFillRectangle | Draw a filled rectangle, in window coordinates.
Pure Virtual Method Method DrawFrustum | Draw a frustum, in the given referential.
Pure Virtual Method Method DrawNormal | Draw a normal vector (a ray), in the given referential.
Pure Virtual Method Method DrawParabolic | Draw a parabolic curve, in the given referential.
Pure Virtual Method Method DrawPlane | Draw a 3D plane, in the given referential.
Pure Virtual Method Method DrawPoint | Draw a 3D point, in the given referential.
Pure Virtual Method Method DrawPoint2D | Draw a 2D point, in window coordinates.
Pure Virtual Method Method DrawRectangle | Draw a hollow rectangle, in window coordinates.
Pure Virtual Method Method DrawSphere | Draw a sphere, in the given referential.
Pure Virtual Method Method DrawText | Draw a text string, in window coordinates.
Pure Virtual Method Method RegisterAABB | Register the drawing of a bounding box, in the given referential.
Pure Virtual Method Method RegisterFillRectangle | Register the drawing of a filled rectangle, in window coordinates.
Pure Virtual Method Method RegisterFrustum | Register the drawing of a frustum, in the given referential.
Pure Virtual Method Method RegisterNormal | Register the drawing of a normal vector (a ray), in the given referential.
Pure Virtual Method Method RegisterParabolic | Register the drawing of a parabolic curve, in the given referential.
Pure Virtual Method Method RegisterPlane | Register the drawing of a 3D plane, in the given referential.
Pure Virtual Method Method RegisterPoint | Register the drawing of a 3D point, in the given referential.
Pure Virtual Method Method RegisterPoint2D | Register the drawing of a 2D point, in window coordinates.
Pure Virtual Method Method RegisterRectangle | Register the drawing of a hollow rectangle, in window coordinates.
Pure Virtual Method Method RegisterSphere | Register the drawing of a sphere, in the given referential.
Pure Virtual Method Method RegisterText | Register the drawing of a text string, in window coordinates.
Drivers
Pure Virtual Method Method GetRenderDriverCount | Gets the number of render drivers.
Pure Virtual Method Method GetRenderDriverDescription | Gets render driver description
Effects
Pure Virtual Method Method AddEffect | Returns the number of registred effects.
Pure Virtual Method Method GetEffectCount | Returns the number of registred effects.
Pure Virtual Method Method GetEffectDescription | Returns a description for a given effect
Render Contextes
Pure Virtual Method Method CreateRenderContext | Creates a new render context
Pure Virtual Method Method DestroyRenderContext | Destroys a render context.
Pure Virtual Method Method GetRenderContext | Gets a render context given its index.
Pure Virtual Method Method GetRenderContextCount | Gets the number of render contexts.
Pure Virtual Method Method GetRenderContextFromPoint | Gets a render context under a screen position.
Pure Virtual Method Method RemoveRenderContext | Removes a render context.
Rendering
Pure Virtual Method Method Process | Renders all the render contextes.
Settings
Pure Virtual Method Method SetRenderOptions | Sets render engine settings.
Textures
Pure Virtual Method Method FlushTextures | Removes all the textures and sprites from video memory.
Pure Virtual Method Method GetDesiredTexturesVideoFormat | Gets the desired pixel format for textures in video memory
Pure Virtual Method Method SetDesiredTexturesVideoFormat | Sets the desired pixel format for textures in video memory
Vertex buffers
Pure Virtual Method Method CreateVertexBuffer | Creates a new vertex buffer
Pure Virtual Method Method DestroyVertexBuffer | Destroys a vertex buffer.

See Also

CKContext::GetRenderManager,CKRenderContext


CKRenderManager::DrawAABB

Pure Virtual Method Method CKRenderManager::DrawAABB

virtual void CKRenderManager::DrawAABB(CKRenderContext* iRC, const VxBbox& iBox, const CKDWORD iColor, const VxMatrix* iTransform = NULL)

Draw a bounding box, in the given referential.

Parameters

Input argument iRC | the render context in which to draw
Input argument iBox | the box to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

See Also

RegisterAABB


CKRenderManager::DrawFillRectangle

Pure Virtual Method Method CKRenderManager::DrawFillRectangle

virtual void CKRenderManager::DrawFillRectangle(CKRenderContext* iRC, const VxRect& iRect, const CKDWORD iColor)

Draw a filled rectangle, in window coordinates.

Parameters

Input argument iRC | the render context in which to draw iRectangle : the rectangle to draw
Input argument iColor | the color to use

See Also

RegisterFillRectangle


CKRenderManager::DrawFrustum

Pure Virtual Method Method CKRenderManager::DrawFrustum

virtual void CKRenderManager::DrawFrustum(CKRenderContext* iRC, const VxFrustum& iFrustum, const CKDWORD iColor, const VxMatrix* iTransform = NULL)

Draw a frustum, in the given referential.

Parameters

Input argument iRC | the render context in which to draw
Input argument iFrustum | the frustum to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

See Also

RegisterFrustum


CKRenderManager::DrawNormal

Pure Virtual Method Method CKRenderManager::DrawNormal

virtual void CKRenderManager::DrawNormal(CKRenderContext* iRC, const VxRay& iRay, const CKDWORD iColor, const VxMatrix* iTransform = NULL)

Draw a normal vector (a ray), in the given referential.

Parameters

Input argument iRC | the render context in which to draw
Input argument iRay | the ray to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

See Also

RegisterNormal


CKRenderManager::DrawParabolic

Pure Virtual Method Method CKRenderManager::DrawParabolic

virtual void CKRenderManager::DrawParabolic(CKRenderContext* iRC, const VxVector& iStartPos,const VxVector& iSpeed, const VxVector& iAcceleration, float iDrawingTime, const int iSubdivisions, const CKDWORD iColor, const VxMatrix* iTransform = NULL)

Draw a parabolic curve, in the given referential.

Parameters

Input argument iRC | the render context in which to draw
Input argument iStartPos | the starting position of the curve
Input argument iSpeed | the speed of the curve
Input argument iAcceleration | the acceleration of the curve
Input argument iDrawingTime | the length of the curve to draw
Input argument iSubdivisions | number of subdivisions of the primitive
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

See Also

RegisterParabolic


CKRenderManager::DrawPlane

Pure Virtual Method Method CKRenderManager::DrawPlane

virtual void CKRenderManager::DrawPlane(CKRenderContext* iRC, const VxPlane& iPlane, const VxVector& iPoint, const CKDWORD iColor, const VxMatrix* iTransform = NULL)

Draw a 3D plane, in the given referential.

Parameters

Input argument iRC | the render context in which to draw
Input argument iPlane | the plane to draw
Input argument iPoint | a 3D point which the plane to draw intersect
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

See Also

RegisterPlane


CKRenderManager::DrawPoint

Pure Virtual Method Method CKRenderManager::DrawPoint

virtual void CKRenderManager::DrawPoint(CKRenderContext* iRC, const VxVector& iPoint, const CKDWORD iColor, const VxMatrix* iTransform = NULL)

Draw a 3D point, in the given referential.

Parameters

Input argument iRC | the render context in which to draw
Input argument iPoint | the point to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

See Also

RegisterPoint


CKRenderManager::DrawPoint2D

Pure Virtual Method Method CKRenderManager::DrawPoint2D

virtual void CKRenderManager::DrawPoint2D(CKRenderContext* iRC, const Vx2DVector& iPoint, const CKDWORD iColor)

Draw a 2D point, in window coordinates.

Parameters

Input argument iRC | the render context in which to draw
Input argument iPoint | the point to draw
Input argument iColor | the color to use

See Also

RegisterPoint2D


CKRenderManager::DrawRectangle

Pure Virtual Method Method CKRenderManager::DrawRectangle

virtual void CKRenderManager::DrawRectangle(CKRenderContext* iRC, const VxRect& iRect, const CKDWORD iColor)

Draw a hollow rectangle, in window coordinates.

Parameters

Input argument iRC | the render context in which to draw iRectangle : the rectangle to draw
Input argument iColor | the color to use

See Also

RegisterRectangle


CKRenderManager::DrawSphere

Pure Virtual Method Method CKRenderManager::DrawSphere

virtual void CKRenderManager::DrawSphere(CKRenderContext* iRC, const VxSphere& iSphere, const CKDWORD iColor, const VxMatrix* iTransform = NULL, const int iSubdivisions=32)

Draw a sphere, in the given referential.

Parameters

Input argument iRC | the render context in which to draw
Input argument iSphere | the sphere to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive
Input argument iSubdivisions | number of subdivisions of the primitive

See Also

RegisterSphere


CKRenderManager::DrawText

Pure Virtual Method Method CKRenderManager::DrawText

virtual void CKRenderManager::DrawText(CKRenderContext* iRC, const Vx2DVector& iPoint, const char* iText, const CKDWORD iColor)

Draw a text string, in window coordinates.

Parameters

Input argument iRC | the render context in which to draw
Input argument iPoint | the location of the string to draw
Input argument iText | the text to draw
Input argument iColor | the color to use

See Also

RegisterText


CKRenderManager::RegisterAABB

Pure Virtual Method Method CKRenderManager::RegisterAABB

virtual void CKRenderManager::RegisterAABB(const VxBbox& iBox, const CKDWORD iColor, float iRemainingTime = 0.0f, const VxMatrix* iTransform = NULL)

Register the drawing of a bounding box, in the given referential.

Parameters

Input argument iBox | the box to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

Remarks

The primitive will be draw during the post render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawAABB


CKRenderManager::RegisterFillRectangle

Pure Virtual Method Method CKRenderManager::RegisterFillRectangle

virtual void CKRenderManager::RegisterFillRectangle(const VxRect& iRect, const CKDWORD iColor, float iRemainingTime = 0.0f)

Register the drawing of a filled rectangle, in window coordinates.

Parameters

Input argument iColor

the color to use

Remarks

The primitive will be draw during the post sprite render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawFillRectangle


CKRenderManager::RegisterFrustum

Pure Virtual Method Method CKRenderManager::RegisterFrustum

virtual void CKRenderManager::RegisterFrustum(const VxFrustum& iFrustum, const CKDWORD iColor, float iRemainingTime = 0.0f, const VxMatrix* iTransform = NULL)

Register the drawing of a frustum, in the given referential.

Parameters

Input argument iFrustum | the frustum to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

Remarks

The primitive will be draw during the post render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawFrustum


CKRenderManager::RegisterNormal

Pure Virtual Method Method CKRenderManager::RegisterNormal

virtual void CKRenderManager::RegisterNormal(const VxRay& iRay, const CKDWORD iColor, float iRemainingTime = 0.0f, const VxMatrix* iTransform = NULL)

Register the drawing of a normal vector (a ray), in the given referential.

Parameters

Input argument iRay | the ray to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

Remarks

The primitive will be draw during the post render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawNormal


CKRenderManager::RegisterParabolic

Pure Virtual Method Method CKRenderManager::RegisterParabolic

virtual void CKRenderManager::RegisterParabolic(const VxVector& iStartPos,const VxVector& iSpeed, const VxVector& iAcceleration, float iDrawingTime, const int iSubdivisions, const CKDWORD iColor,float iRemainingTime = 0.0f, const VxMatrix* iTransform = NULL)

Register the drawing of a parabolic curve, in the given referential.

Parameters

Input argument iStartPos | the starting position of the curve
Input argument iSpeed | the speed of the curve
Input argument iAcceleration | the acceleration of the curve
Input argument iDrawingTime | the length of the curve to draw
Input argument iSubdivisions | number of subdivisions of the primitive
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

Remarks

The primitive will be draw during the post render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawParabolic


CKRenderManager::RegisterPlane

Pure Virtual Method Method CKRenderManager::RegisterPlane

virtual void CKRenderManager::RegisterPlane(const VxPlane& iPlane,const VxVector& iPoint, const CKDWORD iColor, float iRemainingTime = 0.0f, const VxMatrix* iTransform = NULL)

Register the drawing of a 3D plane, in the given referential.

Parameters

Input argument iPlane | the plane to draw
Input argument iPoint | a 3D point which the plane to draw intersect
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

Remarks

The primitive will be draw during the post render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawPlane


CKRenderManager::RegisterPoint

Pure Virtual Method Method CKRenderManager::RegisterPoint

virtual void CKRenderManager::RegisterPoint(const VxVector& iPoint, const CKDWORD iColor, float iRemainingTime = 0.0f, const VxMatrix* iTransform = NULL)

Register the drawing of a 3D point, in the given referential.

Parameters

Input argument iPoint | the point to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive

Remarks

The primitive will be draw during the post render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawPoint


CKRenderManager::RegisterPoint2D

Pure Virtual Method Method CKRenderManager::RegisterPoint2D

virtual void CKRenderManager::RegisterPoint2D(const Vx2DVector& iPoint, const CKDWORD iColor, float iRemainingTime = 0.0f)

Register the drawing of a 2D point, in window coordinates.

Parameters

Input argument iPoint | the point to draw
Input argument iColor | the color to use

Remarks

The primitive will be draw during the post sprite render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawPoint2D


CKRenderManager::RegisterRectangle

Pure Virtual Method Method CKRenderManager::RegisterRectangle

virtual void CKRenderManager::RegisterRectangle(const VxRect& iRect, const CKDWORD iColor, float iRemainingTime = 0.0f)

Register the drawing of a hollow rectangle, in window coordinates.

Parameters

Input argument iColor

the color to use

Remarks

The primitive will be draw during the post sprite render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawRectangle


CKRenderManager::RegisterSphere

Pure Virtual Method Method CKRenderManager::RegisterSphere

virtual void CKRenderManager::RegisterSphere(const VxSphere& iSphere, const CKDWORD iColor, float iRemainingTime = 0.0f, const VxMatrix* iTransform = NULL, const int iSubdivisions=32)

Register the drawing of a sphere, in the given referential.

Parameters

Input argument iSphere | the sphere to draw
Input argument iColor | the color to use
Input argument iTransform | the referential of the given primitive
Input argument iSubdivisions | number of subdivisions of the primitive

Remarks

The primitive will be draw during the post render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawSphere


CKRenderManager::RegisterText

Pure Virtual Method Method CKRenderManager::RegisterText

virtual void CKRenderManager::RegisterText(const char* iText, const CKDWORD iColor, float iRemainingTime = 0.0f)

Register the drawing of a text string, in window coordinates.

Parameters

Input argument iText | the text to draw
Input argument iColor | the color to use

Remarks

The primitive will be draw during the post sprite render callback of the render manager, so you can call this function anytime you like, even during the behavioral process.

See Also

DrawText


CKRenderManager::GetRenderDriverCount

Pure Virtual Method Method CKRenderManager::GetRenderDriverCount

virtual int CKRenderManager::GetRenderDriverCount()

Gets the number of render drivers.

Returns

Number of available render drivers.

See Also

GetRenderDriverDescription,VxDriverDesc


CKRenderManager::GetRenderDriverDescription

Pure Virtual Method Method CKRenderManager::GetRenderDriverDescription

virtual VxDriverDesc* CKRenderManager::GetRenderDriverDescription(int Driver)

Gets render driver description

Parameters

Input argument Driver

Index of the render driver which description should be returned.

Returns

A pointer to a VxDriverDesc structure containing the information about the driver.

Remarks

To create a render context you must specify the index of the driver to use. You can use this method to iterate through all available drivers and choose the best suited. Driver list is organized so that driver 0 is supposed to be the best compromise available.

See Also

VxDriverDesc,CreateRenderContext


CKRenderManager::AddEffect

Pure Virtual Method Method CKRenderManager::AddEffect

virtual int CKRenderManager::AddEffect(const VxEffectDescription& NewEffect)

Returns the number of registred effects.

Returns

Index of newly created effect.

Remarks

o This method enables an user to add a given effect to the existing ones. A callback function must be provided that will be called when a material is used. No checks are done on names so it is the application responsability to ensure an effect does not exist yet before adding a new one. o Effects provide additionnal functionnalities to take advantage of graphic features such as bump mapping,cube maps etc... o When an effect is enabled it may override the default settings of mesh channels or material blend options o New effects can be created by providing a callback function (see CKRenderManager::AddEffect) o Most of this effect are heavily hardware and device (DX8,DX7,etc..) dependant

See Also

CKMaterial::SetEffect,VxEffectDescription,GetEffectDescription,GetEffectCount


CKRenderManager::GetEffectCount

Pure Virtual Method Method CKRenderManager::GetEffectCount

virtual int CKRenderManager::GetEffectCount()

Returns the number of registred effects.

Returns

Number of registred effects.

Remarks

  • This method returns the number of available effects, either provided by render engine or added by users with AddEffect

  • Effects provide additionnal functionnalities to take advantage of graphic features such as bump mapping,cube maps etc...

  • When an effect is enabled it may override the default settings of mesh channels or material blend options

  • New effects can be created by providing a callback function (see CKRenderManager::AddEffect)

  • Most of this effect are heavily hardware and device (DX8,DX7,etc..) dependant

See Also

CKMaterial::SetEffect,VxEffectDescription,GetEffectDescription,AddEffect


CKRenderManager::GetEffectDescription

Pure Virtual Method Method CKRenderManager::GetEffectDescription

virtual const VxEffectDescription& CKRenderManager::GetEffectDescription(int EffectIndex)

Returns a description for a given effect

Parameters

Input argument EffectIndex

Index of the effect to return.

Returns

A reference to a VxEffectDescription containing the description of the effect.

Remarks

  • This method returns a VxEffectDescription structure that gives details about a given effect.

  • Effects provide additionnal functionnalities to take advantage of graphic features such as bump mapping,cube maps etc...

  • When an effect is enabled on a material (CKMaterial::SetEffect) it may override the default settings of mesh channels or material blend options

  • New effects can be created by providing a callback function (see CKRenderManager::AddEffect)

  • Most of this effect are heavily hardware and device (DX8,DX7,etc..) dependant

See Also

CKMaterial::SetEffect,VxEffectDescription,GetEffectCount,AddEffect


CKRenderManager::CreateRenderContext

Pure Virtual Method Method CKRenderManager::CreateRenderContext

virtual CKRenderContext* CKRenderManager::CreateRenderContext(void *Window,int Driver=0,CKRECT* rect=NULL,CKBOOL Fullscreen=FALSE,int Bpp=-1,int Zbpp=-1,int StencilBpp=-1,int RefreshRate=0)

Creates a new render context

Parameters

Input argument Window | A Pointer to the window on which rendering will be done.
Input argument Driver | Index of the Render driver
Input argument rect | A CKRECT specifying the rendering size or NULL to use the entire window.
Input argument Fullscreen | TRUE to switch to fullscreen.
Input argument Bpp | Number of bits per pixel for the color buffer(<=0 to have a default bpp).
Input argument Zbpp | Number of bits per pixel for the depth buffer (<=0 to have a default bpp).
Input argument StencilBpp | Number of bits per pixel for the stencil buffer (<=0 to have a default bpp).
Input argument RefreshRate | Optionnal Refresh rate to use in fullscreen.

Returns

Pointer to the created CKRenderContext.

Remarks

When creating a fullscreen render context if no valid rect is given the default display mode is set to 640x480.

See Also

GetRenderDriverDescription,GetRenderDriverCount,DestroyRenderContext


CKRenderManager::DestroyRenderContext

Pure Virtual Method Method CKRenderManager::DestroyRenderContext

virtual CKERROR CKRenderManager::DestroyRenderContext(CKRenderContext *context)

Destroys a render context.

Parameters

Input argument context

A pointer to CKRenderContext to be destroyed.

Returns

CK_OK if its successful, error code otherwise.

Remarks

This method removes the render context from the list and destroys it.

See Also

CreateRenderContext,RemoveRenderContext


CKRenderManager::GetRenderContext

Pure Virtual Method Method CKRenderManager::GetRenderContext

virtual CKRenderContext* CKRenderManager::GetRenderContext(int pos)

Gets a render context given its index.

Parameters

Input argument pos

Index of the render context to be retrieve.

Returns

A pointer to CKRenderContext

See Also

GetRenderContextCount,CreateRenderContext


CKRenderManager::GetRenderContextCount

Pure Virtual Method Method CKRenderManager::GetRenderContextCount

virtual int CKRenderManager::GetRenderContextCount()

Gets the number of render contexts.

Returns

Number of render contexts.

See Also

GetRenderContext


CKRenderManager::GetRenderContextFromPoint

Pure Virtual Method Method CKRenderManager::GetRenderContextFromPoint

virtual CKRenderContext* CKRenderManager::GetRenderContextFromPoint(CKPOINT& pt)

Gets a render context under a screen position.

Parameters

Input argument pt

Screen coordinates from which the render context should be retrieved. Retur value: Pointer to CKRenderContext or NULL if there is not a render context under the given point.

Returns

A pointer to a CKRenderContext or NULL.

See Also

GetRenderContext,GetRenderContextCount


CKRenderManager::RemoveRenderContext

Pure Virtual Method Method CKRenderManager::RemoveRenderContext

virtual void CKRenderManager::RemoveRenderContext(CKRenderContext *context)

Removes a render context.

Parameters

Input argument context

A pointer to CKRenderContext to be removed from the list.

See Also

CreateRenderContext,GetRenderContextCount,DestroyRenderContext,CreateRenderContext


CKRenderManager::Process

Pure Virtual Method Method CKRenderManager::Process

virtual void CKRenderManager::Process()

Renders all the render contextes.


CKRenderManager::SetRenderOptions

Pure Virtual Method Method CKRenderManager::SetRenderOptions

virtual void CKRenderManager::SetRenderOptions(CKSTRING RenderOptionString,DWORD Value)

Sets render engine settings.

Parameters

Input argument RenderOptionString | A string identifying the render option to set.
Input argument Value | A interger value for the given option.

Remarks

 The available options (with their default value given in ()) are :
            DisablePerspectiveCorrection(0) : Disables perspective correction. On recent hardware this does not have
                                        a great impact but it can be very useful in software mode

ForceLinearFog(0) : Previous versions of the render engine forced fog modes to default to linear fog
                mode. this was essentially caused by back-compatibility problems with DirectX 5.
                this has now been removed but can be re-activated though this variable.
ForceSoftware(0) : Disables all hardware renderers

EnsureVertexShader(0) :  For DX8 rasterizer this ensure that vertex shader are supported : for example if
                    the graphic card and driver support T&L but not vertex shaders in hardware the chosen
                    driver will be an non T&L device. Otherwise created device will only support vertex shaders
                    if they are supported in hardware.

DisableFilter(0) : Disables texture filtering

DisableDithering(0) : Disables image dithering

Antialias(0) : Enables image antialiasing. This represents the number of multi-sample
                for DX8 anti-aliasing (minimum :2). This settings only works on DX8 rasterizer
                for the moment.
DisableMipmap(0) : Disables image dithering

DisableSpecular(0) : Disables specular highlights

EnableScreenDump(0) : Pressing CTRL+ALT+F10 dump the content of
                    the screen,depth and stencil buffer to
                    the root of the current hard drive....
EnableScreenDump(0) : Pressing CTRL+ALT+F10 dump the content of
                    the screen,depth and stencil buffer to
                    the root of the current hard drive....

EnableDebugMode(0)  : Pressing (CTRL + ALT + F11) starts/stops the debug
        mode where rendering can be done step by step on each object

VertexCache(16)    : Mesh draw indices are automatically reorganised to
                    take advantage of a potential hardware vertex cache.
                    A value of 0 disables the sorting.

TextureCacheManagement(1) : Texture cache management can be disabled to avoid
                    to have a copy of the texture stored in system memory when
                    all textures are known to fit into video memory.

SortTransparentObjects(1) : Transparents objects are sorted according
                to their distance to the camera and their priority.
                A value of 0 disables the sorting.

TextureVideoFormat: This entry is followed by a pixel format
                that is to be used as default settings for a texture in
                video memory.
SpriteVideoFormat: This entry is followed by a pixel format
                that is to be used as default settings for a sprite in
                video memory.
    Available formats :
        _32_ARGB8888,_32_RGB888
        _24_RGB888,
        _16_RGB565,_16_RGB555,_16_ARGB1555,_16_ARGB4444,
        _8_RGB332_8_ARGB2222,
        _DXT1,_DXT3,_DXT5

These options are read in the CK2_3D.ini file at startup and can be modified afterwards. These options apply when a render context is created but are not taken into account by created render contextes if changed meanwhile...

See Also

CK2_3D.ini


CKRenderManager::FlushTextures

Pure Virtual Method Method CKRenderManager::FlushTextures

virtual void CKRenderManager::FlushTextures()

Removes all the textures and sprites from video memory.

Remarks

To be drawn, textures and sprites need to be present in video memory. This method force all textures to be removed from video memory. The CK2_3D/DisableTextureFlushing variable disables the effects of this function.

See Also

SetDesiredTexturesVideoFormat


CKRenderManager::GetDesiredTexturesVideoFormat

Pure Virtual Method Method CKRenderManager::GetDesiredTexturesVideoFormat

virtual void CKRenderManager::GetDesiredTexturesVideoFormat(VxImageDescEx& VideoFormat)

Gets the desired pixel format for textures in video memory

Parameters

Input argument VideoFormat

A VxImageDescEx pointer to be filled with desired pixel format.

Remarks

Newly created textures uses this format as their default pixel format when loaded in video memory. It can be overriden by setting the desired video format per texture with CKTexture::SetDesiredVideoFormat.

See Also

SetDesiredTexturesVideoFormat, VxImageDescEx,CKTexture::SetDesiredVideoFormat


CKRenderManager::SetDesiredTexturesVideoFormat

Pure Virtual Method Method CKRenderManager::SetDesiredTexturesVideoFormat

virtual void CKRenderManager::SetDesiredTexturesVideoFormat(VxImageDescEx& VideoFormat)

Sets the desired pixel format for textures in video memory

Parameters

Input argument VideoFormat

A VxImageDescEx pointer containing texture pixel format.

Remarks

This method sets the default pixel format texture should use in video memory. It can be overriden by setting the desired video format per texture with CKTexture::SetDesiredVideoFormat.

See Also

VxImageDescEx, GetDesiredTexturesVideoFormat,CKTexture::SetDesiredVideoFormat


CKRenderManager::CreateVertexBuffer

Pure Virtual Method Method CKRenderManager::CreateVertexBuffer

virtual CKVertexBuffer* CKRenderManager::CreateVertexBuffer()

Creates a new vertex buffer

Returns

Pointer to the created CKVertexBuffer.

Remarks

Every vertex buffers are automatically destroyed on a ClearAll operation.

See Also

CKVertexBuffer,DestroyVertexBuffer


CKRenderManager::DestroyVertexBuffer

Pure Virtual Method Method CKRenderManager::DestroyVertexBuffer

virtual void CKRenderManager::DestroyVertexBuffer(CKVertexBuffer *VB)

Destroys a vertex buffer.

Parameters

Input argument VB

A pointer to CKVertexBuffer to be destroyed.

Remarks

Every vertex buffers are automatically destroyed on a ClearAll operation.

See Also

CKVertexBuffer,CreateVertexBuffer


CKRenderObject

Class CKRenderObject

Base class for CKObjects that can be rendered in a CKRenderContext (3D and 2D)

CKObject

CKSceneObject

CKBeObject
Show brief derivation trees

CKRenderObject

CK2dEntity

CKSprite

CKSpriteText

CK3dEntity

CK3dObject

CKBodyPart

CK3dPointCloud

CKCamera

CKTargetCamera

CKCharacter

CKCurve

CKCurvePoint

CKGrid

CKLight

CKTargetLight

CKPlace

CKSprite3D

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKRenderObject

Subclasses

CK2dEntity, and CK3dEntity

Remarks

+This class presents the methods common to all objects that can be rendered onto a CKRenderContext (CK2dEntity and CK3dEntity). +Callback functions can be added to be called before,after and even instead of the default rendering function.

Groups

Constructors
Method CKRenderObject | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Static Object Method Cast | Dynamic Cast method (returns NULL if the object can't be casted)
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Pure Virtual Method Method IsInRenderContext | Checks if this render object is referenced in a CKRenderContext.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method SetZOrder | Sets the Z order (priority) for this object.
Callbacks
Pure Virtual Method Method AddPostRenderCallBack | Adds a post-render callback function.
Pure Virtual Method Method AddPreRenderCallBack | Adds a pre-render callback function.
Pure Virtual Method Method RemoveAllCallbacks | Removes all callbacks from CKRenderObject
Pure Virtual Method Method RemovePostRenderCallBack | Removes a post-render callback function.
Pure Virtual Method Method RemovePreRenderCallBack | Removes a pre-render callback function.
Pure Virtual Method Method RemoveRenderCallBack | Removes the rendering function.
Pure Virtual Method Method SetRenderCallBack | Sets the rendering function.

See Also

CK3dEntity, CKRenderContext,CK2dEntity


CKRenderObject::CKRenderObject

Method CKRenderObject::CKRenderObject

CKRenderObject::CKRenderObject()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKRenderObject::Cast

Static Object Method CKRenderObject::Cast

static CKRenderObject* CKRenderObject::Cast(CKObject* iO)

Remarks

Dynamic Cast method (returns NULL if the object can't be casted)


CKRenderObject::IsInRenderContext

Pure Virtual Method Method CKRenderObject::IsInRenderContext

virtual CKBOOL CKRenderObject::IsInRenderContext(CKRenderContext* context)

Checks if this render object is referenced in a CKRenderContext.

Parameters

Input argument context

A pointer to the context.

Returns

TRUE if this object is in context, FALSE otherwise.

Remarks

To be rendered when calling CKRenderContext::Render a 2D Entity or 3D Entity needs to be referenced by the render context. Objects referenced in a scene are automatically placed in a render context when the scene becomes active. But additionnal objects to be rendered but not present in the scene should be added to the render context with CKRenderContext::AddObject or rendered manually with CK3dEntity::Render or CK2dEntity::Render

See Also

CKRenderContext


CKRenderObject::SetZOrder

Pure Virtual Method Method CKRenderObject::SetZOrder

virtual void CKRenderObject::SetZOrder(int Z)
virtual int CKRenderObject::GetZOrder()

Sets the Z order (priority) for this object.

Remarks

2D and 3D entities are drawn separately and in a hierarchical order. The z order is a priority used to sort the rendering of objects at the same level in the hierarchy. 2D Entities are drawn from minimum Z order to maximum Z order On the contrary 3D Entities use the Z order a priority drawing object with a higher priority first Valid range for the Z order is from -10000 to 10000


CKRenderObject::AddPostRenderCallBack

Pure Virtual Method Method CKRenderObject::AddPostRenderCallBack

virtual CKBOOL CKRenderObject::AddPostRenderCallBack(CK_RENDEROBJECT_CALLBACK Function,void *Argument,CKBOOL Temp = FALSE, CKBOOL ModifyRenderPipeline = TRUE)

Adds a post-render callback function.

Parameters

Argument | that will be passed to the function.
Temp | TRUE if the callback should be removed after being called.
ModifyRenderPipeline | Hint for render engine must be TRUE if the callback function will be changing render states ,textures or materials or drawing primitives

Returns

TRUE if successful, FALSE otherwise.

See Also

CK_RENDEROBJECT_CALLBACK, RemovePostRenderCallBack


CKRenderObject::AddPreRenderCallBack

Pure Virtual Method Method CKRenderObject::AddPreRenderCallBack

virtual CKBOOL CKRenderObject::AddPreRenderCallBack(CK_RENDEROBJECT_CALLBACK Function,void *Argument,CKBOOL Temp = FALSE , CKBOOL ModifyRenderPipeline = TRUE )

Adds a pre-render callback function.

Parameters

Argument | that will be passed to the function.
Temp | TRUE if the callback should be removed after being called.
ModifyRenderPipeline | Hint for render engine must be TRUE if the callback function will be changing render states ,textures or materials or drawing primitives

Returns

TRUE if successful, FALSE otherwise.

See Also

CK_RENDEROBJECT_CALLBACK, RemovePreRenderCallBack


CKRenderObject::RemoveAllCallbacks

Pure Virtual Method Method CKRenderObject::RemoveAllCallbacks

virtual void CKRenderObject::RemoveAllCallbacks()

Removes all callbacks from CKRenderObject

Remarks

This methods removes all the existing call backs on this object. SeeAlso: SetRenderCallBack, AddPreRenderCallBack, AddPostRenderCallBack


CKRenderObject::RemovePostRenderCallBack

Pure Virtual Method Method CKRenderObject::RemovePostRenderCallBack

virtual CKBOOL CKRenderObject::RemovePostRenderCallBack(CK_RENDEROBJECT_CALLBACK Function,void *Argument)

Removes a post-render callback function.

Parameters

Argument

that was passed to AddPostRenderCallBack.

Returns

TRUE if successful, FALSE otherwise.

See Also

CK_RENDEROBJECT_CALLBACK, AddPostRenderCallBack


CKRenderObject::RemovePreRenderCallBack

Pure Virtual Method Method CKRenderObject::RemovePreRenderCallBack

virtual CKBOOL CKRenderObject::RemovePreRenderCallBack(CK_RENDEROBJECT_CALLBACK Function,void *Argument)

Removes a pre-render callback function.

Parameters

Argument

that was passed to AddPreRenderCallBack.

Returns

TRUE if successful, FALSE otherwise.

See Also

CK_RENDEROBJECT_CALLBACK, AddPreRenderCallBack


CKRenderObject::RemoveRenderCallBack

Pure Virtual Method Method CKRenderObject::RemoveRenderCallBack

virtual CKBOOL CKRenderObject::RemoveRenderCallBack()

Removes the rendering function.

Returns

TRUE if successful, FALSE otherwise.

Remarks

This restores the default rendering method on this object.

See Also

CK_RENDEROBJECT_CALLBACK, AddRenderCallBack


CKRenderObject::SetRenderCallBack

Pure Virtual Method Method CKRenderObject::SetRenderCallBack

virtual CKBOOL CKRenderObject::SetRenderCallBack(CK_RENDEROBJECT_CALLBACK Function,void *Argument)

Sets the rendering function.

Parameters

Argument

that will be passed to the function.

Returns

TRUE if successful, FALSE otherwise.

See Also

CK_RENDEROBJECT_CALLBACK, RemoveRenderCallBack


CKSkin

VxPoolObject
Show full derivation trees

CKSkin

Remarks

In a standard mesh the vertices are all transformed by the same 3d Entity world matrice to be rendered. Skinning is the technique of having different vertices of a mesh be transformed by multiple transform matrices each of these matrices being given a different influence (weight).

The CKSkin class contains a list of vertices and a list of bones (3dEntities) that influence these vertices.

A skin is attached to a given 3d entity, each time the 3d Entity is rendered and if one of the bones has moved the entity's current mesh is recomputed according to the skin data.

It can be created with the CK3dEntity::CreateSkin method.

The sample exporter (see Available Source Code) shows an example of creation of CKSkin.

Groups

Bones | Vertices | Evaluation | Misc | Hardware Skinning | Operations

Bones
Pure Virtual Method Method GetBoneCount | Gets the number of bones in the skin.
Pure Virtual Method Method GetBoneData | Gets description of the n-th bone.
Pure Virtual Method Method SetBoneCount | Sets the number of bones in the skin.
Vertices
Pure Virtual Method Method GetVertexCount | Gets the number of vertices in the skin.
Pure Virtual Method Method GetVertexData | Gets description of the n-th vertex.
Pure Virtual Method Method RemapVertices | Changes the order of the vertices.
Pure Virtual Method Method SetNormal | SetNormal.
Pure Virtual Method Method SetNormalCount | Specify if normals should be skinned too.
Pure Virtual Method Method SetVertexCount | Sets the number of vertices in the skin.
Evaluation
Pure Virtual Method Method CalcPoints | Computes the tranformed vertices positions and Normals.
Pure Virtual Method Method ConstructBoneTransfoMatrices | Precomputes the bones transformation matrices.
Misc
Pure Virtual Method Method GetObjectInitMatrix | Gets the owner 3d Entity initial orientation.
Pure Virtual Method Method SetObjectInitMatrix | Sets the owner 3d Entity initial orientation.
Hardware Skinning
Pure Virtual Method Method GetHardwareSkinningRef | Gets the referential in which the bones matrix array is calculated
Pure Virtual Method Method GetMaxBonesPerVertex | returns the maximum number of bones per vertex
Pure Virtual Method Method GetTransformedBonesArray | returns a pointer to the internal bones matrix array
Pure Virtual Method Method RestoreOriginalVNPositions | reposition vertices and normals to their original positions
Pure Virtual Method Method SetHardwareSkinningRef | Sets the referential in which the bones matrix array is calculated
Operations
Pure Virtual Method Method EnsureLessThanNBonesPerVertex |

See Also

CK3dEntity::CreateSkin


CKSkin::GetBoneCount

Pure Virtual Method Method CKSkin::GetBoneCount

virtual int CKSkin::GetBoneCount() const

Gets the number of bones in the skin.

Returns

Number of bones that influence the skin.

Remarks

Each bone information can be retrieved with GetBoneData method.

See Also

SetVertexCount,SetBoneCount,GetBoneData


CKSkin::GetBoneData

Pure Virtual Method Method CKSkin::GetBoneData

virtual CKSkinBoneData* CKSkin::GetBoneData(int BoneIdx)

Gets description of the n-th bone.

Parameters

Input argument BoneIdx

Index of the bone which description should be returned

Returns

A pointer to CKSkinBoneData that contains the bone information (CK3dEntity,orginal orientation..).

See Also

CKSkinBoneData,SetBoneCount,GetBoneCount


CKSkin::SetBoneCount

Pure Virtual Method Method CKSkin::SetBoneCount

virtual void CKSkin::SetBoneCount(int BoneCount)

Sets the number of bones in the skin.

Parameters

Input argument BoneCount

Number of bones that influence the skin.

Remarks

Each bone information can be retrieved with GetBoneData method.

See Also

SetVertexCount,GetBoneCount,GetBoneData


CKSkin::GetVertexCount

Pure Virtual Method Method CKSkin::GetVertexCount

virtual int CKSkin::GetVertexCount() const

Gets the number of vertices in the skin.

Returns

Number of vertices.

Remarks

Each vertex information (Number of bones that influence the vertex,weights) can be retrieve with GetVertexData method.

See Also

SetVertexCount,GetVertexData


CKSkin::GetVertexData

Pure Virtual Method Method CKSkin::GetVertexData

virtual CKSkinVertexData* CKSkin::GetVertexData(int VertexIdx)

Gets description of the n-th vertex.

Parameters

Input argument VertexIdx

Index of the vertex which description should be returned

Returns

A pointer to CKSkinVertexData that contains the vertex information (Number of bones that influence the vertex,weights,etc..).

See Also

CKSkinVertexData,SetVertexCount,GetVertexCount


CKSkin::RemapVertices

Pure Virtual Method Method CKSkin::RemapVertices

virtual void CKSkin::RemapVertices(const XArray<int>& permutation)

Changes the order of the vertices.

Parameters

Input argument permutation

An array of integer containing the new index of each vertex

See Also

SetVertexCount,GetVertexCount


CKSkin::SetNormal

Pure Virtual Method Method CKSkin::SetNormal

virtual void CKSkin::SetNormal(int Index,const VxVector& Norm)
virtual VxVector& CKSkin::GetNormal(int Index)

SetNormal.

Parameters

Input argument Index | Index of the normal to set or retrieve.
Input argument Norm | Vector representing the normal to set.

See Also

SetNormalCount


CKSkin::SetNormalCount

Pure Virtual Method Method CKSkin::SetNormalCount

virtual void CKSkin::SetNormalCount(int Count)
virtual int CKSkin::GetNormalCount()

Specify if normals should be skinned too.

Parameters

Input argument Count

must be equal to the number of vertices or 0 to disable the skinning of normals.

Remarks

When set to 0 the normals of the mesh are automatically recomputed at each skinning using the face normals otherwise the normals are skinned as the vertex positions.

See Also

SetVertexCount,GetVertexCount,SetNormal,GetNormal


CKSkin::SetVertexCount

Pure Virtual Method Method CKSkin::SetVertexCount

virtual void CKSkin::SetVertexCount(int Count)

Sets the number of vertices in the skin.

Parameters

Input argument Count

Number of vertices.

Remarks

Each vertex information (Number of bones that influence the vertex,weights) can be retrieved with GetVertexData method.

See Also

GetVertexCount,GetBoneCount,GetVertexData


CKSkin::CalcPoints

Pure Virtual Method Method CKSkin::CalcPoints

virtual CKBOOL CKSkin::CalcPoints(int VertexCount,BYTE* VertexPtr,CKDWORD VStride)
virtual CKBOOL CKSkin::CalcPoints(int VertexCount,BYTE* VertexPtr,CKDWORD VStride,BYTE* NormalPtr,CKDWORD NStride)

Computes the tranformed vertices positions and Normals.

Parameters

Input argument VertexCount | Number of vertices to be computed.
Input argument VertexPtr | A pointer to a strided array of VxVector to be filled withe transformed positions.
Input argument VStride | Amount in bytes between each VxVector in the VertexPtr buffer.
Input argument NormalPtr | A pointer to a strided array of VxVector to be filled with transformed normals.
Input argument NStride | Amount in bytes between each VxVector in the NormalPtr buffer.

Returns

TRUE if successful.

Remarks

This method computes the positions of the skin vertices according to the current bones matrices. ConstructBoneTransfoMatrices must have been called before evaluating the vertices transformed positions.

See Also

ConstructBoneTransfoMatrices


CKSkin::ConstructBoneTransfoMatrices

Pure Virtual Method Method CKSkin::ConstructBoneTransfoMatrices

virtual void CKSkin::ConstructBoneTransfoMatrices(CKContext* context)

Precomputes the bones transformation matrices.

Remarks

This method computes the appropriate matrices for each bone (3d Entity) used by the skin. It must called before evaluating the vertices transformed position with CalcPoints.

See Also

CalcPoints


CKSkin::GetObjectInitMatrix

Pure Virtual Method Method CKSkin::GetObjectInitMatrix

virtual void CKSkin::GetObjectInitMatrix(VxMatrix& Mat)

Gets the owner 3d Entity initial orientation.

Parameters

Input argument Mat

Original world matrix of the owner 3dEntity.

See Also

CK3dEntity::CreateSkin


CKSkin::SetObjectInitMatrix

Pure Virtual Method Method CKSkin::SetObjectInitMatrix

virtual void CKSkin::SetObjectInitMatrix(const VxMatrix& Mat)

Sets the owner 3d Entity initial orientation.

Parameters

Input argument Mat

Original world matrix of the owner 3dEntity.

See Also

CK3dEntity::CreateSkin


CKSkin::GetHardwareSkinningRef

Pure Virtual Method Method CKSkin::GetHardwareSkinningRef

virtual CK_BONES_REFERENTIAL CKSkin::GetHardwareSkinningRef()

Gets the referential in which the bones matrix array is calculated


CKSkin::GetMaxBonesPerVertex

Pure Virtual Method Method CKSkin::GetMaxBonesPerVertex

virtual int CKSkin::GetMaxBonesPerVertex()

returns the maximum number of bones per vertex


CKSkin::GetTransformedBonesArray

Pure Virtual Method Method CKSkin::GetTransformedBonesArray

virtual VxMatrix * CKSkin::GetTransformedBonesArray()

returns a pointer to the internal bones matrix array


CKSkin::RestoreOriginalVNPositions

Pure Virtual Method Method CKSkin::RestoreOriginalVNPositions

virtual void CKSkin::RestoreOriginalVNPositions(CK3dEntity* Entity)

reposition vertices and normals to their original positions


CKSkin::SetHardwareSkinningRef

Pure Virtual Method Method CKSkin::SetHardwareSkinningRef

virtual void CKSkin::SetHardwareSkinningRef(CK_BONES_REFERENTIAL ref)

Sets the referential in which the bones matrix array is calculated


CKSkin::EnsureLessThanNBonesPerVertex

Pure Virtual Method Method CKSkin::EnsureLessThanNBonesPerVertex

virtual void CKSkin::EnsureLessThanNBonesPerVertex(int MaxBonesPerVertex = 4)


CKSkinBoneData

Class CKSkinBoneData

Bone information in a Skin

Remarks

+A bone uses a CK3dEntity to represents its orientation +The CKSkin class returns instance of this class to describe a given bone with CKSkin::GetBoneData.

Groups

Operations
Pure Virtual Method Method GetBone | Returns the 3D Entity that represents this bone orientation.
Pure Virtual Method Method GetBoneInitialInverseMatrix | Gets the bone original orientation.
Pure Virtual Method Method SetBone | Sets the 3D Entity that represents this bone orientation.
Pure Virtual Method Method SetBoneInitialInverseMatrix | Sets the bone original orientation.

See Also

CK3dEntity,CKSkin,CKSkinVertexData


CKSkinBoneData::GetBone

Pure Virtual Method Method CKSkinBoneData::GetBone

virtual CK3dEntity* CKSkinBoneData::GetBone()

Returns the 3D Entity that represents this bone orientation.

Returns

A Pointer to the CK3dEntity that gives the bone orientation.

See Also

SetBone


CKSkinBoneData::GetBoneInitialInverseMatrix

Pure Virtual Method Method CKSkinBoneData::GetBoneInitialInverseMatrix

virtual VxMatrix& CKSkinBoneData::GetBoneInitialInverseMatrix()

Gets the bone original orientation.

Returns

A VxMatrix that represents the bone original inverse world matrix.

Remarks

+The vertices of a skin are transformed according to the relative transformation between the original bone orientation and its current orientation.

See Also

CKSkin,SetBoneInitialInverseMatrix


CKSkinBoneData::SetBone

Pure Virtual Method Method CKSkinBoneData::SetBone

virtual void CKSkinBoneData::SetBone(CK3dEntity* ent)

Sets the 3D Entity that represents this bone orientation.

Parameters

Input argument ent

A pointer to the CK3dEntity that represents this bone orientation.

See Also

GetBone


CKSkinBoneData::SetBoneInitialInverseMatrix

Pure Virtual Method Method CKSkinBoneData::SetBoneInitialInverseMatrix

virtual void CKSkinBoneData::SetBoneInitialInverseMatrix(const VxMatrix& M)

Sets the bone original orientation.

Parameters

Input argument M

A VxMatrix that represents the bone original inverse world matrix.

Remarks

+The vertices of a skin are transformed according to the relative transformation between the original bone orientation and its current orientation. +In the same manner the original position of vertices must be given, the original orientation (Inverse World Matrix) of the bones must be given with this method.

See Also

CKSkin,CKSkinVertexData::SetInitialPos,CK3dEntity::GetInverseWorldMatrix


CKSkinVertexData

Class CKSkinVertexData

Vertex information in a Skin

Remarks

Each vertex in a skin can be influenced by one or more bones. Each of theses bones influences the vertex with a given weight, the sum of all weights should be 1. The CKSkin class returns instance of this class to describe a given vertex with CKSkin::GetVertexData.

Groups

Operations
Pure Virtual Method Method GetBone | Gets the index of the n-th bone that influences this vertex.
Pure Virtual Method Method GetBoneCount | Gets the number of bones that influence this vertex.
Pure Virtual Method Method GetInitialPos | Gets the original position of this vertex.
Pure Virtual Method Method GetWeight | Gets the influence of the n-th bone.
Pure Virtual Method Method SetBone | Sets the index of the n-th bone that influences this vertex.
Pure Virtual Method Method SetBoneCount | Sets the number of bones that influence this vertex.
Pure Virtual Method Method SetInitialPos | Gets the original position of this vertex.
Pure Virtual Method Method SetWeight | Sets the influence of the n-th bone.

See Also

CK3dEntity,CKSkin,CKSkinBoneData


CKSkinVertexData::GetBone

Pure Virtual Method Method CKSkinVertexData::GetBone

virtual int CKSkinVertexData::GetBone(int n)

Gets the index of the n-th bone that influences this vertex.

Parameters

Input argument n

Number of the bone index to be returned.

Returns

Index of the n-th bone that influence this vertex, this index can be used to retrieve the bone data with CKSkin::GetBoneData.

See Also

GetBoneCount,SetBone,GetWeight,CKSkin::GetBoneData.


CKSkinVertexData::GetBoneCount

Pure Virtual Method Method CKSkinVertexData::GetBoneCount

virtual int CKSkinVertexData::GetBoneCount()

Gets the number of bones that influence this vertex.

Returns

Number of bones that influence this vertex.

See Also

SetBoneCount,SetBone,GetBone,GetWeight


CKSkinVertexData::GetInitialPos

Pure Virtual Method Method CKSkinVertexData::GetInitialPos

virtual VxVector& CKSkinVertexData::GetInitialPos()

Gets the original position of this vertex.

Returns

Position of the vertex when all bones are at their initial matrices.

See Also

SetInitialPos,CKBoneData::SetBoneInitialInverseMatrix


CKSkinVertexData::GetWeight

Pure Virtual Method Method CKSkinVertexData::GetWeight

virtual float CKSkinVertexData::GetWeight(int n)

Gets the influence of the n-th bone.

Parameters

Input argument n

Number of the bone which index should be set.

Returns

Influence of the n-th bone.

See Also

GetBoneCount,GetBone,SetWeight


CKSkinVertexData::SetBone

Pure Virtual Method Method CKSkinVertexData::SetBone

virtual void CKSkinVertexData::SetBone(int n,int BoneIdx)

Sets the index of the n-th bone that influences this vertex.

Parameters

Input argument n | Number of the bone which index should be set.
Input argument BoneIdx | Index of the n-th bone that influence this vertex in the skin data.

See Also

GetBoneCount,GetBone,GetWeight,CKSkin::GetBoneData.


CKSkinVertexData::SetBoneCount

Pure Virtual Method Method CKSkinVertexData::SetBoneCount

virtual void CKSkinVertexData::SetBoneCount(int BoneCount)

Sets the number of bones that influence this vertex.

Parameters

Input argument BoneCount

Number of bones that influence this vertex.

See Also

GetBoneCount,SetBone,GetBone,GetWeight


CKSkinVertexData::SetInitialPos

Pure Virtual Method Method CKSkinVertexData::SetInitialPos

virtual void CKSkinVertexData::SetInitialPos(VxVector& pos)

Gets the original position of this vertex.

Parameters

Input argument pos

Original position of the vertex.

Remarks

The vertices of a skin are transformed according to the relative transformation between the original bone orientation and its current orientation. In the same manner the original orientation of bones must be given, the original position of vertices must be given with this method.

See Also

SetInitialPos,CKBoneData::SetBoneInitialInverseMatrix


CKSkinVertexData::SetWeight

Pure Virtual Method Method CKSkinVertexData::SetWeight

virtual void CKSkinVertexData::SetWeight(int n,float Weight)

Sets the influence of the n-th bone.

Parameters

Input argument n | Number of the bone which index should be set.
Input argument Weight | Influence of the bone.

See Also

GetBoneCount,GetBone,GetWeight


CKSprite

Class CKSprite

Sprite Class.

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK2dEntity
Show brief derivation trees

CKSprite

CKSpriteText

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK2dEntity
Show full derivation trees

CKSprite

Subclasses

CKSpriteText

Remarks

A sprite is special kind of 2D entity that supports displaying non power of 2 images (limitation of textures)

This class provides the basic methods for loading a sprite from a file, access the surface data,specify transparent color.

The class id of CKSprite is CKCID_SPRITE.

Groups

Creation | Slots | Movie | Video memory management | Surface data access | Bitmap storage info | Save Options | Cast operator | Special Rendering | System Caching | Transparency

Creation
Virtual Method Method Create | Creates an empty image in the sprite.
Virtual Method Method LoadImage | Loads a image slot from a file.
Virtual Method Method SaveImage | Saves an image slot to a file.
Slots
Virtual Method Method GetCurrentSlot | Returns current slot index.
Virtual Method Method GetSlotCount | Returns the number of slot (images) in this sprite.
Virtual Method Method GetSlotFileName | Returns the name of the file used to load an image slot.
Virtual Method Method ReleaseAllSlots | Deletes all the images.
Virtual Method Method ReleaseSlot | Removes an image.
Virtual Method Method SetCurrentSlot | Sets the current active image.
Virtual Method Method SetSlotCount | Sets the number of slot (images) in this sprite.
Virtual Method Method SetSlotFileName | Sets the name of the file used to load an image slot.
Movie
Virtual Method Method GetMovieFileName | Returns the name of the movie file used by this sprite.
Virtual Method Method GetMovieReader | Returns the movie reader used to decompress the current movie.
Virtual Method Method LoadMovie | Creates a multi-image sprite from a movie file.
Video memory management
Virtual Method Method Draw | Draws the sprite.
Virtual Method Method FreeVideoMemory | Frees the sprite video memory.
Virtual Method Method GetDesiredVideoFormat | Returns the desired pixel format in video memory.
Virtual Method Method GetVideoMemorySurfaceCount | Returns the number of video memory surface used to described this sprite.
Virtual Method Method GetVideoPixelFormat | Returns the pixel format of the sprite surface in video memory.
Virtual Method Method GetVideoTextureDesc | Returns a information about how sprite is stored in video memory.
Virtual Method Method IsInVideoMemory | Returns whether the sprite is present in video memory
Virtual Method Method LockVideoMemory | Gives access to the video memory surface pointer.
Virtual Method Method Restore | Restore sprite video memory
Virtual Method Method SetDesiredVideoFormat | Sets the desired surface pixel format in video memory.
Virtual Method Method SetDynamicHint | Sets a hint to indicate the bitmap is changed frequently.
Virtual Method Method SystemToVideoMemory | Allocates and copies the sprite image from system to video memory.
Surface data access
Virtual Method Method FlushSurfacePtr | Flush a slot system memory
Virtual Method Method GetPixel | Gets the color of a pixel.
Virtual Method Method LockSurfacePtr | Returns a pointer to the image surface buffer.
Virtual Method Method ReleaseSurfacePtr | Marks a slot as modified.
Virtual Method Method SetPixel | Sets the color of a pixel.
Bitmap storage info
Virtual Method Method GetHeight | Gets the image height
Virtual Method Method GetSystemTextureDesc | Gets Image format description
Virtual Method Method GetWidth | Gets the image width
Save Options
Virtual Method Method SetSaveFormat | Sets the saving format.
Virtual Method Method SetSaveOptions | Sets the saving options.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Special Rendering
Virtual Method Method SetAlphaTest | Sets the sprite alpha testing
Virtual Method Method SetBlending | Sets the sprite blending modes
Virtual Method Method SetColorModulate | Sets the sprite color modulation
Virtual Method Method SetFiltering | Sets the sprite linear filtering
Virtual Method Method SetRenderOptions | Sets the rendering options (blending,alpha test,filtering)
System Caching
Virtual Method Method SetSystemCaching | Sets the system memory caching option.
Transparency
Virtual Method Method GetTransparentColor | Returns the transparent color.
Virtual Method Method IsTransparent | Returns whether color keyed transparency is enabled.
Virtual Method Method SetPickThreshold | Sets pick threshold value.
Virtual Method Method SetTransparent | Enables or disables the color key transparency.
Virtual Method Method SetTransparentColor | Sets the transparent color.

See Also

CK2dEntity,CKSpriteText,CKBitmapData


CKSprite::Create

Virtual Method Method CKSprite::Create

virtual CKBOOL CKSprite::Create(int Width,int Height,int BPP=32,int Slot=0) CK_PURE

Creates an empty image in the sprite.

Parameters

Input argument Width | width in pixel of the image to create
Input argument Height | height in pixel of the image to create
Input argument BPP | Bit per pixel of the image
Input argument Slot | If there a multiple images, index of the image slot to create.

Returns

TRUE if successful, FALSE otherwise.

Remarks

The name for the created slot is set to “” If there was already some slots created but with a different width or height the method returns FALSE.

See Also

LoadImage,SaveImage


CKSprite::LoadImage

Virtual Method Method CKSprite::LoadImage

virtual CKBOOL CKSprite::LoadImage(CKSTRING Name,int Slot=0) CK_PURE

Loads a image slot from a file.

Returns

TRUE if successful, FALSE otherwise.

Remarks

The supported image formats depend on the image readers installed. The default available readers support BMP,TGA,JPG,PNG and GIF format

See Also

SaveImage


CKSprite::SaveImage

Virtual Method Method CKSprite::SaveImage

virtual CKBOOL CKSprite::SaveImage(CKSTRING Name,int Slot=0,BOOL CKUseFormat=FALSE) CK_PURE

Saves an image slot to a file.

Returns

TRUE if successful, FALSE otherwise.

Remarks

The image format depends on the image readers installed. The default available readers support BMP,TGA,JPG,PNG and GIF format

See Also

CreateImage,CKBitmapReader


CKSprite::GetCurrentSlot

Virtual Method Method CKSprite::GetCurrentSlot

virtual int CKSprite::GetCurrentSlot() CK_PURE

Returns current slot index.

Returns

Current image slot index.

See Also

GetSlotCount,SetSlotCount,SetCurrentSlot


CKSprite::GetSlotCount

Virtual Method Method CKSprite::GetSlotCount

virtual int CKSprite::GetSlotCount() CK_PURE

Returns the number of slot (images) in this sprite.

Returns

Number of images.

See Also

SetSlotCount,GetCurrentSlot,SetCurrentSlot


CKSprite::GetSlotFileName

Virtual Method Method CKSprite::GetSlotFileName

virtual CKSTRING CKSprite::GetSlotFileName(int Slot) CK_PURE

Returns the name of the file used to load an image slot.

Parameters

slot: image slot index

Returns

A pointer to the name of the file which was used to load this image slot

See Also

SetSlotFileName


CKSprite::ReleaseAllSlots

Virtual Method Method CKSprite::ReleaseAllSlots

virtual CKBOOL CKSprite::ReleaseAllSlots() CK_PURE

Deletes all the images.

Returns

TRUE if successful, FALSE otherwise.

See Also

GetSlotCount,GetCurrentSlot,SetCurrentSlot


CKSprite::ReleaseSlot

Virtual Method Method CKSprite::ReleaseSlot

virtual CKBOOL CKSprite::ReleaseSlot(int Slot) CK_PURE

Removes an image.

Parameters

Input argument Slot

Index of the image to remove.

Returns

TRUE if successful, FALSE otherwise.

See Also

GetSlotCount,GetCurrentSlot,SetCurrentSlot


CKSprite::SetCurrentSlot

Virtual Method Method CKSprite::SetCurrentSlot

virtual CKBOOL CKSprite::SetCurrentSlot(int Slot) CK_PURE

Sets the current active image.

Parameters

Input argument Slot

Image slot index.

Returns

TRUE if successful, FALSE otherwise.

See Also

GetSlotCount,SetSlotCount,GetCurrentSlot


CKSprite::SetSlotCount

Virtual Method Method CKSprite::SetSlotCount

virtual CKBOOL CKSprite::SetSlotCount(int Count) CK_PURE

Sets the number of slot (images) in this sprite.

Parameters

Input argument Count

Image slots to allocate.

Returns

TRUE if successful, FALSE otherwise.

See Also

GetSlotCount,GetCurrentSlot,SetCurrentSlot


CKSprite::SetSlotFileName

Virtual Method Method CKSprite::SetSlotFileName

virtual CKBOOL CKSprite::SetSlotFileName(int Slot,CKSTRING Filename) CK_PURE

Sets the name of the file used to load an image slot.

Parameters

Input argument Slot | image slot index
Input argument Filename | image slot file name

Returns

TRUE if successful, FALSE otherwise.

See Also

GetSlotFileName


CKSprite::GetMovieFileName

Virtual Method Method CKSprite::GetMovieFileName

virtual CKSTRING CKSprite::GetMovieFileName() CK_PURE

Returns the name of the movie file used by this sprite.

Returns

A pointer to the name of the file which was used to load this sprite or NULL if this sprite is not a movie.

See Also

LoadMovie,GetMovieReader


CKSprite::GetMovieReader

Virtual Method Method CKSprite::GetMovieReader

virtual CKMovieReader* CKSprite::GetMovieReader() CK_PURE

Returns the movie reader used to decompress the current movie.

Returns

Pointer to CKMovieReader

Remarks

This method returns a movie reader if one is present,NULL otherwise.

See Also

LoadMovie,GetMovieFileName,CKMovieReader


CKSprite::LoadMovie

Virtual Method Method CKSprite::LoadMovie

virtual CKBOOL CKSprite::LoadMovie(CKSTRING Name,int width = 0,int height =0,int Bpp=16) CK_PURE

Creates a multi-image sprite from a movie file.

Returns

TRUE if loading was successful, FALSE otherwise.

Remarks

The supported movie formats depend on the image readers and codecs installed. The default available reader support AVI files.

See Also

LoadImage,Create


CKSprite::Draw

Virtual Method Method CKSprite::Draw

virtual CKERROR CKSprite::Draw(CKRenderContext* context) CK_PURE

Draws the sprite.

Parameters

Input argument context

A pointer to a CKRenderContext on which this entity will be drawn

Returns

CK_OK if successful, error code otherwise.

Remarks

This methods is automatically called by the Render method. It simply draws the entity on the context without rendering the children or calling the render callbacks.

Implementation Notes

This method overrides the default 2D Entity drawing routine.

See Also

SystemToVideoMemory,Restore


CKSprite::FreeVideoMemory

Virtual Method Method CKSprite::FreeVideoMemory

virtual CKBOOL CKSprite::FreeVideoMemory() CK_PURE

Frees the sprite video memory.

Returns

TRUE if successful, FALSE otherwise.

Remarks

Use this function to manage which sprites should be stored in video memory. Some video cards may render sprites stored in sytem memory (ie. AGP). This method can be used in low video memory configuration to flush sprites that have not been used for a long time.

See Also

SystemToVideoMemory


CKSprite::GetDesiredVideoFormat

Virtual Method Method CKSprite::GetDesiredVideoFormat

virtual VX_PIXELFORMAT CKSprite::GetDesiredVideoFormat() CK_PURE

Returns the desired pixel format in video memory.

Returns

Desired pixel format for this sprite in video memory.

See Also

GetVideoPixelFormat,SetDesiredVideoFormat


CKSprite::GetVideoMemorySurfaceCount

Virtual Method Method CKSprite::GetVideoMemorySurfaceCount

virtual int CKSprite::GetVideoMemorySurfaceCount() CK_PURE

Returns the number of video memory surface used to described this sprite.

Returns

Number of surfaces used to store this sprite, 0 if the sprite is not in video memory.

Remarks

Most video cards have restrictions on texture sizes that a CKSprite is not restricted to. To handle this it can use several video surface to render itself. This method returns the number of surfaces used.

See Also

LockVideoMemory,UnlockVideoMemory,


CKSprite::GetVideoPixelFormat

Virtual Method Method CKSprite::GetVideoPixelFormat

virtual VX_PIXELFORMAT CKSprite::GetVideoPixelFormat() CK_PURE

Returns the pixel format of the sprite surface in video memory.

Returns

Pixel format of video memory surface (VX_PIXELFORMAT) or VX_UNKNOWNPF if the sprite is not in video memory.

See Also

SetDesiredVideoFormat, GetVideoTextureDesc


CKSprite::GetVideoTextureDesc

Virtual Method Method CKSprite::GetVideoTextureDesc

virtual CKBOOL CKSprite::GetVideoTextureDesc(VxImageDescEx& desc) CK_PURE

Returns a information about how sprite is stored in video memory.

Parameters

Input argument desc

A reference to a VxImageDescEx structure that will be filled with video memory format information.

Returns

FALSE if the sprite is not in video memory or invalid, TRUE otherwise.

See Also

GetVideoPixelFormat,SetDesiredVideoFormat


CKSprite::IsInVideoMemory

Virtual Method Method CKSprite::IsInVideoMemory

virtual CKBOOL CKSprite::IsInVideoMemory() CK_PURE

Returns whether the sprite is present in video memory

Returns

TRUE if the sprite is in video memory FALSE otherwise.

See Also

SystemToVideoMemory


CKSprite::LockVideoMemory

Virtual Method Method CKSprite::LockVideoMemory

virtual BOOL CKSprite::LockVideoMemory(int SubSurfaceIndex,VxImageDescEx& Surface,CKRECT& SubRect,VX_LOCKFLAGS Flags = VX_LOCK_DEFAULT) CK_PURE
virtual void CKSprite::UnlockVideoMemory(int SubSurfaceIndex) CK_PURE

Gives access to the video memory surface pointer.

Parameters

Input argument SubSurfaceIndex | Index of the surface to lock.
Input argument Surface | A VxImageDescEx structure which will be filled with the description of the surface and its video pointer
Input argument SubRect | Position and Size of the surface inside the sprite.
Input argument Flags | Lock Flags to specify if a read only or write only operation is taking place.

Returns

TRUE if successful, FALSE if the sprite is not currently in video memory

Remarks

Most video cards have restrictions on texture sizes that a CKSprite is not restricted to. To handle this it can use several video surfaces to render itself. The number of surfaces used to create a sprite can be obtained by calling GetVideoMemorySurfaceCount. This method fills the Surface structure with information regarding the video memory surfaces. Once finish with the surface pointer you must release it by calling UnlockVideoMemory. Any rendering with a locked sprite will fail.

See Also

GetVideoMemorySurfaceCount,LockSurfacePtr,


CKSprite::Restore

Virtual Method Method CKSprite::Restore

virtual CKBOOL CKSprite::Restore(CKBOOL Clamp = FALSE) CK_PURE

Restore sprite video memory

Returns

TRUE if successful, FALSE otherwise.

Remarks

If the sprite is already in video memory, this function copies the content of the system memory data to video memory otherwise it fails.

See Also

SystemToVideoMemory


CKSprite::SetDesiredVideoFormat

Virtual Method Method CKSprite::SetDesiredVideoFormat

virtual void CKSprite::SetDesiredVideoFormat(VX_PIXELFORMAT pf) CK_PURE

Sets the desired surface pixel format in video memory.

Parameters

Input argument pf

A VX_PIXELFORMAT giving the desired pixel format.

Remarks

As its name indicates theis method only sets a “desired” video memory pixel format. The render engine will try to use this format is possible otherwise should find the nearest appropriate pixel format.

See Also

GetVideoPixelFormat,GetDesiredVideoFormat,


CKSprite::SetDynamicHint

Virtual Method Method CKSprite::SetDynamicHint

virtual void CKSprite::SetDynamicHint(CKBOOL Dynamic)

Sets a hint to indicate the bitmap is changed frequently.

Remarks

+If the bitmap content is changed very frequently or to generate dynamic video sprites / textures you should set this hint. +On recent graphics card this hint can be taken into account to generate efficient dynamic textures. +This hint is not saved it can be used on textures and sprite created on the fly. +If the Texture or sprite is already in video memory you will have to reload it in video memory using FreeVideoMemory/SystemToVideoMemory


CKSprite::SystemToVideoMemory

Virtual Method Method CKSprite::SystemToVideoMemory

virtual CKBOOL CKSprite::SystemToVideoMemory(CKRenderContext *Dev,CKBOOL Clamping =FALSE) CK_PURE

Allocates and copies the sprite image from system to video memory.

Parameters

Input argument Dev | A pointer to a CKRenderContext on which the sprite is to be used.
Input argument Clamping | used internally.

Returns

TRUE if successful, FALSE otherwise.

Remarks

This method is automatically called by the framework when a sprite needs to be drawn and is not present in video memory. Use this function to creates the video memory copy. Usually, FreeVideoMemory is called for sprites that won't be visible for a long time. When one of these sprites should be used again, calling SystemToVideoMemory ensures that the sprite will be stored into video memory.

See Also

FreeVideoMemory,Restore


CKSprite::FlushSurfacePtr

Virtual Method Method CKSprite::FlushSurfacePtr

virtual CKBOOL CKSprite::FlushSurfacePtr(int Slot=-1) CK_PURE

Flush a slot system memory

Parameters

Input argument Slot

In a multi-images bitmap, number of the image slot which memory should be freed.

Remarks

This method frees the memory allocated in system memory for a given bitmap slot.

See Also

LockSurfacePtr,SetPixel


CKSprite::GetPixel

Virtual Method Method CKSprite::GetPixel

virtual CKDWORD CKSprite::GetPixel(int x,int y,int slot=-1) CK_PURE

Gets the color of a pixel.

Parameters

Input argument x | X position of the pixel to set the color of.
Input argument y | Y position of the pixel to set the color of.
Input argument slot | Index of the slot in which the pixel should be get or -1 for the current slot.

Returns

Color of the pixel (32 bit ARGB)

Remarks

There is no check on the validity of x or y parameter so its the user responsability.

See Also

LockSurfacePtr,SetPixel


CKSprite::LockSurfacePtr

Virtual Method Method CKSprite::LockSurfacePtr

virtual CKBYTE *CKSprite::LockSurfacePtr(int Slot=-1) CK_PURE

Returns a pointer to the image surface buffer.

Parameters

Input argument Slot

In a multi-images texture, index of the image slot to get surface pointer of. -1 means the current active slot.

Returns

A valid pointer to the texture buffer or NULL if failed.

Remarks

The return value is a pointer on the system memory copy of the sprite. If any changes are made (write access) to the image surface, you must either call Restore which immediatly copies the sprite back in video memory or ReleaseSurfacePtr() which flags this sprite as to be reloaded before it is used next time.

See Also

ReleaseSurfacePtr,SetPixel,GetPixel


CKSprite::ReleaseSurfacePtr

Virtual Method Method CKSprite::ReleaseSurfacePtr

virtual CKBOOL CKSprite::ReleaseSurfacePtr(int Slot=-1) CK_PURE

Marks a slot as modified.

Parameters

Input argument Slot

In a multi-images sprite, number of the image slot to mark as invalid.

Returns

TRUE if successful.

Remarks

When changes are made to the bitmap data (using LockSurfacePtr or SetPixel) this method marks the changed slot so that they can reloaded in video memory when necessary.

See Also

LockSurfacePtr,SetPixel


CKSprite::SetPixel

Virtual Method Method CKSprite::SetPixel

virtual CKBOOL CKSprite::SetPixel(int x,int y,CKDWORD col,int slot=-1) CK_PURE

Sets the color of a pixel.

Parameters

Input argument x | X position of the pixel to set the color of.
Input argument y | Y position of the pixel to set the color of.
Input argument col | A Dword ARGB color to set
Input argument slot | Index of the slot in which the pixel should be set or -1 for the current slot.

Returns

TRUE if successful, FALSE otherwise.

Remarks

There is no check on the validity of x or y parameter so its the user responsability. Sets the color of a pixel in the copy of the texture in system memory. Changes will only be visible after using Restore() function to force the sprite to re-load from system memory.

See Also

LockSurfacePtr,GetPixel,ReleaseSurfacePtr


CKSprite::GetHeight

Virtual Method Method CKSprite::GetHeight

virtual int CKSprite::GetHeight() CK_PURE

Gets the image height

Returns

Image height

See Also

GetBytesPerLine,GetWidth,GetBitsPerPixel


CKSprite::GetSystemTextureDesc

Virtual Method Method CKSprite::GetSystemTextureDesc

virtual CKBOOL CKSprite::GetSystemTextureDesc(VxImageDescEx& desc) CK_PURE

Gets Image format description

Parameters

Output argument desc

A reference to a VxImageDescEx structure that will be filled with system memory format information.

Returns

TRUE.

Remarks

The desc parameter will be filled with the size,pitch,bpp and mask information on how the sprite is stored in system memory.

See Also

GetVideoPixelFormat,SetDesiredVideoFormat


CKSprite::GetWidth

Virtual Method Method CKSprite::GetWidth

virtual int CKSprite::GetWidth() CK_PURE

Gets the image width

Returns

Image width

See Also

GetBytesPerLine,GetHeight,GetBitsPerPixel


CKSprite::SetSaveFormat

Virtual Method Method CKSprite::SetSaveFormat

virtual CKBitmapProperties* CKSprite::GetSaveFormat() CK_PURE
virtual void CKSprite::SetSaveFormat(CKBitmapProperties* format) CK_PURE

Sets the saving format.

Parameters

Input argument format

A CKBitmapProperties that contain the format in which the bitmap should be saved.

Remarks

If the save options have been set to CKTEXTURE_IMAGEFORMAT you can specify a format in which the sprite will be converted before being saved inside the composition file. The CKBitmapProperties structure contains the CKGUID of a BitmapReader that is to be used plus some additionnal settings specific to each format.

See Also

SetSaveOptions,CKBitmapProperties,CKBitmapReader


CKSprite::SetSaveOptions

Virtual Method Method CKSprite::SetSaveOptions

virtual CK_BITMAP_SAVEOPTIONS CKSprite::GetSaveOptions() CK_PURE
virtual void CKSprite::SetSaveOptions(CK_BITMAP_SAVEOPTIONS Options) CK_PURE

Sets the saving options.

Parameters

Input argument Options

Save Options.

Remarks

When saving a composition sprites can kept as reference to external files or converted to a given format and saved inside the composition file. The CK_BITMAP_SAVEOPTIONS enumeration exposes the available options.

See Also

SetSaveFormat,CK_BITMAP_SAVEOPTIONS


CKSprite::Cast

Static Object Method CKSprite::Cast

static CKSprite* CKSprite::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKSprite* anim = CKSprite::Cast(Object);


CKSprite::SetAlphaTest

Virtual Method Method CKSprite::SetAlphaTest

virtual void CKSprite::SetAlphaTest(CKBOOL Enable,CKBYTE RefValue,VXCMPFUNC AlphaTestFunc) CK_PURE
virtual CKBOOL CKSprite::AlphaTestEnabled() CK_PURE
virtual CKBYTE CKSprite::GetAlphaTestRefValue() CK_PURE
virtual VXCMPFUNC CKSprite::GetAlphaTestFunc() CK_PURE

Sets the sprite alpha testing

Parameters

Input argument Enable | TRUE to enable alpha testing.
Input argument RefValue | Reference value (0..255) used to perform alpha testing
Input argument AlphaTestFunc | Comparison function to perfom between current pixel alpha value and reference value.

Returns

AlphaTestEnabled returns TRUE if alpha test is enabled. GetAlphaTestRefValue returns the value used as reference for comparison functions. GetAlphaTestFunc returns the comparison function.

Remarks

The sprite video format must contain an alpha channel for alpha testing to be useful. The default rendering of a sprite does not perform any blending, alpha testing filtering or color modulation. As for a CKMaterial some options can be controlled with the CKSprite::SetRenderOptions method using the VxSpriteRenderOptions structure to describe the special settings.Or each feature can be set individually using the SetAlphaTest,SetColorModulate,SetBlending,SetFiltering.

See Also

SetRenderOptions,VxSpriteRenderOptions,VXSPRITE_RENDEROPTIONS,VXCMPFUNC


CKSprite::SetBlending

Virtual Method Method CKSprite::SetBlending

virtual void CKSprite::SetBlending(CKBOOL Enable,VXBLEND_MODE SrcBlendMode,VXBLEND_MODE DstBlendMode) CK_PURE
virtual CKBOOL CKSprite::BlendingEnabled() CK_PURE
virtual VXBLEND_MODE CKSprite::GetSourceBlendMode() CK_PURE
virtual VXBLEND_MODE CKSprite::GetDestinationBlendMode() CK_PURE

Sets the sprite blending modes

Parameters

Input argument Enable | TRUE to enable blending.
Input argument SrcBlendMode | Source blend mode.
Input argument DstBlendMode | Destination blend mode.

Returns

BlendingEnabled returns TRUE if blending is enabled. GetSourceBlendMode returns the current source blend mode. GetDestinationBlendMode returns the current destination blend mode.

Remarks

See VXBLEND_MODE for details on blending formulae. The default rendering of a sprite does not perform any blending, alpha testing filtering or color modulation. As for a CKMaterial some options can be controlled with the CKSprite::SetRenderOptions method using the VxSpriteRenderOptions structure to describe the special settings. Or each feature can be set individually using the SetAlphaTest,SetColorModulate,SetBlending,SetFiltering.

See Also

SetRenderOptions,VxSpriteRenderOptions,VXSPRITE_RENDEROPTIONS,


CKSprite::SetColorModulate

Virtual Method Method CKSprite::SetColorModulate

virtual void CKSprite::SetColorModulate(CKBOOL Enable,const VxColor& color) CK_PURE
virtual CKBOOL CKSprite::ColorModulateEnabled() CK_PURE
virtual VxColor CKSprite::GetModulateColor() CK_PURE

Sets the sprite color modulation

Parameters

Input argument Enable | Enables modulation of sprite color by a used defined color.
Input argument color | Color to modulate the sprite by.

Returns

ColorModulateEnabled returns TRUE if modulation is enabled. GetModulateColor returns the color used to multiply the sprite pixels.

Remarks

+The default rendering of a sprite does not perform any blending, alpha testing filtering or color modulation. +As for a CKMaterial some options can be controlled with the CKSprite::SetRenderOptions method using the VxSpriteRenderOptions structure to describe the special settings. Or each feature can be set individually using the SetAlphaTest,SetColorModulate,SetBlending,SetFiltering.

See Also

SetRenderOptions,VxSpriteRenderOptions,VXSPRITE_RENDEROPTIONS,


CKSprite::SetFiltering

Virtual Method Method CKSprite::SetFiltering

virtual void CKSprite::SetFiltering(CKBOOL Enable) CK_PURE
virtual CKBOOL CKSprite::FilteringEnabled() CK_PURE

Sets the sprite linear filtering

Parameters

Input argument Enable

TRUE to enable linear filtering.

Returns

FilteringEnabled returns TRUE if filtering test is enabled.

Remarks

The default rendering of a sprite does not perform any blending, alpha testing filtering or color modulation. As for a CKMaterial some options can be controlled with the CKSprite::SetRenderOptions method using the VxSpriteRenderOptions structure to describe the special settings. Or each feature can be set individually using the SetAlphaTest,SetColorModulate,SetBlending,SetFiltering. If Filtering is enabled a bilinear filtering is performed when sprite are stretched.

See Also

SetRenderOptions,VxSpriteRenderOptions,VXSPRITE_RENDEROPTIONS,


CKSprite::SetRenderOptions

Virtual Method Method CKSprite::SetRenderOptions

virtual void CKSprite::SetRenderOptions(const VxSpriteRenderOptions& option) CK_PURE
virtual const VxSpriteRenderOptions& CKSprite::GetRenderOptions() CK_PURE

Sets the rendering options (blending,alpha test,filtering)

Parameters

Input argument option

New options to use to render this sprite.

Returns

Currently used render options.

Remarks

The default rendering of a sprite does not perform any blending, filtering or color modulation. As for a CKMaterial some options can be controlled with the CKSprite::SetRenderOptions method using the VxSpriteRenderOptions structure to describe the special settings. Or each feature can be set individually using the SetAlphaTest,SetColorModulate,SetBlending,SetFiltering.

See Also

SetAlphaTest,SetColorModulate,SetBlending,SetFiltering,VxSpriteRenderOptions,VXSPRITE_RENDEROPTIONS,


CKSprite::SetSystemCaching

Virtual Method Method CKSprite::SetSystemCaching

virtual void CKSprite::SetSystemCaching(CK_BITMAP_SYSTEMCACHING iOptions) CK_PURE

Sets the system memory caching option.

Parameters

Input argument iOptions

System Caching Options.

See Also

SetSaveFormat,CK_BITMAP_SYSTEMCACHING


CKSprite::GetTransparentColor

Virtual Method Method CKSprite::GetTransparentColor

virtual CKDWORD CKSprite::GetTransparentColor() CK_PURE

Returns the transparent color.

Returns

Color: A 32 bit ARGB transparent color.

Remarks

0x00000000 (black) is the default transparent color.

See Also

SetTranparentColor,SetTransparent


CKSprite::IsTransparent

Virtual Method Method CKSprite::IsTransparent

virtual CKBOOL CKSprite::IsTransparent() CK_PURE

Returns whether color keyed transparency is enabled.

Parameters

Transparency: TRUE activates transparency, FALSE disables it.

Returns

TRUE if transparency is enabled.

See Also

IsTransparent


CKSprite::SetPickThreshold

Virtual Method Method CKSprite::SetPickThreshold

virtual void CKSprite::SetPickThreshold(int pt) CK_PURE
virtual int CKSprite::GetPickThreshold() CK_PURE

Sets pick threshold value.

Parameters

Input argument pt

Pick threshold value to be set.

Remarks

The pick threshold is used when picking transparent sprites. It is the minimum value for alpha component below which picking is not valid.So this value is supposed to be in the range 0..255 and the default value 0 means the picking is always valid. But if a value >0 is used and the texture use transparency (some pixels of the bitmap will have alpha component of 0) a sprite will not be picked on its transparent part.

See Also

CKRenderContext::Pick


CKSprite::SetTransparent

Virtual Method Method CKSprite::SetTransparent

virtual void CKSprite::SetTransparent(CKBOOL Transparency) CK_PURE

Enables or disables the color key transparency.

Parameters

Input argument Transparency

TRUE activates transparency, FALSE disables it.

Remarks

0x00000000 (black) is the default transparent color. Setting on the transparency and a transparent color automatically updates the alpha channel so that pixel with the transparent color have a 0 alpha value.

See Also

IsTransparent,SetTranparentColor


CKSprite::SetTransparentColor

Virtual Method Method CKSprite::SetTransparentColor

virtual void CKSprite::SetTransparentColor(CKDWORD Color) CK_PURE

Sets the transparent color.

Parameters

Input argument Color

A 32 bit ARGB transparent color.

Remarks

0x00000000 (black) is the default transparent color. Setting on the transparency and a transparent color automatically updates the alpha channel so that pixel with the transparent color have a 0 alpha value.

See Also

GetTranparentColor,SetTransparent


CKSprite3D

Class CKSprite3D

Sprite with 3d position and orientation.

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show brief derivation trees

CKSprite3D

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity
Show full derivation trees

CKSprite3D

Remarks

This class represents a sprite with a position and orientation in 3D. The CKSprite3D class is derived from the CK3DEntity class. The representation of the Sprite3D is given by a material which contain the texture and render settings. The sprite3D orientation can be free or constrained (billboard or axis specific). The Class id of a CKSprite3D is CKCID_SPRITE3D Size and position of a sprite relatively to is referential (CK3dEntity) can be controlled using SetSize and SetOffset. The default size of a sprite is (1,1) and its offset is (0,0)

Groups

Size and Position
Virtual Method Method GetOffset | Returns the offset between the 3dEntity center and the center of the rectangular shape of the sprite.
Virtual Method Method GetSize | Gets the size of the rectangular shape of the sprite.
Virtual Method Method SetOffset | Sets the offset between the 3dEntity center and the center of the rectangular shape of the sprite.
Virtual Method Method SetSize | Sets the size of the rectangular shape of the sprite.
Settings
Virtual Method Method GetFlags | Returns the entity flags
Virtual Method Method GetMaterial | Returns the material used by the sprite for rendering.
Virtual Method Method GetMode | Gets the orientation mode of the Sprite3D.
Virtual Method Method GetMoveableFlags | Sets the moveable flags
Virtual Method Method IgnoreAnimations | Excludes this entity from animations.
Virtual Method Method ModifyMoveableFlags | Changes the entity flags
Virtual Method Method SetFlags | Sets the entity flags
Virtual Method Method SetMaterial | Sets the material used by the sprite for rendering.
Virtual Method Method SetMode | Sets the orientation mode of the Sprite3D.
Virtual Method Method SetPickable | Sets if the entity should be pickable
Virtual Method Method SetRenderAsTransparent | Makes this entity to be rendered as other transparents objects
Mapping
Virtual Method Method GetUVMapping | Returns the texture mapping of the Sprite3D.
Virtual Method Method SetUVMapping | Sets the texture mapping of the Sprite3D.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.

See Also

CK3dEntity,CKMaterial


CKSprite3D::GetOffset

Virtual Method Method CKSprite3D::GetOffset

virtual void CKSprite3D::GetOffset(Vx2DVector& vect) CK_PURE

Returns the offset between the 3dEntity center and the center of the rectangular shape of the sprite.

Parameters

Input argument vect

The offset in local coordinates.

Remarks

Offset is used to specify offset between the sprite vertices and the 3dEntity center for example, if OffsetX = 0.0 and OffsetY = 1.0 the sprite rotates around the center of its bottom edge. Values x = 1.0 and y = 1.0 specifies the lower left corner and values x = -1.0 and y = -1.0 specifies the top right corner.

See Also

GetOffset,SetSize,GetSize


CKSprite3D::GetSize

Virtual Method Method CKSprite3D::GetSize

virtual void CKSprite3D::GetSize(Vx2DVector& vect) CK_PURE

Gets the size of the rectangular shape of the sprite.

Parameters

Input argument vect

A Vx2DVector that will be filled with the size of the Sprite3D in local coordinates, to be filled.

Remarks

The default size of a sprite3D is (1,1)

See Also

SetSize


CKSprite3D::SetOffset

Virtual Method Method CKSprite3D::SetOffset

virtual void CKSprite3D::SetOffset(Vx2DVector& vect) CK_PURE

Sets the offset between the 3dEntity center and the center of the rectangular shape of the sprite.

Parameters

Input argument vect

The offset in local coordinates.

Remarks

Offset is used to specify offset between the sprite vertices and the 3dEntity center for example, if OffsetX = 0.0 and OffsetY = 1.0 the sprite rotates around the center of its bottom edge. Values x = 1.0 and y = 1.0 specifies the lower left corner and values x = -1.0 and y = -1.0 specifies the top right corner.

See Also

GetOffset,SetSize,GetSize


CKSprite3D::SetSize

Virtual Method Method CKSprite3D::SetSize

virtual void CKSprite3D::SetSize(Vx2DVector& vect) CK_PURE

Sets the size of the rectangular shape of the sprite.

Parameters

Input argument vect

The size in local coordinates.

Remarks

The default size of a sprite3D is (1,1)

See Also

GetOffset, GetSize


CKSprite3D::GetMaterial

Virtual Method Method CKSprite3D::GetMaterial

virtual CKMaterial *CKSprite3D::GetMaterial() CK_PURE

Returns the material used by the sprite for rendering.

Returns

A pointer to the CKMaterial used for rendering.

Remarks

The material specify the texture and render options used to render the sprite. A Sprite3D with no material will not be rendered.

See Also

SetMaterial,CKMaterial,CKTexture


CKSprite3D::GetMode

Virtual Method Method CKSprite3D::GetMode

virtual VXSPRITE3D_TYPE CKSprite3D::GetMode() CK_PURE

Gets the orientation mode of the Sprite3D.

Returns

Orientation mode

See Also

VXSPRITE3D_TYPE, SetMode


CKSprite3D::SetMaterial

Virtual Method Method CKSprite3D::SetMaterial

virtual void CKSprite3D::SetMaterial(CKMaterial *Mat) CK_PURE

Sets the material used by the sprite for rendering.

Parameters

mat: A pointer to a CKMaterial to use for rendering.

Remarks

The material specify the texture and render options used to render the sprite. A Sprite3D with no material will not be rendered.

See Also

GetMaterial,CKMaterial,CKTexture,Using Materials


CKSprite3D::SetMode

Virtual Method Method CKSprite3D::SetMode

virtual void CKSprite3D::SetMode(VXSPRITE3D_TYPE Mode) CK_PURE

Sets the orientation mode of the Sprite3D.

Parameters

Input argument Mode

A VXSPRITE3D_TYPE type.

Remarks

This function sets the behavior of the sprite regarding to the camera (ie. you can specify if the sprite is locked on one axis or not). The default mode is VXSPRITE3D_BILLBOARD where the sprite3D always faces the current camera.

See Also

VXSPRITE3D_TYPE,GetMode


CKSprite3D::GetUVMapping

Virtual Method Method CKSprite3D::GetUVMapping

virtual void CKSprite3D::GetUVMapping(VxRect& rect) CK_PURE

Returns the texture mapping of the Sprite3D.

Parameters

Rect: A VxRect that will be filled with the Texture coordinates.

Remarks

Default texture coordinates are (0,0) <=> (1,1)

See Also

GetUVMapping


CKSprite3D::SetUVMapping

Virtual Method Method CKSprite3D::SetUVMapping

virtual void CKSprite3D::SetUVMapping(VxRect& rect) CK_PURE

Sets the texture mapping of the Sprite3D.

Parameters

Rect: Homogenous Texture coordinates.

Remarks

Default texture coordinates are (0,0) <=> (1,1)

See Also

GetUVMapping


CKSprite3D::Cast

Static Object Method CKSprite3D::Cast

static CKSprite3D* CKSprite3D::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKSprite3D* anim = CKSprite3D::Cast(Object);


CKSpriteText

Class CKSpriteText

Text Only sprites.

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK2dEntity

CKSprite
Show brief derivation trees

CKSpriteText

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK2dEntity

CKSprite
Show full derivation trees

CKSpriteText

Remarks

A SpriteText is a special kind of sprite that is used to draw text on screen. Methods provides acces to font,color,background color and transparency settings as well as text alignment in the sprite.

The size of image used to draw the text is given by CKSprite::Create.

This class is provided more for debugging than for a real usage since changing the text every frame is a slow operation. Much faster text drawing can be achieved if the text changes often, using bitmap fonts and textures (See BitmapTextDisplay behavior for example)

Groups

Text
Virtual Method Method GetText | Gets the text drawn in the sprite.
Virtual Method Method GetTextU | Gets the text drawn in the sprite.
Virtual Method Method SetText | Sets the text drawn in the sprite.
Virtual Method Method SetTextU | Sets the text drawn in the sprite.
Appearence
Virtual Method Method GetAlign | Gets the drawing alignment of the sprite
Virtual Method Method GetBackgroundTextColor | Gets the background color.
Virtual Method Method GetTextColor | Gets the text color.
Virtual Method Method SetAlign | Sets the drawing alignment for the sprite
Virtual Method Method SetBackgroundColor | Sets the background color in the sprite.
Virtual Method Method SetFont | Sets the font used to draw the text in the sprite.
Virtual Method Method SetTextColor | Sets the text color.
Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.

See Also

CKSprite


CKSpriteText::GetText

Virtual Method Method CKSpriteText::GetText

virtual CKSTRING CKSpriteText::GetText() CK_PURE

Gets the text drawn in the sprite.

Returns

A CKSTRING containing the current text.

See Also

SetText


CKSpriteText::GetTextU

Virtual Method Method CKSpriteText::GetTextU

virtual CKUSTRING CKSpriteText::GetTextU() CK_PURE

Gets the text drawn in the sprite.

Returns

A CKSTRING containing the current text.

Remarks

Exists in U version for unicode strings.

See Also

SetText


CKSpriteText::SetText

Virtual Method Method CKSpriteText::SetText

virtual void CKSpriteText::SetText(CKSTRING text) CK_PURE

Sets the text drawn in the sprite.

Parameters

Input argument text

A CKSTRING containing the new text.

See Also

GetText


CKSpriteText::SetTextU

Virtual Method Method CKSpriteText::SetTextU

virtual void CKSpriteText::SetTextU(CKUSTRING text) CK_PURE

Sets the text drawn in the sprite.

Parameters

Input argument text

A CKSTRING containing the new text.

Remarks

Exists in U version for unicode strings.

See Also

GetText


CKSpriteText::GetAlign

Virtual Method Method CKSpriteText::GetAlign

virtual CKSPRITETEXT_ALIGNMENT CKSpriteText::GetAlign() CK_PURE

Gets the drawing alignment of the sprite

Returns

Current alignment options.

See Also

CKSPRITETEXT_ALIGNMENT, SetAlign


CKSpriteText::GetBackgroundTextColor

Virtual Method Method CKSpriteText::GetBackgroundTextColor

virtual CKDWORD CKSpriteText::GetBackgroundTextColor() CK_PURE

Gets the background color.

Returns

Current background color.

See Also

SetTextColor,GetTextColor, SetBackgroundColor


CKSpriteText::GetTextColor

Virtual Method Method CKSpriteText::GetTextColor

virtual CKDWORD CKSpriteText::GetTextColor() CK_PURE

Gets the text color.

Returns

Current text color.

See Also

SetTextColor,GetBackgroundColor,SetBackgroundColor


CKSpriteText::SetAlign

Virtual Method Method CKSpriteText::SetAlign

virtual void CKSpriteText::SetAlign(CKSPRITETEXT_ALIGNMENT align) CK_PURE

Sets the drawing alignment for the sprite

Parameters

Input argument align

A combination of CKSPRITETEXT_ALIGNMENT flags specifying how to align the text inside the sprite.

See Also

CKSPRITETEXT_ALIGNMENT, GetAlign


CKSpriteText::SetBackgroundColor

Virtual Method Method CKSpriteText::SetBackgroundColor

virtual void CKSpriteText::SetBackgroundColor(CKDWORD col) CK_PURE

Sets the background color in the sprite.

Parameters

Input argument col

CKDWORD containing the new color ( 32 bit ARGB )

See Also

SetTextColor,GetTextColor, GetBackgroundColor


CKSpriteText::SetFont

Virtual Method Method CKSpriteText::SetFont

virtual void CKSpriteText::SetFont(CKSTRING FontName,int FontSize=12,int Weight=400,CKBOOL italic=FALSE,CKBOOL underline=FALSE) CK_PURE

Sets the font used to draw the text in the sprite.

Parameters

Input argument FontName | Name of the font
Input argument FontSize | Size of the font
Input argument Weight | Weight ot the font
Input argument italic | TRUE to create an italic font
Input argument underline | TRUE to create an underlined font

Remarks

This function use the Win32 API CreateFont function to create the font that will be used to draw text in the sprite. See CreateFont in the Win32 API documentation for more details.

See Also

RCKSpriteText


CKSpriteText::SetTextColor

Virtual Method Method CKSpriteText::SetTextColor

virtual void CKSpriteText::SetTextColor(CKDWORD col) CK_PURE

Sets the text color.

Parameters

Input argument col

CKDWORD containing the new color ( 32 bit ARGB )

See Also

GetTextColor,GetBackgroundColor,SetBackgroundColor


CKSpriteText::Cast

Static Object Method CKSpriteText::Cast

static CKSpriteText* CKSpriteText::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKSpriteText* anim = CKSpriteText::Cast(Object);


CKTargetCamera

Class CKTargetCamera

A camera with a target

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity

CKCamera
Show brief derivation trees

CKTargetCamera

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity

CKCamera
Show full derivation trees

CKTargetCamera

Remarks

A target camera is derived from a CKCamera, and has a target: it always points to its target 3D entity. When the target is undefined, the camera behaves like a standard camera.

The class id of CKCamera is CKCID_TARGETCAMERA.

Groups

Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.


CKTargetCamera::Cast

Static Object Method CKTargetCamera::Cast

static CKTargetCamera* CKTargetCamera::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKTargetLight

Class CKTargetLight

A light with a target

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity

CKLight
Show brief derivation trees

CKTargetLight

CKObject

CKSceneObject

CKBeObject

CKRenderObject

CK3dEntity

CKLight
Show full derivation trees

CKTargetLight

Remarks

A CKTargetLight is a light with a target. This class is derived from the CKLight class. It manages a target entity, instance of CK3dEntity, to which it always points. If the target is undefined, the light behaves like a standard light.

At creation time, the instance of CKTargetLight has no target.

The class identifier of CKTargetLight is CKCID_TARGETLIGHT.

Groups

Cast operator
Static Object Method Cast | Dynamic cast operator.
Static Object Method Cast | Dynamic cast operator.


CKTargetLight::Cast

Static Object Method CKTargetLight::Cast

static CKTargetLight* CKTargetLight::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKTexture

CKBeObject

CKBitmapData
Show full derivation trees

CKTexture

Remarks

CKTexture is used to described textures applied to objects. As a child class of CKBeObject, textures can also have behaviors. Images describing textures can be loaded from various file formats (GIF,JPG,BMP,TGA,TIFF,AVI,PCX).

A texture is not bound to contain only one image. Additional images can be added to a texture or loaded through LoadMovie or LoadImage function.

A texture surface information is stored in a buffer in system memory and load into video memory when needed. You can acces system memory surface with LockSurfacePtr for procedural texturing.

The class identifier of CKTexture is CKCID_TEXTURE.

Groups

Operations | Bitmap storage info | Cast operator | Creation | MipMaps | Movie | Rasterizer access | Rendering | User Mipmaps | Video memory management

Operations
Pure Virtual Method Method EnsureVideoMemory | This function ensure the correct representation of the texture is in video memory.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Pure Virtual Method Method Swap | Swap this texture internal datas with another texture object. The object name is not swapped.
Bitmap storage info
Method GetHeight | Gets the image height
Method GetImageDesc | Gets Image format description
Pure Virtual Method Method GetSystemTextureDesc | Gets Image format description
Method GetWidth | Gets the image width
Cast operator
Static Object Method Cast | Dynamic cast operator.
Creation
Pure Virtual Method Method Create | Creates an empty image.
Method CreateImage | Creates an empty image.
Pure Virtual Method Method LoadImage | Loads a image slot from a file.
Method ResizeImages | Resizes all slots.
Method SaveImage | Saves an image slot to a file.
Method SaveImageAlpha | Saves an image alpha channel slot to a file.
MipMaps
Pure Virtual Method Method GetMipmapCount | Returns whether mipmaps levels are automatically generated.
Pure Virtual Method Method UseMipmap | Generates the mipmap levels.
Movie
Method GetMovieFileName | Returns the name of the movie file used by this bitmap.
Method GetMovieReader | Returns the movie reader used to decompress the current movie.
Pure Virtual Method Method LoadMovie | Creates a multi-image texture from a movie file.
Rasterizer access
Pure Virtual Method Method GetRstTextureIndex | Gets the texture index of this texture in the rasterizer context.
Pure Virtual Method Method GetRstTextureObject | Gets the texture object of this texture in the rasterizer context.
Rendering
Pure Virtual Method Method SetAsCurrent | Sets this texture as the current to to use when drawing primitives.
User Mipmaps
Pure Virtual Method Method GetUserMipMapLevel | Gets access to a user mipmap level.
Pure Virtual Method Method SetUserMipMapMode | Creates a set of mipmap level image the user can specify.
Video memory management
Method AuthorizeConditionalNonPow2 | Do we authorize to create the video texture with a non power of two size
Pure Virtual Method Method CopyContext | Copies the content of the back buffer to the texture video memory.
Pure Virtual Method Method FreeVideoMemory | Frees the texture video memory.
Method GetDesiredVideoFormat | Returns the desired pixel format in video memory.
Pure Virtual Method Method GetVideoPixelFormat | Returns the pixel format of the texture surface in video memory.
Pure Virtual Method Method GetVideoTextureDesc | Returns a information about how texture is stored in video memory.
Pure Virtual Method Method IsInVideoMemory | Returns whether the texture is present in video memory
Pure Virtual Method Method LockVideoMemory | Gives access to the video memory surface pointer.
Pure Virtual Method Method Restore | Restore texture video memory content
Method SetDesiredVideoFormat | Sets the desired surface pixel format in video memory.
Method SetDynamicHint | Sets a hint to indicate the bitmap is changed frequently.
Pure Virtual Method Method SystemToVideoMemory | Allocates and copies the texture image from system to video memory.
Pure Virtual Method Method VideoToSlotSystemMemory | Transfers the content of another texture (possibly this texture) into a target slot
Pure Virtual Method Method VideoToSystemMemory | Transfers the content of the video memory to the system memory copy.

See Also

CKBitmapData,CKMaterial,CKRenderContext


CKTexture::EnsureVideoMemory

Pure Virtual Method Method CKTexture::EnsureVideoMemory

virtual BOOL CKTexture::EnsureVideoMemory(CKRenderContext* ctx,CKBOOL Clamping =FALSE)

This function ensure the correct representation of the texture is in video memory.

Remarks

+This method is automatically called by SetAsCurrent to ensure the correct data is present in video memory (in the case of a movie texture for example). +It can be called by a shader manager to ensure the texture is ready in video memory.

See Also

SetAsCurrent,SystemToVideoMemory,Restore


CKTexture::Swap

Pure Virtual Method Method CKTexture::Swap

virtual void CKTexture::Swap(CKTexture& other)

Swap this texture internal datas with another texture object. The object name is not swapped.


CKTexture::GetSystemTextureDesc

Pure Virtual Method Method CKTexture::GetSystemTextureDesc

virtual CKBOOL CKTexture::GetSystemTextureDesc(VxImageDescEx& desc)

Gets Image format description

Parameters

Input argument desc

A reference to a VxImageDescEx structure that will be filled with system memory format information.

Returns

Value | Meaning
TRUE |

Remarks

The desc parameter will be filled with the size,pitch,bpp and mask information on how the texture is stored in system memory.

See Also

GetVideoPixelFormat,SetDesiredVideoFormat


CKTexture::Cast

Static Object Method CKTexture::Cast

static CKTexture* CKTexture::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKTexture::Create

Pure Virtual Method Method CKTexture::Create

virtual CKBOOL CKTexture::Create(int Width,int Height,int BPP=32,int Slot=0)

Creates an empty image.

Parameters

Input argument Width | width in pixel of the image to create
Input argument Height | height in pixel of the image to create
Input argument BPP | Bit per pixel of the image
Input argument Slot | If there a multiple images, index of the image slot to create.

Returns

TRUE if successful, FALSE otherwise.

Remarks

FILE IO

The image is initialized to black with full alpha (all colors to 0xFF000000) The name for the created slot is set to “” If there was already some slots created but with a different width or height the method returns FALSE.

See Also

SaveImage,CKBitmapData::CreateImage


CKTexture::LoadImage

Pure Virtual Method Method CKTexture::LoadImage

virtual CKBOOL CKTexture::LoadImage(CKSTRING Name,int Slot=0)

Loads a image slot from a file.

Returns

TRUE if successful, FALSE otherwise.

Remarks

The supported image formats depend on the image readers installed. The default available readers support BMP,TGA,JPG,PNG and GIF format

See Also

SaveImage


CKTexture::GetMipmapCount

Pure Virtual Method Method CKTexture::GetMipmapCount

virtual int CKTexture::GetMipmapCount()

Returns whether mipmaps levels are automatically generated.

Returns

TRUE if mipmap levels are generated .

Remarks

If generation of mipmaps levels is enabled they are automatically generated each time the texture video surface is restored (Restore or SystemToVideoMemory).

See Also

UseMipmap


CKTexture::UseMipmap

Pure Virtual Method Method CKTexture::UseMipmap

virtual CKBOOL CKTexture::UseMipmap(int UseMipMap)

Generates the mipmap levels.

Parameters

Input argument UseMipMap

TRUE if mipmap levels should be generated .

Returns

TRUE if successful

Remarks

If generation of mipmaps levels is enabled they are automatically generated each time the texture video surface is restored (Restore or SystemToVideoMemory).

See Also

GetMipmapCount


CKTexture::LoadMovie

Pure Virtual Method Method CKTexture::LoadMovie

virtual CKBOOL CKTexture::LoadMovie(CKSTRING Name)

Creates a multi-image texture from a movie file.

Returns

TRUE if loading was successful, FALSE otherwise.

Remarks

The supported movie formats depend on the image readers and codecs installed. The default available reader support AVI files.

See Also

LoadImage,Create


CKTexture::GetRstTextureIndex

Pure Virtual Method Method CKTexture::GetRstTextureIndex

virtual int CKTexture::GetRstTextureIndex()

Gets the texture index of this texture in the rasterizer context.

Returns

Index of this texture in the rasterizer context

Remarks

The default implementation of the render engine uses an underlying rasterizer to store and render primitives. This method returns the index of the texture as stored by the CKRasterizerContext. With the render engine source code you can then access to the driver specific (DX5,7,8,OpenGL) data for this texture.

See Also

GetRstTextureObject,CKRenderContext::GetRasterizerContext


CKTexture::GetRstTextureObject

Pure Virtual Method Method CKTexture::GetRstTextureObject

virtual void* CKTexture::GetRstTextureObject()

Gets the texture object of this texture in the rasterizer context.

Returns

A pointer to a structure that represents the texture object or NULL if the texture is not yet stored in the rasterizer context.

Remarks

+The default implementation of the render engine uses an underlying rasterizer to store and render primitives. +This method returns the object of the texture as stored by the CKRasterizerContext. +With the render engine source code you can then access to the driver specific (DX7,8,9,OpenGL) data for this texture by casting the returned pointer in the appropriate structure (CKDX8TextureDesc,CKDX9TextureDesc).

See Also

GetRstTextureIndex,CKRenderContext::GetRasterizerContext


CKTexture::SetAsCurrent

Pure Virtual Method Method CKTexture::SetAsCurrent

virtual CKBOOL CKTexture::SetAsCurrent(CKRenderContext* Dev,CKBOOL Clamping =FALSE,int TextureStage = 0)

Sets this texture as the current to to use when drawing primitives.

Parameters

Input argument Dev | A pointer to the CKRenderContext on which this texture should be set as current.
Input argument Clamping | TRUE if the texture addressing mode is clamp.
Input argument TextureStage | Texture stage on which the texture should be set.

Returns

TRUE if successful.

Remarks

When setting a texture as current the render engine will use it when drawing primitives. This method is automatically called by CKMaterial::SetAsCurrent. If the texture is transparent alpha testing is enabled (SetState(VXRENDERSTATE_ALPHATESTENABLE,TRUE)

See Also

CKRenderContext::SetCurrentMaterial,CKMaterial::SetAsCurrent,CKRenderContext::SetState


CKTexture::GetUserMipMapLevel

Pure Virtual Method Method CKTexture::GetUserMipMapLevel

virtual BOOL CKTexture::GetUserMipMapLevel(int Level,VxImageDescEx& ResultImage)

Gets access to a user mipmap level.

Returns

TRUE if successful, FALSE otherwise

Remarks

This method returns a VxImageDescEx structure which contain all details (included surface pointer in .Image member) about a user specified level of mipmap. This method must be called for every available level of mipmap before the texture is used otherwise once every level of mipmap have been set, you must called FreeVideoMemory to ensure the texture in video memory reflects the changes you made to the mipmaps level...

See Also

SetUserMipMapMode


CKTexture::SetUserMipMapMode

Pure Virtual Method Method CKTexture::SetUserMipMapMode

virtual CKBOOL CKTexture::SetUserMipMapMode(CKBOOL UserMipmap)

Creates a set of mipmap level image the user can specify.

Parameters

Input argument UserMipmap

TRUE to use user specified images as mipmap FALSE otherwise.

Returns

TRUE if successful, FALSE otherwise

Remarks

The default behavior for a texture is to automatically generate its mipmap level images when loaded on the video card. A user can specify its own images using this method. To set up the image to use for a particular level use GetMipMapLevelImageBuffer This method only works for mono-slot textures.

See Also

GetUserMipMapLevel


CKTexture::CopyContext

Pure Virtual Method Method CKTexture::CopyContext

virtual CKBOOL CKTexture::CopyContext(CKRenderContext* ctx,VxRect* Src,VxRect* Dest,int CubeMapFace =0)

Copies the content of the back buffer to the texture video memory.

Parameters

Input argument ctx | A pointer to the CKRenderContext which content should be copied.
Input argument Src | Source rectangle in the render context .
Input argument Dest | Destination rectangle in the texture (Must be the same size than Src).

Returns

TRUE if successful, FALSE otherwise.

Remarks

This method can be used to copy the content of the render context (back buffer) to a texture. This does not update the system memory copy.

See Also

CKRenderContext::SetRenderTarget


CKTexture::FreeVideoMemory

Pure Virtual Method Method CKTexture::FreeVideoMemory

virtual CKBOOL CKTexture::FreeVideoMemory()

Frees the texture video memory.

Returns

TRUE if successful, FALSE otherwise.

Remarks

Use this function to manage which textures should be stored in video memory. Some video cards may use textures stored in sytem memory (ie. AGP). This method can be used in low video memory configuration to flush textures that have not been used for a long time.

See Also

SystemToVideoMemory


CKTexture::GetVideoPixelFormat

Pure Virtual Method Method CKTexture::GetVideoPixelFormat

virtual VX_PIXELFORMAT CKTexture::GetVideoPixelFormat()

Returns the pixel format of the texture surface in video memory.

Returns

Pixel format of video memory surface (VX_PIXELFORMAT) or VX_UNKNOWNPF if the texture is not in video memory.

See Also

SetDesiredVideoFormat, GetVideoTextureDesc


CKTexture::GetVideoTextureDesc

Pure Virtual Method Method CKTexture::GetVideoTextureDesc

virtual CKBOOL CKTexture::GetVideoTextureDesc(VxImageDescEx& desc)

Returns a information about how texture is stored in video memory.

Parameters

Input argument desc

A reference to a VxImageDescEx structure that will be filled with video memory format information.

Returns

FALSE if the texture is not in video memory or invalid, TRUE otherwise.

See Also

GetVideoPixelFormat,SetDesiredVideoFormat


CKTexture::IsInVideoMemory

Pure Virtual Method Method CKTexture::IsInVideoMemory

virtual CKBOOL CKTexture::IsInVideoMemory()

Returns whether the texture is present in video memory

Returns

TRUE if the sprite is in video memory FALSE otherwise.

See Also

SystemToVideoMemory


CKTexture::LockVideoMemory

Pure Virtual Method Method CKTexture::LockVideoMemory

virtual BOOL CKTexture::LockVideoMemory(VxImageDescEx& Surface,int MipLevel = 0,VX_LOCKFLAGS Flags = VX_LOCK_DEFAULT)
virtual void CKTexture::UnlockVideoMemory(int MipLevel = 0)

Gives access to the video memory surface pointer.

Returns

TRUE if successful, FALSE if the texture is not currently in video memory

Remarks

This method fills the Surface structure with information regarding the video memory surface. Surface pointer is stored in the Surface.Image member. Once finish with the surface pointer you must release it by calling UnlockVideoMemory. Any rendering with a locked texture will fail. On some implementations such as GL or DX8 that do not support direct access to video memory the returned pointer can be on a system memory copy which can be very slow for partial write access.

See Also

VxImageDescEx,LockSurfacePtr,


CKTexture::Restore

Pure Virtual Method Method CKTexture::Restore

virtual CKBOOL CKTexture::Restore(CKBOOL Clamp = FALSE)

Restore texture video memory content

Returns

TRUE if successful, FALSE otherwise.

Remarks

If the texture is already in video memory, this function copies the content of the system memory data to video memory otherwise it fails.

See Also

SystemToVideoMemory


CKTexture::SystemToVideoMemory

Pure Virtual Method Method CKTexture::SystemToVideoMemory

virtual CKBOOL CKTexture::SystemToVideoMemory(CKRenderContext *Dev,CKBOOL Clamping =FALSE)

Allocates and copies the texture image from system to video memory.

Parameters

Input argument Dev

A pointer to a CKRenderContext on which the texture is to be used.

Returns

TRUE if successful, FALSE otherwise.

Remarks

+This method is automatically called by the framework when a texture needs to be drawn and is not present in video memory. +Use this function to creates the video memory copy. +Usually, you can call FreeVideoMemory for textures that won't be visible for a long time. When one of these sprites should be used again, calling SystemToVideoMemory ensures that the texture will be stored into video memory.

See Also

FreeVideoMemory,Restore


CKTexture::VideoToSlotSystemMemory

Pure Virtual Method Method CKTexture::VideoToSlotSystemMemory

virtual BOOL CKTexture::VideoToSlotSystemMemory(CKTexture& src, CKDWORD destSlot)

Transfers the content of another texture (possibly this texture) into a target slot

Returns

TRUE if successful, FALSE if the texture is not currently in video memory, or if the target slot do not exist

Remarks

The System Caching mode must be CKBITMAP_PROCEDURAL or CKBITMAP_VIDEOSHADOW for this method to work (that is a system copy must exist)

See Also

LockVideoMemory,LockSurfacePtr,


CKTexture::VideoToSystemMemory

Pure Virtual Method Method CKTexture::VideoToSystemMemory

virtual BOOL CKTexture::VideoToSystemMemory()

Transfers the content of the video memory to the system memory copy.

Returns

TRUE if successful, FALSE if the texture is not currently in video memory

Remarks

The System Caching mode must be CKBITMAP_PROCEDURAL or CKBITMAP_VIDEOSHADOW for this method to work (that is a system copy must exist)

See Also

LockVideoMemory,LockSurfacePtr,


CKVertexBuffer

Class CKVertexBuffer

Vertex buffer class.

Remarks

The CKVertexBuffer class provides an interface to create and manage a vertex buffer.

For devices that supports vertex buffer in hardware this can enable very fast rendering as the vertex data is already on the video card.

For other devices the implementation will provide a system memory pointer to hold the vertex data so that the user does not have to worry of the underlying implementation

A vertex buffer is created through the CKRenderManager::CreateVertexBuffer method. and can be destroyed with the CKVertexBuffer::Destroy or CKRenderManager::DestroyVertexBuffer

The CKVertexBuffer class is mainly designed for static vertex buffers. If a vertex buffer is needed to be very frequently updated (dynamic vertex buffer) , the RCKRenderContext::GetDrawPrimitiveStructure with the CKRST_DP_VBUFFER is a better solution and avoids the creation of a CKVertexBuffer instance.

Groups

Operations
Pure Virtual Method Method Check | Checks the state of the vertex buffer.
Pure Virtual Method Method Destroy | Destroys the content of the vertex buffer.
Pure Virtual Method Method Draw | Draws the vertex buffer on a given render context.
Pure Virtual Method Method Lock | Locks the content of a vertex buffer for a write operation.

See Also

VxDrawPrimitiveData,CKRenderManager::CreateVertexBuffer,CKRenderManager::DestroyVertexBuffer


CKVertexBuffer::Check

Pure Virtual Method Method CKVertexBuffer::Check

virtual CKVB_STATE CKVertexBuffer::Check(CKRenderContext* Ctx,CKDWORD MaxVertexCount,CKRST_DPFLAGS Format,CKBOOL Dynamic = FALSE)

Checks the state of the vertex buffer.

Parameters

Input argument Ctx | A pointer to a CKRenderContext on which this vertex buffer should be used.
Input argument MaxVertexCount | Max number of vertex the buffer can contain.
Input argument Format | A combination of CKRST_DPFLAGS giving the vertex format for this vertex buffer.
Input argument Dynamic | A boolean indicating if this vertex buffer will be frequently written too...

Returns

Current State of the vertex buffer: CK_VB_LOST : The content of the vertex buffer was lost (device changes,etc..) and should filled back (Lock) CK_VB_OK: No Error , Vertex buffer can be rendered (Draw) CK_VB_FAILED: Vertex buffer could not be created

Remarks

There is not a method to create a vertex buffer, instead one should use this method to check the vertex buffer before each drawing. The return value indicates whether the vertex buffer is up-to-date (CK_VB_OK) or if its content should be updated (CK_VB_LOST), or even if the creation of such a vertex buffer failed (CK_VB_FAILED).

See Also

Lock,Unlock,Draw


CKVertexBuffer::Destroy

Pure Virtual Method Method CKVertexBuffer::Destroy

virtual void CKVertexBuffer::Destroy()

Destroys the content of the vertex buffer.

Remarks

This method can be used to release memory taken by a vertex buffer

See Also

Check,Draw


CKVertexBuffer::Draw

Pure Virtual Method Method CKVertexBuffer::Draw

virtual CKBOOL CKVertexBuffer::Draw(CKRenderContext* Ctx,VXPRIMITIVETYPE pType,CKWORD* Indices,int Indexcount,CKDWORD StartVertex,CKDWORD VertexCount)

Draws the vertex buffer on a given render context.

Parameters

Input argument Ctx | A pointer to a CKRenderContext on which this vertex buffer should be used.
Input argument pType | Type of primitive to draw.
Input argument Indices | A pointer to a list of WORD that will be used as indices to vertices or NULL.
Input argument Indexcount | Number of indices
Input argument StartVertex | Index of the first vertex to be locked.
Input argument VertexCount | Number of vertices to be locked.

Returns

TRUE if successful.

Remarks

This method renders a set of primitives (using Indices if given otherwise taking vertices in the order they are given). Indices are relative to StartVertex. Before calling this method you must ensure your vertex buffer is ready to be drawn on this context with the Check method.

See Also

Custom Rendering,VXPRIMITIVETYPE,CKRenderContext::DrawPrimitive


CKVertexBuffer::Lock

Pure Virtual Method Method CKVertexBuffer::Lock

virtual VxDrawPrimitiveData* CKVertexBuffer::Lock(CKRenderContext* Ctx,CKDWORD StartVertex,CKDWORD VertexCount,CKLOCKFLAGS LockFlags = CK_LOCK_DEFAULT)
virtual void CKVertexBuffer::Unlock(CKRenderContext* Ctx)

Locks the content of a vertex buffer for a write operation.

Parameters

Input argument Ctx | A pointer to a CKRenderContext on which this vertex buffer should be used.
Input argument StartVertex | Index of the first vertex to be locked.
Input argument VertexCount | Number of vertices to be locked.
Input argument LockFlags | Behavior of the lock operation.

Returns

A pointer to a VxDrawPrimitiveData structure that which pointers and strides have been setup to point directly to the vertex buffer.

Remarks

A Locked vertex buffer must be Unlocked before any draw operation can occur. The LockFlags can give some hint to accelerate the copy in case of a dynamic vertex buffer otherwise it is meaningless and should be kept to its default value.

See Also

CKLOCKFLAGS


Shaders and Effects

Shader Management

Enumerated Type CK_OVERRIDE_RENDERING | Specify the type of overriding when rendering a scene.
Class CKMaterialShader | CKShader used by a CKMaterial and its parameters.
Class CKShader | Shader Class.
Class CKShaderManager | The shader/Shader manager:

See Also

Render Engine


CK_OVERRIDE_RENDERING

Enumerated Type CK_OVERRIDE_RENDERING

enum CK_OVERRIDE_RENDERING
{
CK_OVERRIDE_NONE,
CK_OVERRIDE_MATERIAL,
CK_OVERRIDE_USECURRENT,
CK_OVERRIDE_PASS,
CK_OVERRIDE_TECHNIQUE,
}

Specify the type of overriding when rendering a scene.

Members

CK_OVERRIDE_MATERIAL | Entity materials are ignored and the material given to CKRenderContext::SetOverriddenRendering is used instead
CK_OVERRIDE_NONE | No Override
CK_OVERRIDE_PASS | Only the specific pass given to CKRenderContext::SetOverriddenRendering will be used when drawing object with effects.
CK_OVERRIDE_TECHNIQUE | When rendering objects with a shader, try to use the technique given to CKRenderContext::SetOverriddenRendering as a replacement. If no technique with the given name is found, or if the object uses no shader, then, the shader of the material given to CKRenderContext::SetOverriddenRendering will be used instead, and will have access to the original material i infos such as “diffuse”, “ambient”, alpha test settings etc. If theres is not such shader, then no override takes place.
CK_OVERRIDE_USECURRENT | Entity materials are ignored and the currently set render options are used instead...

See Also

CKRenderContext::SetOverriddenRendering


CKMaterialShader

Class CKMaterialShader

CKShader used by a CKMaterial and its parameters.

Remarks

The material effect structure hold information about what shader (CKShader) is used on the material. It also store which technique is used and the parameters, specific to the material that are given to the effect.

Groups

Data Members
Member Variable m_CompID | Last compilationID (used internally at runtime).
Member Variable m_FindNextValidTechnique | If try to find the next valid technique from the one selected.
Member Variable m_MaterialClass | Not Yet Used : Where does it go in the pipeline : Additive, Transparent(sorted), Solid.
Member Variable m_Params | Parameters for the effect.
Member Variable m_Shader | The shader used for the rendering.
Member Variable m_ShadowViewProj | Special, for shadow mapping using channels : map from world to shadow map space
Member Variable m_TechIndex | The real used technique
Member Variable m_TechniqueName | Technique wanted technique
Operations
Method MakeParamsUpToDate | Make material shader fx parameters up to date
Method SetTechniqueByName | Change a shader technique by its name, returns TRUE on success

See Also

CKMaterial::SetMaterialShader,CKShader,


CKMaterialShader::m_CompID

Member Variable CKMaterialShader::m_CompID

int CKMaterialShader::m_CompID

Remarks

Last compilationID (used internally at runtime).


CKMaterialShader::m_FindNextValidTechnique

Member Variable CKMaterialShader::m_FindNextValidTechnique

CKBOOL CKMaterialShader::m_FindNextValidTechnique

Remarks

If try to find the next valid technique from the one selected.


CKMaterialShader::m_MaterialClass

Member Variable CKMaterialShader::m_MaterialClass

int CKMaterialShader::m_MaterialClass

Remarks

Not Yet Used : Where does it go in the pipeline : Additive, Transparent(sorted), Solid.


CKMaterialShader::m_Params

Member Variable CKMaterialShader::m_Params

XArray<CKParameterLocal*> CKMaterialShader::m_Params

Remarks

Parameters for the effect.


CKMaterialShader::m_Shader

Member Variable CKMaterialShader::m_Shader

CKShader* CKMaterialShader::m_Shader

Remarks

The shader used for the rendering.


CKMaterialShader::m_ShadowViewProj

Member Variable CKMaterialShader::m_ShadowViewProj

VxMatrix CKMaterialShader::m_ShadowViewProj

Remarks

Special, for shadow mapping using channels : map from world to shadow map space


CKMaterialShader::m_TechIndex

Member Variable CKMaterialShader::m_TechIndex

int CKMaterialShader::m_TechIndex

Remarks

The real used technique


CKMaterialShader::m_TechniqueName

Member Variable CKMaterialShader::m_TechniqueName

XString CKMaterialShader::m_TechniqueName

Remarks

Technique wanted technique


CKMaterialShader::MakeParamsUpToDate

Method CKMaterialShader::MakeParamsUpToDate

void CKMaterialShader::MakeParamsUpToDate()

Remarks

Make material shader fx parameters up to date


CKMaterialShader::SetTechniqueByName

Method CKMaterialShader::SetTechniqueByName

CKBOOL CKMaterialShader::SetTechniqueByName(const CKSTRING techName, CKBOOL findNextValidTechnique)

Remarks

Change a shader technique by its name, returns TRUE on success


CKShader

CKProtectable
Show full derivation trees

CKShader

Remarks

The CKShader class holds the description of an Shader

Groups

Constructors
Method CKShader | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Pure Virtual Method Method Begin | Applies a Shader settings before rendering an object using the currently set technique.
Pure Virtual Method Method BeginPass | Applies the settings of a given pass of a technique.
Pure Virtual Method Method CommitChanges | Commits any change between a begin/end pass.
Pure Virtual Method Method End | Ends the application of a technique .
Pure Virtual Method Method EndPass | Ends the current pass .
Pure Virtual Method Method ExecuteMeanings | Give a value to one of the shader's automatics
Pure Virtual Method Method ExecutePerPassMeanings |
Pure Virtual Method Method FindNextValidTechnique |
Pure Virtual Method Method GetAutoParameterCount | Returns Infos on Auto Params (used in the Shader Editor)
Pure Virtual Method Method GetAutoParameterInfo |
Pure Virtual Method Method GetCurrentShaderType | Get the current type of the shader (HLSL, CgFX, ...)
Pure Virtual Method Method GetExposedParameterCount | Returns Infos on Exposed Params (used in the Shader Editor)
Pure Virtual Method Method GetExposedParameterInfo |
Pure Virtual Method Method GetF2Marks | F2 Marks
Virtual Method Method GetHideFlag |
Method GetInputStreamFormat |
Pure Virtual Method Method GetListInEditorFlag |
Pure Virtual Method Method GetName |
Pure Virtual Method Method GetPassCount |
Pure Virtual Method Method GetPassIndexByName |
Pure Virtual Method Method GetPassInfo |
Pure Virtual Method Method GetProtectable |
Pure Virtual Method Method GetSaveFlag | Support for hard coded, externally created shaders
Pure Virtual Method Method GetTechIndexByName |
Pure Virtual Method Method GetTechniqueEnumString |
Pure Virtual Method Method GetTechniqueEnumValue | Techniques/Pass enumeration
Pure Virtual Method Method GetTechniqueInfo |
Pure Virtual Method Method GetTechniquesCount | Returns the list of Techniques for this Shader.
Pure Virtual Method Method GetText | Gets the entire Shader text.
Pure Virtual Method Method IsSupported |
Pure Virtual Method Method LinkParameters | Returns true if it has changed the parameters.
Pure Virtual Method Method LinkTechnique | Returns true if it has changed the technique.
Pure Virtual Method Method SetHideFlag | To Support Hide Content functionality
Pure Virtual Method Method SetListInEditorFlag |
Pure Virtual Method Method SetName |
Pure Virtual Method Method SetParameters | Parameters creation
Pure Virtual Method Method SetSaveFlag |
Pure Virtual Method Method SetTechnique | Sets the technique to use when applying this Shader.
Pure Virtual Method Method SetText | Sets the entire Shader text.
Virtual Method Method UnLock |
Type Definitions
Structure ParamInfo | Description of a parameter as used in a Shader. Note: Used in the Shader Editor
Structure PassInfo | Pass Description Note: Used in the Shader Editor
Structure StreamParam |
Enumerated Type StreamParamUsage | Retrieve Input Stream Format
Structure TechniqueInfo | Description of a technique Note: Used in the Shader Editor
Destructors
Virtual Method Method ~CKShader | Description: Destroys the object This destroys all the subordinate objects for this object.

See Also

CKShaderManager


CKShader::CKShader

Method CKShader::CKShader

CKShader::CKShader()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKShader::Begin

Pure Virtual Method Method CKShader::Begin

virtual int CKShader::Begin( CKRenderContext* rc )

Applies a Shader settings before rendering an object using the currently set technique.


CKShader::BeginPass

Pure Virtual Method Method CKShader::BeginPass

virtual void CKShader::BeginPass( CKDWORD Num, CKRenderContext* rc )

Applies the settings of a given pass of a technique.

Remarks

This method is intended to be used iteratively for each pass of a technique. Each BeginPass called must be followed by a EndPass call after the rendering is done. If any value of a parameter is changed on the effect you must call CommitChanges


CKShader::CommitChanges

Pure Virtual Method Method CKShader::CommitChanges

virtual void CKShader::CommitChanges( CKRenderContext* rc )

Commits any change between a begin/end pass.

Remarks

This method must be called if the value of a parameter is changed between BeginPass and the rendering.


CKShader::End

Pure Virtual Method Method CKShader::End

virtual void CKShader::End( CKRenderContext* rc )

Ends the application of a technique .


CKShader::EndPass

Pure Virtual Method Method CKShader::EndPass

virtual void CKShader::EndPass( CKRenderContext* rc )

Ends the current pass .

Remarks

This method must be called once the rendering for a given pass has been done.


CKShader::ExecuteMeanings

Pure Virtual Method Method CKShader::ExecuteMeanings

virtual void CKShader::ExecuteMeanings( CK3dEntity* iEnt, CKMaterial* iMat, class CKMaterialShader* iMatShader, CKRenderContext* rc )

Give a value to one of the shader's automatics


CKShader::ExecutePerPassMeanings

Pure Virtual Method Method CKShader::ExecutePerPassMeanings

virtual void CKShader::ExecutePerPassMeanings( CK3dEntity* iEnt, CKMaterial* iMat, class CKMaterialShader* iMatShader, CKRenderContext* rc )


CKShader::FindNextValidTechnique

Pure Virtual Method Method CKShader::FindNextValidTechnique

virtual bool CKShader::FindNextValidTechnique( int& ioTechIndex, XString* oTechName=NULL ) const


CKShader::GetAutoParameterCount

Pure Virtual Method Method CKShader::GetAutoParameterCount

virtual int CKShader::GetAutoParameterCount( CKRenderContext* rc )

Returns Infos on Auto Params (used in the Shader Editor)


CKShader::GetAutoParameterInfo

Pure Virtual Method Method CKShader::GetAutoParameterInfo

virtual void CKShader::GetAutoParameterInfo( int paramIndex, ParamInfo& paramInfo, CKRenderContext* rc )


CKShader::GetCurrentShaderType

Pure Virtual Method Method CKShader::GetCurrentShaderType

virtual CK_SHADER_MANAGER_TYPE CKShader::GetCurrentShaderType() const

Get the current type of the shader (HLSL, CgFX, ...)


CKShader::GetExposedParameterCount

Pure Virtual Method Method CKShader::GetExposedParameterCount

virtual int CKShader::GetExposedParameterCount( CKRenderContext* rc )

Returns Infos on Exposed Params (used in the Shader Editor)


CKShader::GetExposedParameterInfo

Pure Virtual Method Method CKShader::GetExposedParameterInfo

virtual void CKShader::GetExposedParameterInfo( int paramIndex, ParamInfo& paramInfo, CKRenderContext* rc )


CKShader::GetF2Marks

Pure Virtual Method Method CKShader::GetF2Marks

virtual XArray<int>* CKShader::GetF2Marks()

Remarks

F2 Marks


CKShader::GetHideFlag

Virtual Method Method CKShader::GetHideFlag

virtual CKBOOL CKShader::GetHideFlag()


CKShader::GetInputStreamFormat

Method CKShader::GetInputStreamFormat

inline XArray<StreamParam>& CKShader::GetInputStreamFormat()


CKShader::GetListInEditorFlag

Pure Virtual Method Method CKShader::GetListInEditorFlag

virtual CKBOOL CKShader::GetListInEditorFlag() const


CKShader::GetName

Pure Virtual Method Method CKShader::GetName

virtual const XString& CKShader::GetName() const


CKShader::GetPassCount

Pure Virtual Method Method CKShader::GetPassCount

virtual int CKShader::GetPassCount( int iTechIndex ) const


CKShader::GetPassIndexByName

Pure Virtual Method Method CKShader::GetPassIndexByName

virtual bool CKShader::GetPassIndexByName( int iTechIndex, const char* iPassName, int& oPos ) const


CKShader::GetPassInfo

Pure Virtual Method Method CKShader::GetPassInfo

virtual void CKShader::GetPassInfo( int iTechIndex, int iPassIndex, PassInfo& oPassInfo ) const


CKShader::GetProtectable

Pure Virtual Method Method CKShader::GetProtectable

virtual CKProtectable* CKShader::GetProtectable()


CKShader::GetSaveFlag

Pure Virtual Method Method CKShader::GetSaveFlag

virtual CKBOOL CKShader::GetSaveFlag() const

Support for hard coded, externally created shaders


CKShader::GetTechIndexByName

Pure Virtual Method Method CKShader::GetTechIndexByName

virtual bool CKShader::GetTechIndexByName( const XString& iTechName, int& oPos ) const


CKShader::GetTechniqueEnumString

Pure Virtual Method Method CKShader::GetTechniqueEnumString

virtual void CKShader::GetTechniqueEnumString( int num, XString& oName ) const


CKShader::GetTechniqueEnumValue

Pure Virtual Method Method CKShader::GetTechniqueEnumValue

virtual int CKShader::GetTechniqueEnumValue( const XString& name ) const

Remarks

Techniques/Pass enumeration


CKShader::GetTechniqueInfo

Pure Virtual Method Method CKShader::GetTechniqueInfo

virtual void CKShader::GetTechniqueInfo( int iTechIndex, TechniqueInfo& oTechInfo ) const


CKShader::GetTechniquesCount

Pure Virtual Method Method CKShader::GetTechniquesCount

virtual int CKShader::GetTechniquesCount() const

Returns the list of Techniques for this Shader.


CKShader::GetText

Pure Virtual Method Method CKShader::GetText

virtual const XString& CKShader::GetText() const
virtual const XString& CKShader::GetText(CK_SHADER_MANAGER_TYPE type)

Gets the entire Shader text.


CKShader::IsSupported

Pure Virtual Method Method CKShader::IsSupported

virtual CKBOOL CKShader::IsSupported() const


CKShader::LinkParameters

Pure Virtual Method Method CKShader::LinkParameters

virtual bool CKShader::LinkParameters( int& CompID, XArray<CKParameterLocal*>& params, CKBOOL cleanup = FALSE )

Remarks

Returns true if it has changed the parameters.


CKShader::LinkTechnique

Pure Virtual Method Method CKShader::LinkTechnique

virtual bool CKShader::LinkTechnique( int& CompID, const XString& tech, BOOL fnvt, int& oTechIndex )

Remarks

Returns true if it has changed the technique.


CKShader::SetHideFlag

Pure Virtual Method Method CKShader::SetHideFlag

virtual void CKShader::SetHideFlag(CKBOOL hide)

To Support Hide Content functionality


CKShader::SetListInEditorFlag

Pure Virtual Method Method CKShader::SetListInEditorFlag

virtual void CKShader::SetListInEditorFlag(CKBOOL listInEditor)


CKShader::SetName

Pure Virtual Method Method CKShader::SetName

virtual void CKShader::SetName(const XString& Name)


CKShader::SetParameters

Pure Virtual Method Method CKShader::SetParameters

virtual void CKShader::SetParameters( const XArray<CKParameterLocal*>& params )

Remarks

Parameters creation


CKShader::SetSaveFlag

Pure Virtual Method Method CKShader::SetSaveFlag

virtual void CKShader::SetSaveFlag(CKBOOL saveFlag)


CKShader::SetTechnique

Pure Virtual Method Method CKShader::SetTechnique

virtual void CKShader::SetTechnique( const XString &iTechName )
virtual void CKShader::SetTechnique( int iTechIndex )

Sets the technique to use when applying this Shader.


CKShader::SetText

Pure Virtual Method Method CKShader::SetText

virtual void CKShader::SetText(const XString& Text)
virtual void CKShader::SetText(const XString& Text, CK_SHADER_MANAGER_TYPE type)

Sets the entire Shader text.


CKShader::UnLock

Virtual Method Method CKShader::UnLock

virtual void CKShader::UnLock(const char* pass)


CKShader::ParamInfo

Structure CKShader::ParamInfo

struct ParamInfo
{
XString name;
CKGUID guid;
}

Description of a parameter as used in a Shader. Note: Used in the Shader Editor

Members

guid | Type of data stored (matrix, vector, color, array, etc.)
name | Name of the parameter


CKShader::PassInfo

Structure CKShader::PassInfo

class PassInfo
{
public:
XString name;
XString desc;
}

Pass Description Note: Used in the Shader Editor

Members

desc | Description of the pass
name | Name given to this pass


CKShader::StreamParam

Structure CKShader::StreamParam

struct StreamParam
{
unsigned int usage;
WORD usageIndex;
WORD size;
}

Members

size | Stream Param's Size (DWORD count... float=1, uvw=3...)
usage | Stream Param's Usage
usageIndex | Stream Param's Usage Index


CKShader::StreamParamUsage

Enumerated Type CKShader::StreamParamUsage

enum StreamParamUsage
{
FXINPUTSTREAM_POSITION = 0,
FXINPUTSTREAM_BLENDWEIGHT,
FXINPUTSTREAM_BLENDINDICES,
FXINPUTSTREAM_NORMAL,
FXINPUTSTREAM_PSIZE,
FXINPUTSTREAM_TEXCOORD,
FXINPUTSTREAM_TANGENT,
FXINPUTSTREAM_BINORMAL,
FXINPUTSTREAM_TESSFACTOR,
FXINPUTSTREAM_POSITIONT,
FXINPUTSTREAM_COLOR,
FXINPUTSTREAM_FOG,
FXINPUTSTREAM_DEPTH,
FXINPUTSTREAM_SAMPLE,
}

Retrieve Input Stream Format

Members

FXINPUTSTREAM_BINORMAL | 7
FXINPUTSTREAM_BLENDINDICES | 2
FXINPUTSTREAM_BLENDWEIGHT | 1
FXINPUTSTREAM_COLOR | 10
FXINPUTSTREAM_DEPTH | 12
FXINPUTSTREAM_FOG | 11
FXINPUTSTREAM_NORMAL | 3
FXINPUTSTREAM_POSITION |
FXINPUTSTREAM_POSITIONT | 9
FXINPUTSTREAM_PSIZE | 4
FXINPUTSTREAM_SAMPLE | 13
FXINPUTSTREAM_TANGENT | 6
FXINPUTSTREAM_TESSFACTOR | 8
FXINPUTSTREAM_TEXCOORD | 5


CKShader::TechniqueInfo

Structure CKShader::TechniqueInfo

class TechniqueInfo
{
public:

XString name;
XString desc;
bool isValid;
}

Description of a technique Note: Used in the Shader Editor

Members

desc | Description of the technique
isValid |
name | Name of the technique


CKShader::~CKShader

Virtual Method Method CKShader::~CKShader

virtual CKShader::~CKShader()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


CKShaderManager

Class CKShaderManager

The shader/Shader manager:

CKBaseManager
Show brief derivation trees

CKShaderManager

CKBaseManager
Show full derivation trees

CKShaderManager

Remarks

The Shader shader manages the list of available Shaders which can be retrieve by name or index (GetShaderByName,GetShader,GetNumShaders) The BeginShaders/EndShaders methods must be called to setup the default render states (GetDefaultShader) before any rendering using Shaders take place. Finally the Shader manager also returns whether the currently set rasterizer supports drawing object with Shaders (IsSupported,GetVSPSVersion)

The unique instance of this class may be retrieved through the CKContext::GetManagerByGuid(ShaderManagerGUID)

The engine automatically setup the shaders when they are used on meshes, sprite or sprite3D, but if you want to draw your own primitive with a given shader, take a look at the following example.

Groups

Data Members | Operations | Events | Manager Info | Type Definitions

Data Members
Member Variable m_AllShaders |
Member Variable m_Context | A pointer to the CKContext on which this manager is valid.
Member Variable m_CurrentPassCount | Those members are meant to be accessed from Meanings
Member Variable m_CurrentPassIndex |
Member Variable m_DefaultShader |
Member Variable m_ManagerGuid | Manager GUID
Member Variable m_ManagerName | Manager Name
Member Variable m_Output |
Member Variable m_ProcessingTime | Time elapsed during profiling. (Reset each frame before behavioral processing starts)
Member Variable m_PseudoChannelTexture |
Member Variable m_RenderOptionsBeforePlay |
Member Variable m_SavePreProcessed |
Member Variable m_SavePreprocessedOptions |
Member Variable m_ShadowShader |
Operations
Method AddTemporaryPostProcessCallBack |
Method AddTemporaryPreProcessCallBack | Add temporary post/pre render callback (used by shader BBs)
Pure Virtual Method Method BeginShaders | Setups the default renderstates before rendering objects with Shaders.
Pure Virtual Method Method CompileShader |
Pure Virtual Method Method CompileShaderOutput |
Pure Virtual Method Method CreateShader |
Pure Virtual Method Method CreateShaderFromFile |
Pure Virtual Method Method CreateShaderFromFiles |
Pure Virtual Method Method DeleteShader |
Pure Virtual Method Method GetAnnotationOriginalNames |
Pure Virtual Method Method GetCurrentShaderManagerType | Get the current type of the shader (HLSL, CgFX, ...)
Pure Virtual Method Method GetDefaultShader | Returns the default CKShader.
Pure Virtual Method Method GetIncludeManager | Retrieves the Include Manager
Method GetNearestLights | Retrieves the Nth first nearest lights from an object
Pure Virtual Method Method GetNumShaders | Returns the number of existing Shaders.
Pure Virtual Method Method GetSemanticDesc |
Pure Virtual Method Method GetSemanticIndexFromFourCC |
Pure Virtual Method Method GetSemanticOriginalNames |
Pure Virtual Method Method GetShader | Returns an Shader given its index.
Pure Virtual Method Method GetShaderByName | Returns a CKShader given its name.
Pure Virtual Method Method GetShadowShader | Returns the built-in shadow shader
Pure Virtual Method Method GetTangentSpaceCreationMode | Get/Set the Tangent Space Creation Mode. Note: See ShaderTSCreationMode enum values.
Pure Virtual Method Method GetVSPSVersion | Gets the version of the Vertex Shader(vs) and Pixel Shader(ps) support.
Pure Virtual Method Method IsPreCleared | Return wether 'PreCleared' was called on the shader manager One should not attempt to create a shader between a call to PreClear and PostClear
Pure Virtual Method Method IsSupported | Returns whether current rasterizer support Shaders.
Pure Virtual Method Method IsSupportedAndWarnIfNot |
Method MakeParamsUpToDateForAllConcernedMaterials | Parse all materials and update params if it use the shader
Virtual Method Method OnRenderContextCreated | Called when a RenderContext gets created or destroyed to update the Shader Manager's inner list of render contexts
Virtual Method Method OnRenderContextDestroyed |
Method RebuildTechniqueEnum | Manage the Technique Enum Type
Pure Virtual Method Method SaveShaderToFile |
Virtual Method Method SetSavePreProcessed |
Virtual Method Method SetSavePreprocessOptions |
Pure Virtual Method Method SetTangentSpaceCreationMode |
Method StartProfile | Starts profiling.
Method StopProfile | Stops profiling.
Events
Virtual Method Method OnCKEnd | Called at deletion of a CKContext
Virtual Method Method OnCKInit | Called at the end of the creation of a CKContext.
Virtual Method Method OnCKPause | Called when the process loop is paused.
Virtual Method Method OnCKPlay | Called when the process loop is started .
Virtual Method Method OnCKPostReset | Called after the composition has been restarted.
Virtual Method Method OnCKReset | Called before the composition is reset.
Virtual Method Method OnPostBackToFront | Called after the backbuffer is presented.
Virtual Method Method OnPostCopy | Called at the end of a copy.
Virtual Method Method OnPostFullScreen | Called after switching to/from fullscreen.
Virtual Method Method OnPostRender | Called after the rendering of the 3D objects .
Virtual Method Method OnPostSpriteRender | Called after the rendering of foreground 2D entities.
Virtual Method Method OnPreBackToFront | Called before the backbuffer is presented.
Virtual Method Method OnPreCopy | Called at the beginning of a copy.
Virtual Method Method OnPreFullScreen | Called before switching to/from fullscreen.
Virtual Method Method OnPreRender | Called before the rendering of the 3D objects.
Virtual Method Method OnPreSpriteRender | Called Before the rendering of background 2D entities.
Virtual Method Method OnRasterizerEvent | Called for specific rasterizer events.
Virtual Method Method PostClearAll | Called at the end of a CKContext::ClearAll operation.
Virtual Method Method PostLaunchScene | Called after a scene became active.
Virtual Method Method PostLoad | Called at the end of a load operation.
Virtual Method Method PostProcess | Called at the end of each process loop.
Virtual Method Method PostSave | Called at the end of a save operation.
Virtual Method Method PreClearAll | Called at the beginning of a CKContext::ClearAll operation.
Virtual Method Method PreLaunchScene | Called before a scene becomes active.
Virtual Method Method PreLoad | Called at the beginning of a load operation.
Virtual Method Method PreProcess | Called at the beginning of each process loop.
Virtual Method Method PreSave | Called at the beginning of a save operation.
Virtual Method Method SequenceAddedToScene | Called when objects are added to a scene
Virtual Method Method SequenceDeleted | Called after objects have been deleted.
Virtual Method Method SequenceRemovedFromScene | Called when objects are removed from a scene
Virtual Method Method SequenceToBeDeleted | Called just before objects are deleted.
Manager Info
Virtual Method Method GetFunctionPriority | Returns the priority of the specified manager function.
Method GetGuid | Acces to Manager GUID
Method GetName | Acces to Manager name
Virtual Method Method GetValidFunctionsMask | Returns list of functions implemented by the manager.
Type Definitions
Structure NearestLight | Retrieves the Nth first nearest lights from an object Note: The returned array contains at least iRequestedLightCount Lights, but there can be more lights in this array (if some other shader already requested more light in the same rendering frame)

Example

 Drawing some triangles with a material that is using a shader
 needs to be done in a specific manner since the shader can contain
 several passes

CKRenderContext* rdCtx;     // current rendering context
CK3dEntity*      m_Entity;  // Target 3D entity that will be used for matrix information

CKMaterialShader* matShader = m_Material->GetMaterialShader(TRUE);
CKShaderManager* sMan = (CKShaderManager*)m_Context->GetManagerByGuid(ShaderManagerGUID);

 first check if our material is using a shader
 and is shaders are enabled
if (sMan && matShader && matShader->m_Technique) {

 Start shader rendering
sMan->BeginShaders(RdCtx);

CKShader*   fx = matShader->m_Shader;
XASSERT(fx != NULL);
fx->SetTechnique(matShader->m_Technique);
fx->SetParameters(matShader->m_Params);
RdCtx->SetValuesOfUsedAutomatics( *fx, m_Material, m_Entity);

 Begin this shader
int num_passes = fx->Begin(rdCtx);
fx->SetAutomaticValue( FXAP_PASSCOUNT, &num_passes, rdCtx);

 Set each pass and
for (int i = 0; i < num_passes; ++i) {
fx->SetAutomaticValue( FXAP_PASSINDEX, &i, rdCtx);
fx->BeginPass(i,RdCtx);

 If some values are changed after a call to BeginPass (using SetAutomaticValue for example)
 we must warn the engine with
 fx->CommitChanges(RdCtx);

RdCtx->DrawPrimitive(VX_TRIANGLEFAN,NULL,4,&DPData);
fx->EndPass(RdCtx);
}
 End of shaders
fx->End(RdCtx);
sMan->EndShaders(RdCtx);
} else {
 traditionnal rendering
m_Material->SetAsCurrent(RdCtx);
RdCtx->DrawPrimitive(VX_TRIANGLEFAN,NULL,4,&DPData);
}

See Also

CKShader,CKMaterial


CKShaderManager::m_AllShaders

Member Variable CKShaderManager::m_AllShaders

XArray<CKShader*> CKShaderManager::m_AllShaders


CKShaderManager::m_CurrentPassCount

Member Variable CKShaderManager::m_CurrentPassCount

int CKShaderManager::m_CurrentPassCount

Remarks

Those members are meant to be accessed from Meanings


CKShaderManager::m_CurrentPassIndex

Member Variable CKShaderManager::m_CurrentPassIndex

int CKShaderManager::m_CurrentPassIndex


CKShaderManager::m_DefaultShader

Member Variable CKShaderManager::m_DefaultShader

CKShader* CKShaderManager::m_DefaultShader


CKShaderManager::m_Output

Member Variable CKShaderManager::m_Output

XClassArray<XString> CKShaderManager::m_Output


CKShaderManager::m_PseudoChannelTexture

Member Variable CKShaderManager::m_PseudoChannelTexture

CKTexture* CKShaderManager::m_PseudoChannelTexture[MaxChannelCount]


CKShaderManager::m_RenderOptionsBeforePlay

Member Variable CKShaderManager::m_RenderOptionsBeforePlay

CKDWORD CKShaderManager::m_RenderOptionsBeforePlay


CKShaderManager::m_SavePreProcessed

Member Variable CKShaderManager::m_SavePreProcessed

bool CKShaderManager::m_SavePreProcessed


CKShaderManager::m_SavePreprocessedOptions

Member Variable CKShaderManager::m_SavePreprocessedOptions

XString CKShaderManager::m_SavePreprocessedOptions


CKShaderManager::m_ShadowShader

Member Variable CKShaderManager::m_ShadowShader

CKShader* CKShaderManager::m_ShadowShader


CKShaderManager::AddTemporaryPostProcessCallBack

Method CKShaderManager::AddTemporaryPostProcessCallBack

void CKShaderManager::AddTemporaryPostProcessCallBack( CK_PROCESSCALLBACK Function,void *Argument)


CKShaderManager::AddTemporaryPreProcessCallBack

Method CKShaderManager::AddTemporaryPreProcessCallBack

void CKShaderManager::AddTemporaryPreProcessCallBack( CK_PROCESSCALLBACK Function,void *Argument)

Add temporary post/pre render callback (used by shader BBs)


CKShaderManager::BeginShaders

Pure Virtual Method Method CKShaderManager::BeginShaders

virtual void CKShaderManager::BeginShaders( CKRenderContext* rc )
virtual void CKShaderManager::EndShaders( CKRenderContext* rc )

Setups the default renderstates before rendering objects with Shaders.


CKShaderManager::CompileShader

Pure Virtual Method Method CKShaderManager::CompileShader

virtual bool CKShaderManager::CompileShader(CKShader* fx, XClassArray<XString> &output)


CKShaderManager::CompileShaderOutput

Pure Virtual Method Method CKShaderManager::CompileShaderOutput

virtual bool CKShaderManager::CompileShaderOutput(CKShader* fx, const CKSTRING funcname,
const CKSTRING target, XClassArray<XString> &output, XArray<char>& text)


CKShaderManager::CreateShader

Pure Virtual Method Method CKShaderManager::CreateShader

virtual CKShader* CKShaderManager::CreateShader(
const XString* name = NULL,
const XString* text = NULL,
BOOL uniqueName = TRUE )


CKShaderManager::CreateShaderFromFile

Pure Virtual Method Method CKShaderManager::CreateShaderFromFile

virtual CKShader* CKShaderManager::CreateShaderFromFile(const CKSTRING filename)


CKShaderManager::CreateShaderFromFiles

Pure Virtual Method Method CKShaderManager::CreateShaderFromFiles

virtual CKShader* CKShaderManager::CreateShaderFromFiles(const CKSTRING HLSLfilename, const CKSTRING CgFXfilename = NULL)


CKShaderManager::DeleteShader

Pure Virtual Method Method CKShaderManager::DeleteShader

virtual void CKShaderManager::DeleteShader(CKShader* fx)


CKShaderManager::GetAnnotationOriginalNames

Pure Virtual Method Method CKShaderManager::GetAnnotationOriginalNames

virtual const XClassArray<XString>& CKShaderManager::GetAnnotationOriginalNames()


CKShaderManager::GetCurrentShaderManagerType

Pure Virtual Method Method CKShaderManager::GetCurrentShaderManagerType

virtual CK_SHADER_MANAGER_TYPE CKShaderManager::GetCurrentShaderManagerType() const

Get the current type of the shader (HLSL, CgFX, ...)


CKShaderManager::GetDefaultShader

Pure Virtual Method Method CKShaderManager::GetDefaultShader

virtual CKShader* CKShaderManager::GetDefaultShader()

Returns the default CKShader.

Remarks

The default CKShader contains the list of default render states to set on the rasterizer before rendering any object using Shaders.


CKShaderManager::GetIncludeManager

Pure Virtual Method Method CKShaderManager::GetIncludeManager

virtual void* CKShaderManager::GetIncludeManager()

Retrieves the Include Manager


CKShaderManager::GetNearestLights

Method CKShaderManager::GetNearestLights

XArray< CKShaderManager::NearestLight >*
CKShaderManager::GetNearestLights( CK3dEntity* iEnt,
int iMaxLightCount,
bool iSort )

Retrieves the Nth first nearest lights from an object


CKShaderManager::GetNumShaders

Pure Virtual Method Method CKShaderManager::GetNumShaders

virtual int CKShaderManager::GetNumShaders() const

Returns the number of existing Shaders.


CKShaderManager::GetSemanticDesc

Pure Virtual Method Method CKShaderManager::GetSemanticDesc

virtual void CKShaderManager::GetSemanticDesc( int iSemIndex, XString*& oSemDesc )


CKShaderManager::GetSemanticIndexFromFourCC

Pure Virtual Method Method CKShaderManager::GetSemanticIndexFromFourCC

virtual int CKShaderManager::GetSemanticIndexFromFourCC( DWORD iFcc)


CKShaderManager::GetSemanticOriginalNames

Pure Virtual Method Method CKShaderManager::GetSemanticOriginalNames

virtual const XClassArray<XString>& CKShaderManager::GetSemanticOriginalNames()


CKShaderManager::GetShader

Pure Virtual Method Method CKShaderManager::GetShader

virtual CKShader* CKShaderManager::GetShader(int pos)

Returns an Shader given its index.


CKShaderManager::GetShaderByName

Pure Virtual Method Method CKShaderManager::GetShaderByName

virtual CKShader* CKShaderManager::GetShaderByName(const XBaseString& name)

Returns a CKShader given its name.


CKShaderManager::GetShadowShader

Pure Virtual Method Method CKShaderManager::GetShadowShader

virtual CKShader* CKShaderManager::GetShadowShader()

Returns the built-in shadow shader


CKShaderManager::GetTangentSpaceCreationMode

Pure Virtual Method Method CKShaderManager::GetTangentSpaceCreationMode

virtual int CKShaderManager::GetTangentSpaceCreationMode() const

Get/Set the Tangent Space Creation Mode. Note: See ShaderTSCreationMode enum values.


CKShaderManager::GetVSPSVersion

Pure Virtual Method Method CKShaderManager::GetVSPSVersion

virtual void CKShaderManager::GetVSPSVersion(float& vs, float& ps) const

Gets the version of the Vertex Shader(vs) and Pixel Shader(ps) support.


CKShaderManager::IsPreCleared

Pure Virtual Method Method CKShaderManager::IsPreCleared

virtual CKBOOL CKShaderManager::IsPreCleared() const

Return wether 'PreCleared' was called on the shader manager One should not attempt to create a shader between a call to PreClear and PostClear


CKShaderManager::IsSupported

Pure Virtual Method Method CKShaderManager::IsSupported

virtual CKBOOL CKShaderManager::IsSupported() const

Returns whether current rasterizer support Shaders.

Remarks

Currently only DX9 rasterizer is Shader capable.


CKShaderManager::IsSupportedAndWarnIfNot

Pure Virtual Method Method CKShaderManager::IsSupportedAndWarnIfNot

virtual CKBOOL CKShaderManager::IsSupportedAndWarnIfNot()


CKShaderManager::MakeParamsUpToDateForAllConcernedMaterials

Method CKShaderManager::MakeParamsUpToDateForAllConcernedMaterials

void CKShaderManager::MakeParamsUpToDateForAllConcernedMaterials( CKShader* shader )

Parse all materials and update params if it use the shader


CKShaderManager::OnRenderContextCreated

Virtual Method Method CKShaderManager::OnRenderContextCreated

virtual void CKShaderManager::OnRenderContextCreated( CKRenderContext* rc )

Called when a RenderContext gets created or destroyed to update the Shader Manager's inner list of render contexts


CKShaderManager::OnRenderContextDestroyed

Virtual Method Method CKShaderManager::OnRenderContextDestroyed

virtual void CKShaderManager::OnRenderContextDestroyed( CKRenderContext* rc )


CKShaderManager::RebuildTechniqueEnum

Method CKShaderManager::RebuildTechniqueEnum

void CKShaderManager::RebuildTechniqueEnum( CKShader* shader )

Manage the Technique Enum Type


CKShaderManager::SaveShaderToFile

Pure Virtual Method Method CKShaderManager::SaveShaderToFile

virtual bool CKShaderManager::SaveShaderToFile(const XString& filename, CKShader* fx)


CKShaderManager::SetSavePreProcessed

Virtual Method Method CKShaderManager::SetSavePreProcessed

void CKShaderManager::SetSavePreProcessed(bool preProc)


CKShaderManager::SetSavePreprocessOptions

Virtual Method Method CKShaderManager::SetSavePreprocessOptions

void CKShaderManager::SetSavePreprocessOptions(const char* preProcOptions)


CKShaderManager::SetTangentSpaceCreationMode

Pure Virtual Method Method CKShaderManager::SetTangentSpaceCreationMode

virtual void CKShaderManager::SetTangentSpaceCreationMode( ShaderTSCreationMode iTSCreationMode )


CKShaderManager::PostProcess

Virtual Method Method CKShaderManager::PostProcess

CKERROR CKShaderManager::PostProcess()

Called at the end of each process loop.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the end of a CKContext::Process operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PostProcess for this function to get called.

See Also

Main Virtools Events,PreProcess,CKContext::Process,


CKShaderManager::PreClearAll

Virtual Method Method CKShaderManager::PreClearAll

CKERROR CKShaderManager::PreClearAll()

Called at the beginning of a CKContext::ClearAll operation.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the beginning of a CKContext::ClearAll operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PreClearAll for this function to get called.

See Also

Main Virtools Events,PostClearAll,CKContext::ClearAll


CKShaderManager::PreProcess

Virtual Method Method CKShaderManager::PreProcess

CKERROR CKShaderManager::PreProcess()

Called at the beginning of each process loop.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the beginning of a CKContext::Process operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PreProcess for this function to get called.

See Also

Main Virtools Events,PostProcess,CKContext::Process,


CKShaderManager::GetValidFunctionsMask

Virtual Method Method CKShaderManager::GetValidFunctionsMask

virtual CKDWORD CKShaderManager::GetValidFunctionsMask()

Returns list of functions implemented by the manager.

Returns

A combination of CKMANAGER_FUNCTIONS. Remarks. You must override this function to indicate which functions your manager implements.

Remarks

Returns list of functions implemented by the manager.

Example

The attribute manager implements four CKBaseManager functions :PreClearAll,PostLoad,OnSequenceAddedToscene
and OnSequenceRemovedFromScene so its GetValidFunctionsMask looks like this:

           virtual CKDWORD GetValidFunctionsMask() { return CKMANAGER_FUNC_PreClearAll             |
                                                       CKMANAGER_FUNC_PostLoad             |
                                                       CKMANAGER_FUNC_OnSequenceAddedToScene  |
                                                       CKMANAGER_FUNC_OnSequenceRemovedFromScene;   }

See Also

CKMANAGER_FUNCTIONS


CKShaderManager::NearestLight

Structure CKShaderManager::NearestLight

struct NearestLight {
CK_ID lightID;
float squareDistance;
}

Retrieves the Nth first nearest lights from an object

Note: The returned array contains at least iRequestedLightCount Lights, but there can be more lights in this array (if some other shader already requested more light in the same rendering frame)

Members

lightID
squareDistance

Remarks

GetNearestLights


Point Clouds

Management of clouds of 3D points.

See Also

Render Engine


Sound Engine

Class CKMidiManager | Midi sound engine manager.
Class CKMidiSound | Midi sound.
Class CKSound | Base Class for Sound management
Class CKSoundManager | Sound Engine Manager.
Class CKWaveSound | Wave sound.

See Also

Classes


CKMidiManager

Class CKMidiManager

Midi sound engine manager.

CKBaseManager
Show brief derivation trees

CKMidiManager

CKBaseManager
Show full derivation trees

CKMidiManager

Remarks

+The midi manager is implemented as an external plugin.The default implementation in Virtools is made using the standard windows API. +The unique instance of this class may be retrieved through the CKContext::GetManagerByGuid(MIDI_MANAGER_GUID)

Groups

Operations
Pure Virtual Method Method CloseFile |
Pure Virtual Method Method Create |
Pure Virtual Method Method GetSoundFileName |
Pure Virtual Method Method IsPaused |
Pure Virtual Method Method IsPlaying |
Pure Virtual Method Method MillisecsToTicks |
Pure Virtual Method Method OpenFile |
Pure Virtual Method Method Pause |
Pure Virtual Method Method Play |
Pure Virtual Method Method Preroll |
Pure Virtual Method Method Release |
Pure Virtual Method Method Restart |
Pure Virtual Method Method SetSoundFileName |
Method StartProfile | Starts profiling.
Pure Virtual Method Method Stop |
Method StopProfile | Stops profiling.
Pure Virtual Method Method TicksToMillisecs |
Pure Virtual Method Method Time |

See Also

CKContext::GetManagerByGuid,CKSoundManager,CKMidiSound


CKMidiManager::CloseFile

Pure Virtual Method Method CKMidiManager::CloseFile

virtual CKERROR CKMidiManager::CloseFile(void* source)


CKMidiManager::Create

Pure Virtual Method Method CKMidiManager::Create

virtual void* CKMidiManager::Create(void* hwnd)


CKMidiManager::GetSoundFileName

Pure Virtual Method Method CKMidiManager::GetSoundFileName

virtual CKSTRING CKMidiManager::GetSoundFileName(void* source)


CKMidiManager::IsPaused

Pure Virtual Method Method CKMidiManager::IsPaused

virtual CKBOOL CKMidiManager::IsPaused(void* source)


CKMidiManager::IsPlaying

Pure Virtual Method Method CKMidiManager::IsPlaying

virtual CKBOOL CKMidiManager::IsPlaying(void* source)


CKMidiManager::MillisecsToTicks

Pure Virtual Method Method CKMidiManager::MillisecsToTicks

virtual CKDWORD CKMidiManager::MillisecsToTicks(void* source,CKDWORD msOffset)


CKMidiManager::OpenFile

Pure Virtual Method Method CKMidiManager::OpenFile

virtual CKERROR CKMidiManager::OpenFile(void* source)


CKMidiManager::Pause

Pure Virtual Method Method CKMidiManager::Pause

virtual CKERROR CKMidiManager::Pause(void* source,CKBOOL pause=TRUE)


CKMidiManager::Play

Pure Virtual Method Method CKMidiManager::Play

virtual CKERROR CKMidiManager::Play(void* source)


CKMidiManager::Preroll

Pure Virtual Method Method CKMidiManager::Preroll

virtual CKERROR CKMidiManager::Preroll(void* source)


CKMidiManager::Release

Pure Virtual Method Method CKMidiManager::Release

virtual void CKMidiManager::Release(void* source)


CKMidiManager::Restart

Pure Virtual Method Method CKMidiManager::Restart

virtual CKERROR CKMidiManager::Restart(void* source)


CKMidiManager::SetSoundFileName

Pure Virtual Method Method CKMidiManager::SetSoundFileName

virtual CKERROR CKMidiManager::SetSoundFileName(void* source,CKSTRING filename)


CKMidiManager::Stop

Pure Virtual Method Method CKMidiManager::Stop

virtual CKERROR CKMidiManager::Stop(void* source)


CKMidiManager::TicksToMillisecs

Pure Virtual Method Method CKMidiManager::TicksToMillisecs

virtual CKDWORD CKMidiManager::TicksToMillisecs(void* source,CKDWORD tkOffset)


CKMidiManager::Time

Pure Virtual Method Method CKMidiManager::Time

virtual CKERROR CKMidiManager::Time(void* source,CKDWORD* pTicks)


CKMidiSound

Class CKMidiSound

Midi sound.

CKObject

CKSceneObject

CKBeObject

CKSound
Show brief derivation trees

CKMidiSound

CKObject

CKSceneObject

CKBeObject

CKSound
Show full derivation trees

CKMidiSound

Remarks

CKMidiSound provides the basic methods for playing a midi sound file. Its class id is CKCID_MIDISOUND

Groups

Operations
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetCurrentPos | Returns the time elapsed in milliseconds
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method GetSoundFileName | Returns the filename used to load this sound
Method IsPaused | Returns whether the sound is currently paused
Method IsPlaying | Returns whether the sound is currently playing
Method Pause | Pauses/Resumes the midi file
Method Play | Starts playing the midi file
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Method SetSoundFileName | Sets the file name for the MIDI file to use
Method Stop | Stops playing the midi file

See Also

CKWaveSound,CKSoundManager


CKMidiSound::GetCurrentPos

Method CKMidiSound::GetCurrentPos

CKDWORD CKMidiSound::GetCurrentPos()

Returns the time elapsed in milliseconds

Returns

Current Play position in milliseconds inside the midi file.

See Also

Play,Pause,Stop,IsPlaying, IsPaused


CKMidiSound::GetSoundFileName

Method CKMidiSound::GetSoundFileName

CKSTRING CKMidiSound::GetSoundFileName()

Returns the filename used to load this sound

Returns

A string containing the filename used to load this sound

See Also

SetSoundFileName


CKMidiSound::IsPaused

Method CKMidiSound::IsPaused

CKBOOL CKMidiSound::IsPaused()

Returns whether the sound is currently paused

Returns

TRUE if sounds has been paused, FALSE otherwise

See Also

Play,Pause,Stop,GetCurrentPos, IsPlaying


CKMidiSound::IsPlaying

Method CKMidiSound::IsPlaying

CKBOOL CKMidiSound::IsPlaying()

Returns whether the sound is currently playing

Returns

TRUE if sounds has been played , FALSE otherwise

See Also

Play,Pause,Stop,GetCurrentPos, IsPaused


CKMidiSound::Pause

Method CKMidiSound::Pause

CKERROR CKMidiSound::Pause(CKBOOL pause)

Pauses/Resumes the midi file

Parameters

Input argument pause

TRUE to pause the playback of the sound , FALSE to resume it.

Returns

Value | Meaning
CK_OK | if successful,
CKERR_NOTINITIALIZED | if midi manager is not present or could not be started.

See Also

Pause,Play,IsPlaying, IsPaused


CKMidiSound::Play

Method CKMidiSound::Play

CKERROR CKMidiSound::Play()

Starts playing the midi file

Returns

Value | Meaning
CK_OK | if successful,
CKERR_NOTINITIALIZED | if midi manager is not present or could not be started.

See Also

Pause,Stop,IsPlaying, IsPaused


CKMidiSound::SetSoundFileName

Method CKMidiSound::SetSoundFileName

CKERROR CKMidiSound::SetSoundFileName(CKSTRING fname)

Sets the file name for the MIDI file to use

Parameters

Input argument fname

MIDI file name to use.

Returns

Value | Meaning
CK_OK | if successful,
CKERR_NOTINITIALIZED | if midi manager is not present or could not be started.

Remarks

Use this method to load a MIDI file.

See Also

GetSoundFileName


CKMidiSound::Stop

Method CKMidiSound::Stop

CKERROR CKMidiSound::Stop()

Stops playing the midi file

Returns

Value | Meaning
CK_OK | if successful,
CKERR_NOTINITIALIZED | if midi manager is not present or could not be started.

See Also

Pause,Play,IsPlaying, IsPaused


CKSound

CKMidiSound

CKWaveSound

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKSound

Subclasses

CKMidiSound, and CKWaveSound

Remarks

CKSound provides only common method for the save options of sounds.

Groups

Save Options
Method GetSaveOptions | Gets the saving options.
Method SetSaveOptions | Sets the saving options.

See Also

CKWaveSound,CKMidiSound


CKSound::GetSaveOptions

Method CKSound::GetSaveOptions

CK_SOUND_SAVEOPTIONS CKSound::GetSaveOptions()

Gets the saving options.

Returns

Save Options.

Remarks

When saving a composition sounds can be kept as reference to external files or the orginal sound file can be appended to the composition file. The CK_SOUND_SAVEOPTIONS enumeration exposes the available options.

See Also

SetSaveOptions,CK_SOUND_SAVEOPTIONS


CKSound::SetSaveOptions

Method CKSound::SetSaveOptions

void CKSound::SetSaveOptions(CK_SOUND_SAVEOPTIONS Options)

Sets the saving options.

Parameters

Input argument Options

Save Options.

Remarks

When saving a composition sounds can be kept as reference to external files or the orginal sound file can be appended to the composition file. The CK_SOUND_SAVEOPTIONS enumeration exposes the available options.

See Also

GetSaveOptions,CK_SOUND_SAVEOPTIONS


CKSoundManager

Class CKSoundManager

Sound Engine Manager.

CKBaseManager
Show brief derivation trees

CKSoundManager

CKBaseManager
Show full derivation trees

CKSoundManager

Remarks

The sound manager is implemented by an external plugin.The default implementation is made using DirectSound.

Sound management is done by the SoundManager which process sounds to play and updates the listener (player ) position and settings.

The unique instance of this class may be retrieved through the CKContext::GetSoundManager()

Groups

Operations
Method CreateMinion |
Method CreateSourceFromFile |
Pure Virtual Method Method GetCaps | Get the caps of the sound manager
Method PauseMinions |
Method ProcessMinions |
Method ReleaseMinions |
Method ResumeMinions |
Method StartProfile | Starts profiling.
Method StopProfile | Stops profiling.
Events
Virtual Method Method OnCKEnd | Called at deletion of a CKContext
Virtual Method Method OnCKInit | Called at the end of the creation of a CKContext.
Virtual Method Method OnCKPause | Called when the process loop is paused.
Virtual Method Method OnCKPlay | Called when the process loop is started .
Virtual Method Method OnCKPostReset | Called after the composition has been restarted.
Virtual Method Method OnCKReset | Called before the composition is reset.
Virtual Method Method OnPostBackToFront | Called after the backbuffer is presented.
Virtual Method Method OnPostCopy | Called at the end of a copy.
Virtual Method Method OnPostFullScreen | Called after switching to/from fullscreen.
Virtual Method Method OnPostRender | Called after the rendering of the 3D objects .
Virtual Method Method OnPostSpriteRender | Called after the rendering of foreground 2D entities.
Virtual Method Method OnPreBackToFront | Called before the backbuffer is presented.
Virtual Method Method OnPreCopy | Called at the beginning of a copy.
Virtual Method Method OnPreFullScreen | Called before switching to/from fullscreen.
Virtual Method Method OnPreRender | Called before the rendering of the 3D objects.
Virtual Method Method OnPreSpriteRender | Called Before the rendering of background 2D entities.
Virtual Method Method OnRasterizerEvent | Called for specific rasterizer events.
Method PostClearAll | Called at the end of a CKContext::ClearAll operation.
Virtual Method Method PostLaunchScene | Called after a scene became active.
Virtual Method Method PostLoad | Called at the end of a load operation.
Virtual Method Method PostProcess | Called at the end of each process loop.
Virtual Method Method PostSave | Called at the end of a save operation.
Virtual Method Method PreClearAll | Called at the beginning of a CKContext::ClearAll operation.
Virtual Method Method PreLaunchScene | Called before a scene becomes active.
Virtual Method Method PreLoad | Called at the beginning of a load operation.
Virtual Method Method PreProcess | Called at the beginning of each process loop.
Virtual Method Method PreSave | Called at the beginning of a save operation.
Virtual Method Method SequenceAddedToScene | Called when objects are added to a scene
Method SequenceDeleted | Called after objects have been deleted.
Virtual Method Method SequenceRemovedFromScene | Called when objects are removed from a scene
Virtual Method Method SequenceToBeDeleted | Called just before objects are deleted.
Listener
Virtual Method Method GetListener | Gets the Listener
Virtual Method Method SetListener | Sets the Listener
Pure Virtual Method Method UpdateListenerSettings | Sets the Listener settings such as global distance factor,doppler effect, rollof or gain.
StreamingBufferSize
Virtual Method Method GetStreamedBufferSize | Gets the internal buffer size used for streaming sounds
Virtual Method Method SetStreamedBufferSize | sets the internal buffer size used for streaming sounds

See Also

CKContext::GetSoundManager,CKMidiManager,CKWaveSound


CKSoundManager::CreateMinion

Method CKSoundManager::CreateMinion

SoundMinion* CKSoundManager::CreateMinion(CKSOUNDHANDLE source,float minimumdelay)


CKSoundManager::CreateSourceFromFile

Method CKSoundManager::CreateSourceFromFile

void* CKSoundManager::CreateSourceFromFile(CK_WAVESOUND_TYPE iFlags,const CKSTRING iFileName,BOOL iStreamed,CKWaveFormat& oWaveFormat)


CKSoundManager::GetCaps

Pure Virtual Method Method CKSoundManager::GetCaps

virtual CK_SOUNDMANAGER_CAPS CKSoundManager::GetCaps()

Remarks

Get the caps of the sound manager


CKSoundManager::PauseMinions

Method CKSoundManager::PauseMinions

void CKSoundManager::PauseMinions()


CKSoundManager::ProcessMinions

Method CKSoundManager::ProcessMinions

void CKSoundManager::ProcessMinions()


CKSoundManager::ReleaseMinions

Method CKSoundManager::ReleaseMinions

void CKSoundManager::ReleaseMinions()


CKSoundManager::ResumeMinions

Method CKSoundManager::ResumeMinions

void CKSoundManager::ResumeMinions()


CKSoundManager::PostClearAll

Method CKSoundManager::PostClearAll

CKERROR CKSoundManager::PostClearAll()

Called at the end of a CKContext::ClearAll operation.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the end of a CKContext::ClearAll operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PostClearAll for this function to get called.

See Also

Main Virtools Events,PreClearAll,CKContext::ClearAll,


CKSoundManager::SequenceDeleted

Method CKSoundManager::SequenceDeleted

CKERROR CKSoundManager::SequenceDeleted(CK_ID* objids,int count)

Called after objects have been deleted.

Parameters

objids | A pointer to a list of CK_ID of the objects being deleted.
count | number of objects in objids list.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function if you need to add specific processing after objects have been deleted. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnSequenceDeleted for this function to get called.

See Also

Main Virtools Events,CKContext::DestroyObjects,SequenceToBeDeleted


CKSoundManager::GetListener

Virtual Method Method CKSoundManager::GetListener

virtual CK3dEntity* CKSoundManager::GetListener()

Gets the Listener

Returns

The currently set listener

Remarks

if no listener is specified, the listener is the current camera but the returned value is NULL.

See Also

SetListener,UpdateListenerSettings


CKSoundManager::SetListener

Virtual Method Method CKSoundManager::SetListener

virtual void CKSoundManager::SetListener(CK3dEntity*listener)

Sets the Listener

Parameters

Input argument listener

The new listener

Remarks

if no listener is specified, the listener is the current camera.

See Also

GetListener,UpdateListenerSettings


CKSoundManager::UpdateListenerSettings

Pure Virtual Method Method CKSoundManager::UpdateListenerSettings

virtual void CKSoundManager::UpdateListenerSettings(CK_SOUNDMANAGER_CAPS settingsoptions,CKListenerSettings& settings,CKBOOL set = TRUE)

Sets the Listener settings such as global distance factor,doppler effect, rollof or gain.

Parameters

Input argument settingsoptions

flags specifying wich member of the settings parameter must be set or retrieved

Remarks

if no listener is specified, the listener is the current camera.

Settings

structure specifyig the new settings. set : if true the function sets the listener settings, otherwise it returns the current listener options in the “settings” parameter

See Also

GetListener,SetListener,CKListenerSettings,CK_SOUNDMANAGER_CAPS


CKSoundManager::GetStreamedBufferSize

Virtual Method Method CKSoundManager::GetStreamedBufferSize

virtual CKDWORD CKSoundManager::GetStreamedBufferSize()

Gets the internal buffer size used for streaming sounds

Parameters

The length in milliseconds of the buffer used to play streamed sound.

Remarks

if a streamed sound length is smaller than this value, it will be fully loaded in memory.

See Also

SetStreamedBufferSize


CKSoundManager::SetStreamedBufferSize

Virtual Method Method CKSoundManager::SetStreamedBufferSize

virtual void CKSoundManager::SetStreamedBufferSize(CKDWORD bsize)

sets the internal buffer size used for streaming sounds

Returns

bsize : The length in milliseconds of the buffer used to play streamed sound.

Remarks

if a streamed sound length is smaller than this value, it will be fully loaded in memory.

See Also

GetStreamedBufferSize


CKWaveSound

Class CKWaveSound

Wave sound.

CKObject

CKSceneObject

CKBeObject

CKSound
Show brief derivation trees

CKWaveSound

CKObject

CKSceneObject

CKBeObject

CKSound
Show full derivation trees

CKWaveSound

Remarks

CKWaveSound provides methods for playing a wave sound file (Wav,etc..)

The sound can be played using 3D , stero , frequency control , panning and volume control. Sound file are not loaded but read from disk by a separate thread.

Its class id is CKCID_WAVESOUND

Groups

Operations
Method Create | Creation of the Sound buffer from a file
Method GetAttachedEntity | retrieves the sound attached entity
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetCone | Gets the conne rendering settings
Method GetDirection | Returns the sound relative Direction
Method GetFileStreaming | Gets the sound streaming status
Method GetGain | returns the sound current gain setting.
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method GetMinMaxDistance | Gets the attenuation settings.
Method GetOrientation | Gets the relative orientation of the sound to the attached entity
Method GetPan | returns the current panning setting value
Method GetPitch | returns the playback pitch
Method GetPlayedMs | Get the sound current play position in milliseconds.
Method GetPlayPosition | Get the sound current play position
Method GetPosition | Returns the sound relative position
Method GetReader | Returns the Reader associated with the sound
Method GetSound3DInformation | Gets the sound 3d informations
Method GetSoundFileName | Gets the file associated with the sound
Method GetSoundFormat | Gets the format of the sound buffer
Method GetSoundLength | returns the duration of the sound
Method GetVelocity | Gets the relative velocity of the sound to the attached entity
Method InternalSetGain |
Method IsPaused | returns the pause status of the sound
Method IsPlaying | returns the playback status of the sound
Method Lock | Allows to get a write pointer to the sound buffer
Method Pause | Pause the playback
Method Play | Begins the playback of a sound
Method PlayMinion | Plays an instance of a sound
Method PositionSound | Sets the sound 3d position settings
Method RestoreSettings |
Method Resume | Resumes the playback of a paused sound
Method Rewind | Rewinds the sounds
Method SaveSettings |
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Method SetCone | Sets the cone rendering settings
Method SetDataToRead | Set the total amount of data that must be read by the reader
Method SetFileStreaming | Modifies the streaming mode
Method SetGain | Sets the gain
Method SetLoopMode | Sets or gets if the sound must be looping or not
Method SetMinMaxDistance | Set the minimum and maximum distance attenuation values for point or cone sound
Method SetOrientation | Sets the sound relative orientation
Method SetPan | Set the sound panning
Method SetPitch | Set the playback rate
Method SetReader | Associates a Reader of the sound buffer
Method SetSoundFileName | Changes the file asssociated with the sound
Method SetType | Sets or gets the type of the sound
Method SetVelocity | Sets the current sound relative velocity to the listener
Method Stop | Stops the sound playback
Method Unlock | Unlocks a sound buffer previously locked.
Method WriteData |
Scripts
Method AddScript | Adds a script to the object
Method GetScript | Returns the script at the given index
Method GetScriptCount | Returns the number of scripts of the object
Method RemoveAllScripts | Removes all the scripts of the object
Method RemoveScript | Removes a script from the object
Method SetPriority | Sets the priority of the sound

See Also

CKMidiSound,CKSoundManager


CKWaveSound::Create

Method CKWaveSound::Create

CKERROR
CKWaveSound::Create(CKBOOL FileStreaming,CKSTRING FileName)
CKERROR
CKWaveSound::Create(CK_WAVESOUND_TYPE Type,CKWaveFormat* Format,int Size)

Creation of the Sound buffer from a file

Parameters

filestreaming : Specify if the sound must be streamed if it cannot fit in the default buffer size filename : Name of the of the source file of the sound to be created

Returns

CK_OK if everything succeed, an error otherwise.

Remarks

Use this function to create a the buffer a associated with a sound, you can later, write data directly to the buffer using the lock methods or associate a reader with the sound.

See Also

GetFileName ,CKWaveFormat,CK_WAVESOUND_TYPE


CKWaveSound::GetAttachedEntity

Method CKWaveSound::GetAttachedEntity

CK3dEntity* CKWaveSound::GetAttachedEntity()

retrieves the sound attached entity

Returns

a pointer to a CK3dEntity derived object if the sound is in oint or cone rendering and has an atached entity.

See Also

PositionSound, GetPosition, GetDirection, GetSound3DInformation


CKWaveSound::GetCone

Method CKWaveSound::GetCone

void CKWaveSound::GetCone(float* InAngle, float* OutAngle, float* Gain)

Gets the conne rendering settings

Remarks

Cone rendering mode is not yet supported.

See Also

SetCone


CKWaveSound::GetDirection

Method CKWaveSound::GetDirection

void CKWaveSound::GetDirection(VxVector& Dir)

Returns the sound relative Direction

Parameters

Input argument Dir

a VxVector that will receive the sound relative position.

See Also

GetDirection, SetPosition, SetOrientation, GetSound3DInformation, PositionSound


CKWaveSound::GetFileStreaming

Method CKWaveSound::GetFileStreaming

CKBOOL
CKWaveSound::GetFileStreaming()

Gets the sound streaming status

Returns

a non zero if the file is streamed, 0 otherwise

See Also

CKWaveSound::SetFileStreaming


CKWaveSound::GetGain

Method CKWaveSound::GetGain

float
CKWaveSound::GetGain()

returns the sound current gain setting.

Returns

the sound current gain.

See Also

SetGain, SetPitch, GetPitch


CKWaveSound::GetMinMaxDistance

Method CKWaveSound::GetMinMaxDistance

void CKWaveSound::GetMinMaxDistance(float* MinDistance,float* MaxDistance,CKDWORD* MaxDistanceBehavior)

Gets the attenuation settings.

Parameters

Input argument MinDistance | will receive the current MinDistance setting
Input argument MaxDistance | will receive the current MaxDistance setting
Input argument MaxDistanceBehavior | will receive the current MaxDistanceBehavior setting

See Also

SetMinMaxDistance


CKWaveSound::GetOrientation

Method CKWaveSound::GetOrientation

void CKWaveSound::GetOrientation(VxVector& Dir, VxVector& Up)

Gets the relative orientation of the sound to the attached entity

Parameters

Input argument Dir | a VxVector that will receive the relative sound Direction vector
Input argument Up | a VxVector that will receive the relative sound Up vector

Remarks

This setting is used in cone rendering only.

See Also

SetVelocity, GetVelocity, SetOrientation


CKWaveSound::GetPan

Method CKWaveSound::GetPan

float
CKWaveSound::GetPan()

returns the current panning setting value

Returns

the current panning setting value;

See Also

SetPan


CKWaveSound::GetPitch

Method CKWaveSound::GetPitch

float
CKWaveSound::GetPitch()

returns the playback pitch

Returns

The playback pitch factor

See Also

CKWaveSound::SetPitch


CKWaveSound::GetPlayedMs

Method CKWaveSound::GetPlayedMs

int
CKWaveSound::GetPlayedMs()

Get the sound current play position in milliseconds.

Returns

The current play position in the sound buffer in milliseconds.


CKWaveSound::GetPlayPosition

Method CKWaveSound::GetPlayPosition

CKDWORD
CKWaveSound::GetPlayPosition()

Get the sound current play position

Returns

The current play position in the sound buffer.


CKWaveSound::GetPosition

Method CKWaveSound::GetPosition

void CKWaveSound::GetPosition(VxVector& Pos)

Returns the sound relative position

Parameters

Input argument Pos

a VxVector that will receive the sound relative position.

See Also

GetDirection, SetPosition, SetDirection, GetSound3DInformation, PositionSound


CKWaveSound::GetReader

Method CKWaveSound::GetReader

CKSoundReader*
CKWaveSound::GetReader()

Returns the Reader associated with the sound

Returns

A pointer to a CKSoundReader if the sound is streamed

Remarks

Use this function to retrieve the reader associated with a sound.

See Also

SetReader


CKWaveSound::GetSound3DInformation

Method CKWaveSound::GetSound3DInformation

void CKWaveSound::GetSound3DInformation(VxVector& Pos,VxVector& Dir,float& DistanceFromListener)

Gets the sound 3d informations

Parameters

Input argument Pos | Will receive the sound relative position.
Input argument Dir | Will receive the sound relative direction.
Input argument DistanceFromListener | will receive the distance between the sound and the listener.

See Also

SetSound3DInformation


CKWaveSound::GetSoundFileName

Method CKWaveSound::GetSoundFileName

CKSTRING
CKWaveSound::GetSoundFileName()

Gets the file associated with the sound

Returns

a CKSTRING containing the path of the associated file.

See Also

CKSTRING


CKWaveSound::GetSoundFormat

Method CKWaveSound::GetSoundFormat

CKERROR CKWaveSound::GetSoundFormat(CKWaveFormat &Format)

Gets the format of the sound buffer

Parameters

Input argument Format

a CKWaveFormat reference that will be filled, .

Returns

CK_OK if everything succeed, an error otherwise.

See Also

GetSoundFormat,CKWaveFormat


CKWaveSound::GetSoundLength

Method CKWaveSound::GetSoundLength

int CKWaveSound::GetSoundLength()

returns the duration of the sound

Returns

Duration of the sound in ms.

See Also

GetSoundFormat


CKWaveSound::GetVelocity

Method CKWaveSound::GetVelocity

void CKWaveSound::GetVelocity(VxVector& Pos)

Gets the relative velocity of the sound to the attached entity

Parameters

Input argument Pos

a vector that will receive the current sound velocity

See Also

SetVelocity


CKWaveSound::InternalSetGain

Method CKWaveSound::InternalSetGain

void
CKWaveSound::InternalSetGain(float Gain)


CKWaveSound::IsPaused

Method CKWaveSound::IsPaused

CKBOOL
CKWaveSound::IsPaused()

returns the pause status of the sound

Returns

0 if the sound is not paused, and non 0 value otherwise.


CKWaveSound::IsPlaying

Method CKWaveSound::IsPlaying

CKBOOL
CKWaveSound::IsPlaying()

returns the playback status of the sound

Returns

0 if the sound is not playing, and non 0 value otherwise.


CKWaveSound::Lock

Method CKWaveSound::Lock

CKERROR
CKWaveSound::Lock(CKDWORD WriteCursor,CKDWORD NumBytes,void **Ptr1,CKDWORD *Bytes1,void **Ptr2,CKDWORD *Bytes2,CK_WAVESOUND_LOCKMODE Flags)

Allows to get a write pointer to the sound buffer

Parameters

Input argument WriteCursor

Offset in bytes from the start of the buffer where the lock begins. This parameter is ignored if LOCK_FROMWRITECURSOR is specified in the Flags parameter.
Input argument NumBytes

Size, in bytes of the buffer to lock.
Input argument Ptr1

Address of a pointer to contain the sound buffer to be locked.
Input argument Bytes1

size in bytes of the data contained in Ptr1. If this value is less than the NumBytes, Ptr2 will point to a second block of data.
Input argument Ptr2

Address of a pointer to contain the second block of the sound buffer to be locked.
Input argument Bytes2

Address of a variable to contain the number of bytes in the Ptr2 parameter.
Input argument Flags

Specifies where the locks begins

  • CK_WAVESOUND_LOCKFROMWRITE Locks from the current write position, WriteCursor is ignored

  • CK_WAVESOUND_LOCKENTIREBUFFER Locks the entire buffer. NumBytes is ignored.

Returns

CK_OK if everything succeed, an error otherwise.

Remarks

Use this function to gain acces to the data buffer associated with the sound. An other methods to act on the sound is to create a custom reader and to feed it with your data. Calls to Lock must be paired with a call to Unlock.

See Also

Unlock, CK_WAVESOUND_LOCKMODE


CKWaveSound::Pause

Method CKWaveSound::Pause

void
CKWaveSound::Pause()

Pause the playback

See Also

Resume,Play


CKWaveSound::Play

Method CKWaveSound::Play

void CKWaveSound::Play(float FadeIn,float FinalGain)

Begins the playback of a sound

Parameters

Input argument FadeIn | start fade in time, set it to zero for no fadein.
Input argument FinalGain | final gain when the fadein time is ellapsed.

See Also

CKWaveSound::Pause, Resume


CKWaveSound::PlayMinion

Method CKWaveSound::PlayMinion

CKSOUNDHANDLE
CKWaveSound::PlayMinion(CKBOOL Background,CK3dEntity* Ent,VxVector* Position,VxVector* Direction,float MinDelay,float gain)

Plays an instance of a sound

Parameters

Input argument Background | set this value to TRUE to create a background sound, to FALSE to create a 3D sound
Input argument Ent | Entity used to determine the sound 3d position.
Input argument Position | Position of the sound in the Entity referential
Input argument Direction | Direction of the sound in the Entity referential
Input argument MinDelay | minimum repeat delay in milliseconds between the creation of a minions for a sound.

Returns

a CKSOUNDHANDLE handle if the call succeeds, NULL otherwise.

Remarks

The sound must not be streamed to allow minions creation.


CKWaveSound::PositionSound

Method CKWaveSound::PositionSound

void CKWaveSound::PositionSound(CK3dEntity* Object,VxVector* Position,VxVector* Direction,CKBOOL Commit)

Sets the sound 3d position settings

Parameters

Input argument Object | the 3d entity from wich the sound is heard.
Input argument Position | the relative position of the sound in the 3d Entity referential.
Input argument Direction | the relative direction of the sound in the 3d Entity referential.
Input argument Commit | set it to true to commit the changes. If it is not specified the change will occur after a the frame is complete.

See Also

SetPosition, SetDirection,GetPosition, GetDirection, GetSound3DInformation


CKWaveSound::RestoreSettings

Method CKWaveSound::RestoreSettings

void
CKWaveSound::RestoreSettings()


CKWaveSound::Resume

Method CKWaveSound::Resume

void
CKWaveSound::Resume()

Resumes the playback of a paused sound

See Also

Pause


CKWaveSound::Rewind

Method CKWaveSound::Rewind

void CKWaveSound::Rewind()

Rewinds the sounds

See Also

Play, Stop, Pause, Resume


CKWaveSound::SaveSettings

Method CKWaveSound::SaveSettings

void
CKWaveSound::SaveSettings()


CKWaveSound::SetCone

Method CKWaveSound::SetCone

void CKWaveSound::SetCone(float InAngle, float OutAngle, float Gain)

Sets the cone rendering settings

Remarks

Cone rendering mode is not yet supported.

See Also

GetCone


CKWaveSound::SetDataToRead

Method CKWaveSound::SetDataToRead

void
CKWaveSound::SetDataToRead(int Size)

Set the total amount of data that must be read by the reader

Parameters

size : size of data in bytes.

Remarks

Use this function to set the total size of uncompressed data that must be read from the file.

See Also

SetReader


CKWaveSound::SetFileStreaming

Method CKWaveSound::SetFileStreaming

CKERROR
CKWaveSound::SetFileStreaming(CKBOOL Enabled,CKBOOL RecreateSound)

Modifies the streaming mode

Parameters

Input argument Enabled | if this parameter is set to TRUE, the file will be streamed in the buffer. Otherwise the buffer will be reallocated to contain the whole uncompressed sound data, and will be filled with the sound data.
Input argument RecreateSound | Set this parameter to TRUE, to recreate the sound after modifiying the streaming flag.

Returns

CK_OK if everything succeed, an error otherwise.

Remarks

Switching from streamed to not streamed can be time consuming on long and higly compressed file. a 3-4 minutes compressed file will result in allocating 30-40Mb and decompreressing the whole file into it.


CKWaveSound::SetGain

Method CKWaveSound::SetGain

void
CKWaveSound::SetGain(float Gain)

Sets the gain

Parameters

Input argument Gain

this value must be between 0.0 and 1.0, at 0.0 the sound is muted at 1.0 it is at its full level.

See Also

GetGain, SetPitch, GetPitch


CKWaveSound::SetLoopMode

Method CKWaveSound::SetLoopMode

void CKWaveSound::SetLoopMode(CKBOOL Enabled)
CKBOOL CKWaveSound::GetLoopMode()

Sets or gets if the sound must be looping or not

Parameters

enabled: Specify if you want the sound to loop or not

Returns

TRUE if the sound is in loop mode.


CKWaveSound::SetMinMaxDistance

Method CKWaveSound::SetMinMaxDistance

void CKWaveSound::SetMinMaxDistance(float MinDistance,float MaxDistance,CKDWORD MaxDistanceBehavior)

Set the minimum and maximum distance attenuation values for point or cone sound

Parameters

Input argument MinDistance

the distance where the attenuation begins
Input argument MaxDistance

the distance where the attenuation stops
Input argument MaxDistanceBehavior
unused

present for back compatibility only - formerly used with A3D to mute the sound after MaxDistance, please look at Variable Manager -> Sounds/Mute 3D Sounds After Max Distance for the corresponding DirectSound functionnality )

See Also

GetMinMaxDistance


CKWaveSound::SetOrientation

Method CKWaveSound::SetOrientation

void CKWaveSound::SetOrientation(VxVector& dir, VxVector& up)

Sets the sound relative orientation

Remarks

Orientation is relative to the attached entity. This function is for direct access to the source : You don't have to use them normally. This setting is used in cone rendering only.

See Also

SetVelocity, GetVelocity, GetOrientation


CKWaveSound::SetPan

Method CKWaveSound::SetPan

void CKWaveSound::SetPan(float Pan)

Set the sound panning

Parameters

Input argument Pan

the desired panning value it must be between -1.0 and 1.0.

Remarks

0 means a centered panning, -1 full left and 1 full right. Panning has no effect on point or cone sound


CKWaveSound::SetPitch

Method CKWaveSound::SetPitch

void
CKWaveSound::SetPitch(float Rate)

Set the playback rate

Parameters

Input argument Rate

playback rate factor


CKWaveSound::SetReader

Method CKWaveSound::SetReader

CKERROR
CKWaveSound::SetReader(CKSoundReader* Reader)

Associates a Reader of the sound buffer

Parameters

Input argument Reader

A Pointer to a CKSoundReader instance

Returns

CK_OK if everything succeed, an error otherwise.

Remarks

Use this function to associate a specific reader with a sound previously created with Create(CK_WAVESOUND_TYPE type,CKWaveFormat* format,int size) function.

See Also

GetFileName ,CKWaveFormat,CK_WAVESOUND_TYPE


CKWaveSound::SetSoundFileName

Method CKWaveSound::SetSoundFileName

CKERROR
CKWaveSound::SetSoundFileName(const CKSTRING FileName)

Changes the file asssociated with the sound

Parameters

Input argument FileName

the name of the file.

Returns

CK_OK if the call succeds, an error otherwise.

Remarks

The file name can be a fully qualified path or a relative path. See CKPathManager for file path resolution information

See Also

CKPathManager, GetSoundFileName


CKWaveSound::SetType

Method CKWaveSound::SetType

void
CKWaveSound::SetType(CK_WAVESOUND_TYPE Type)
CK_WAVESOUND_TYPE
CKWaveSound::GetType()

Sets or gets the type of the sound

Parameters

Input argument Type

A CK_WAVESOUND_TYPE enum value

Returns

A CK_WAVESOUND_TYPE enum value for GetType

Remarks

Set the rendering mode of the sound : background, point or cone.


CKWaveSound::SetVelocity

Method CKWaveSound::SetVelocity

void CKWaveSound::SetVelocity(VxVector& Pos)

Sets the current sound relative velocity to the listener

Parameters

Input argument Pos

the relative sound velocity.

Remarks

Velocity is relative to the listener. This function is for direct access to the source : You don't have to use them normally.

See Also

GetVelocity


CKWaveSound::Stop

Method CKWaveSound::Stop

void CKWaveSound::Stop(float FadeOut)

Stops the sound playback

Parameters

Input argument FadeOut

fade out time, before really stopping the sound. set it to 0 for non fade out effect

See Also

Play, Pause, Resume, Rewind


CKWaveSound::Unlock

Method CKWaveSound::Unlock

CKERROR
CKWaveSound::Unlock(void *Ptr1,CKDWORD Bytes1,void *Ptr2,CKDWORD Bytes2)

Unlocks a sound buffer previously locked.

Parameters

Input argument Ptr1 | pointer to the first data block returned by a previous call to Lock
Input argument Bytes1 | the size of the first data block returned by a previous call to Lock
Input argument Ptr2 | pointer to he data returned by a previous call to Lock
Input argument Bytes2 | the size of the second data block returned by a previous call to Lock

Returns

CK_OK if everything succeed, an error otherwise.

See Also

Lock, CK_WAVESOUND_LOCKMODE


CKWaveSound::WriteData

Method CKWaveSound::WriteData

CKERROR
CKWaveSound::WriteData(BYTE* buffer,int buffersize)


CKWaveSound::SetPriority

Method CKWaveSound::SetPriority

void
CKWaveSound::SetPriority(float Priority)
float
CKWaveSound::GetPriority()

Sets the priority of the sound

Parameters

priority: A float value between 0.0 and 1.0 inclusive. Default value is 0.5.

Remarks

Higher priority make object's scripts being executed before lesser priority objects. The default priority of a behavioral object is CKOBJECT_PRIORITYDEFAULT (0). The Level has the highest priority by default (CKOBJECT_PRIORITYMAX) so its script are executed first then come the Scenes with a default priority of 30000 and places (20000).

Implementation Notes

This function is usefull when you have too much sound simultaneously playing and let you decide which are the most important. You can modify the weight of the priority with the SetPriorityBias of the SoundManager All sound sources have a default priority of 0.5 with lowest priority being 0.0 and highest 1.0.

See Also

GetPriority


Plugins

Plugins related classes

Class CKPluginDll | Short description of a DLL that declared plugins
Class CKPluginEntry | Plugin Description structure
Structure CKPluginEntryBehaviorsData | List of behavior GUID declared by a plugin
Class CKPluginEntryReadersData | Data Reader (Movie,Bitmap,Sound,Models...) specific options
Class CKPluginInfo | Plugin description.
Class CKPluginManager | Plugins Manager
External Managers classes | External manager plugins
External Readers classes | Media readers related classes

See Also

Classes


CKPluginDll

Class CKPluginDll

Short description of a DLL that declared plugins

Remarks

struct CKPluginDll
{
    XString         m_DllFileName;
    INSTANCE_HANDLE m_DllInstance;
    int             m_PluginInfoCount;
};

Groups

Data Members
Member Variable m_DllFileName | DLL Path
Member Variable m_DllInstance | Instance of the Loaded Dll (as HINSTANCE on windows)
Member Variable m_PluginInfoCount | Number of plugins declared by this DLL
Operations
Method GetFunctionPtr | Returns a pointer to a function inside the plugin.

See Also

CKPluginManager::GetPluginDllInfo


CKPluginDll::m_DllFileName

Member Variable CKPluginDll::m_DllFileName

XString CKPluginDll::m_DllFileName

Remarks

DLL Path


CKPluginDll::m_DllInstance

Member Variable CKPluginDll::m_DllInstance

INSTANCE_HANDLE CKPluginDll::m_DllInstance

Remarks

Instance of the Loaded Dll (as HINSTANCE on windows)


CKPluginDll::m_PluginInfoCount

Member Variable CKPluginDll::m_PluginInfoCount

int CKPluginDll::m_PluginInfoCount

Remarks

Number of plugins declared by this DLL


CKPluginDll::GetFunctionPtr

Method CKPluginDll::GetFunctionPtr

void* CKPluginDll::GetFunctionPtr(CKSTRING FunctionName)

Returns a pointer to a function inside the plugin.

Parameters

Input argument FunctionName

Name of the function which should be returned

Returns

A Pointer to the function or NULL if the function was not found in the DLL.


CKPluginEntry

Class CKPluginEntry

Plugin Description structure

Remarks

This structure described a registred Virtools plugin :

struct  CKPluginEntry
{
    int             m_PluginDllIndex;
    int             m_PositionInDll;
    CKPluginInfo    m_PluginInfo;
    (According to the type of plugin )
    CKPluginEntryReadersData*   m_ReadersInfo;
    CKPluginEntryBehaviorsData* m_BehaviorsInfo;
    CKBOOL          m_Active;
    int             m_IndexInCategory;
    CKBOOL          m_NeededByFile;
}

Groups

Data Members
Member Variable m_Active | For manager and Render engines TRUE if a manager was created, for other plugins this value is not used.
Member Variable m_BehaviorsInfo | Behavior plugins specific info (list of declared behavior GUIDS)
Member Variable m_IndexInCategory | Index of this entry in its category
Member Variable m_NeededByFile | When saving a file TRUE if at least one object needs this plugin
Member Variable m_PluginDllIndex | Index of the owner Dll in the list of Dlls
Member Variable m_PluginInfo | Base Info on the plugin (Type, Name,Description)
Member Variable m_PositionInDll | Position of the PluginInfo inside the DLL (when thery are several plugins inside a same DLL)
Member Variable m_ReadersInfo | Reader plugins specific info (optionnal settings + load/save capabilities)

See Also

CKPluginManager::GetPluginInfo


CKPluginEntry::m_Active

Member Variable CKPluginEntry::m_Active

CKBOOL CKPluginEntry::m_Active

Remarks

For manager and Render engines TRUE if a manager was created, for other plugins this value is not used.


CKPluginEntry::m_BehaviorsInfo

Member Variable CKPluginEntry::m_BehaviorsInfo

CKPluginEntryBehaviorsData* CKPluginEntry::m_BehaviorsInfo

Remarks

Behavior plugins specific info (list of declared behavior GUIDS)


CKPluginEntry::m_IndexInCategory

Member Variable CKPluginEntry::m_IndexInCategory

int CKPluginEntry::m_IndexInCategory

Remarks

Index of this entry in its category


CKPluginEntry::m_NeededByFile

Member Variable CKPluginEntry::m_NeededByFile

CKBOOL CKPluginEntry::m_NeededByFile

Remarks

When saving a file TRUE if at least one object needs this plugin


CKPluginEntry::m_PluginDllIndex

Member Variable CKPluginEntry::m_PluginDllIndex

int CKPluginEntry::m_PluginDllIndex

Remarks

Index of the owner Dll in the list of Dlls


CKPluginEntry::m_PluginInfo

Member Variable CKPluginEntry::m_PluginInfo

CKPluginInfo CKPluginEntry::m_PluginInfo

Remarks

Base Info on the plugin (Type, Name,Description)


CKPluginEntry::m_PositionInDll

Member Variable CKPluginEntry::m_PositionInDll

int CKPluginEntry::m_PositionInDll

Remarks

Position of the PluginInfo inside the DLL (when thery are several plugins inside a same DLL)


CKPluginEntry::m_ReadersInfo

Member Variable CKPluginEntry::m_ReadersInfo

CKPluginEntryReadersData* CKPluginEntry::m_ReadersInfo

Remarks

Reader plugins specific info (optionnal settings + load/save capabilities)


CKPluginEntryBehaviorsData

Structure CKPluginEntryBehaviorsData

struct CKPluginEntryBehaviorsData
{
XArray<CKGUID> m_BehaviorsGUID;
}

List of behavior GUID declared by a plugin

Members

m_BehaviorsGUID

See Also

CKPluginEntry


CKPluginEntryReadersData

Class CKPluginEntryReadersData

Data Reader (Movie,Bitmap,Sound,Models...) specific options

Groups

Data Members
Member Variable m_GetReaderFct | A pointer to the function that will create a reader.
Member Variable m_OptionCount | Number of options for the reader
Member Variable m_ReaderFlags | Reader Save/Load options
Member Variable m_SettingsParameterGuid | Parameter type for options


CKPluginEntryReadersData::m_GetReaderFct

Member Variable CKPluginEntryReadersData::m_GetReaderFct

CKReaderGetReaderFunction CKPluginEntryReadersData::m_GetReaderFct

Remarks

A pointer to the function that will create a reader.


CKPluginEntryReadersData::m_OptionCount

Member Variable CKPluginEntryReadersData::m_OptionCount

int CKPluginEntryReadersData::m_OptionCount

Remarks

Number of options for the reader


CKPluginEntryReadersData::m_ReaderFlags

Member Variable CKPluginEntryReadersData::m_ReaderFlags

CK_DATAREADER_FLAGS CKPluginEntryReadersData::m_ReaderFlags

Remarks

Reader Save/Load options


CKPluginEntryReadersData::m_SettingsParameterGuid

Member Variable CKPluginEntryReadersData::m_SettingsParameterGuid

CKGUID CKPluginEntryReadersData::m_SettingsParameterGuid

Remarks

Parameter type for options


CKPluginInfo

Class CKPluginInfo

Plugin description.

Remarks

The m_InitInstanceFct function is called (if present) when a CKContext is created to enable plugin to register new types or create managers they implement. The m_ExitInstanceFct function is called if the DLL that implements this plugin is unloaded so that the plugin unregister all the types it may have registered in m_InitInstanceFct.

struct CKPluginInfo {
    CKGUID                  m_GUID;             // Unique Identifier
    CKFileExtensionShort    m_ShortExtension;   // Supported file extension for a reader plugin (limited to 3 characters)
    XString                 m_Description;      // Description string
    XString                 m_Author;           // Author string
    XString                 m_Summary;          // Quick description
    DWORD                   m_Version;          // Version
    CK_INITINSTANCEFCT      m_InitInstanceFct;  // Initialization function
    CK_PLUGIN_TYPE          m_Type;             // Type of this plugin
    CK_EXITINSTANCEFCT      m_ExitInstanceFct;  // Exit function
    CKFileExtension         m_Extension;        // Supported file extension for a reader plugin (limite to VIRTOOLS_MAX_EXTENSION_SIZE characters)
}

Groups

Constructors
Method CKPluginInfo

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.

See Also

Creating New Plugins,CKPluginManager,CK_PLUGIN_TYPE


CKPluginInfo::CKPluginInfo

Method CKPluginInfo::CKPluginInfo

CKPluginInfo::CKPluginInfo()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKPluginManager

Class CKPluginManager

Plugins Manager

Remarks

CKPluginManager does not derive from CKBaseManager and there is only one instance of the plugin per process (even if there are several CKContext)

PluginManager init functions must be call before creating any CKContext to find the available plugins (ParsePlugins or RegisterPlugin).

The plugin manager can be retrieve with the CKGetPluginManager function.

Plugins are sorted by their category, many methods asks to be given a category which must be a valid CK_PLUGIN_TYPE identifier or -1 to use all categories.

Since a Dll can contain several plugins the plugin manager give acces to either the list of plugin per category (GetPluginCount,GetPluginInfo) or to the list of Dll that were loaded (GetPluginDllCount,GetPluginDllInfo). A plugin is identified by its CKPluginEntry which contains its type and other informations along with the index of the DLL that declared it.

Groups

Operations | Categories | Initialization | Plugin DLLs | Plugin Entries | Readers access

Operations
Method AddCategory | Category Functions
Method RegisterPluginInfo |
Method RemoveCategory | Removes a category, category name must be unique
Method RenameCategory | Renames a category
Method SetReaderOptionData | Bitmap,Sound,Model or Movie Reader Access
Categories
Method GetCategoryCount | Returns the number of plugin categories
Method GetCategoryIndex | Returns the index of a given category
Method GetCategoryName | Returns the name of a given category
Initialization
Method ParsePlugins | Parse a directory for plugin dlls
Plugin DLLs
Method GetPluginDllCount | Returns the number of registred plugin DLLs
Method GetPluginDllInfo | Returns the description of a given plugin DLL.
Method ReLoadPluginDll | Reloads a given plugin DLL.
Method UnLoadPluginDll | Unloads a given plugin DLL.
Plugin Entries
Method FindComponent | Search for a given GUID amongst the plugins
Method GetPluginCount | Returns the number of registred plugins in a given category
Method GetPluginInfo | Returns the description of a plugin
Readers access
Method GetBitmapReader | Returns a bitmap reader.
Method GetModelReader | Returns a model reader.
Method GetMovieReader | Returns a movie reader.
Method GetSoundReader | Returns a sound reader.

See Also

CKPluginEntry,CKPluginDll,Creating New Plugins


CKPluginManager::AddCategory

Method CKPluginManager::AddCategory

int CKPluginManager::AddCategory(CKSTRING cat)

Remarks

Category Functions


CKPluginManager::RegisterPluginInfo

Method CKPluginManager::RegisterPluginInfo

void CKPluginManager::RegisterPluginInfo(int PositionInDll,CKPluginInfo* info,CKDLL_OBJECTDECLARATIONFUNCTION InfoFct,CKReaderGetReaderFunction GetReaderFunc)


CKPluginManager::RemoveCategory

Method CKPluginManager::RemoveCategory

CKERROR CKPluginManager::RemoveCategory(int catIdx)

Remarks

Removes a category, category name must be unique


CKPluginManager::RenameCategory

Method CKPluginManager::RenameCategory

CKERROR CKPluginManager::RenameCategory(int catIdx, CKSTRING newName)

Remarks

Renames a category


CKPluginManager::SetReaderOptionData

Method CKPluginManager::SetReaderOptionData

BOOL CKPluginManager::SetReaderOptionData(CKContext* context,void* memdata,CKParameterOut* Param,CKFileExtension ext,CKGUID* guid=NULL)

Remarks

Bitmap,Sound,Model or Movie Reader Access


CKPluginManager::GetCategoryCount

Method CKPluginManager::GetCategoryCount

int CKPluginManager::GetCategoryCount()

Returns the number of plugin categories

See Also

CK_PLUGIN_TYPE,GetCategoryName,GetCategoryIndex


CKPluginManager::GetCategoryIndex

Method CKPluginManager::GetCategoryIndex

int CKPluginManager::GetCategoryIndex(CKSTRING cat)

Returns the index of a given category

Parameters

Input argument cat

Name of the category

Returns

-1 if the category is not found or its index otherwise.

See Also

CK_PLUGIN_TYPE,GetCategoryCount,GetCategoryIndex


CKPluginManager::GetCategoryName

Method CKPluginManager::GetCategoryName

CKSTRING CKPluginManager::GetCategoryName(int catIdx)

Returns the name of a given category

Parameters

Input argument catIdx

Index of the category to return (one of CK_PLUGIN_TYPE)

See Also

CK_PLUGIN_TYPE,GetCategoryCount,GetCategoryIndex


CKPluginManager::ParsePlugins

Method CKPluginManager::ParsePlugins

int CKPluginManager::ParsePlugins(CKSTRING Directory)
CKERROR CKPluginManager::RegisterPlugin(CKSTRING str)

Parse a directory for plugin dlls

Parameters

Input argument Directory

Path to be parsed (along with the subfolders) str: Path of the plugin dll to be registred.

Returns

Number of valid plugins enumerated.

Remarks

+To register a specific dll use RegisterPlugin otherwise to search in a folder for any valid Virtools plugin use ParsePlugins +This function is called by the framework before creating any context. It must be called when implementing a standalone application (see Creating a Standalone Application)

See Also

Creating a Standalone Application,RegisterPlugin


CKPluginManager::GetPluginDllCount

Method CKPluginManager::GetPluginDllCount

int CKPluginManager::GetPluginDllCount()

Returns the number of registred plugin DLLs

See Also

GetPluginDllInfo,CKPluginDll,UnLoadPluginDll,ReLoadPluginDll


CKPluginManager::GetPluginDllInfo

Method CKPluginManager::GetPluginDllInfo

CKPluginDll* CKPluginManager::GetPluginDllInfo(CKSTRING PluginName,int *idx = NULL)
CKPluginDll* CKPluginManager::GetPluginDllInfo(int PluginDllIdx)

Returns the description of a given plugin DLL.

Parameters

Input argument PluginDllIdx | Index of the plugin DLL which description is to be returned.
Input argument PluginName | Name of the plugin DLL which description is to be returned.

Remarks

Returns a pointer to a CKPluginDll structure containing a description of the DLL (name,instance handle,number of plugin entries declared) The index ofthe DLL for a plugin can be retrieve from the CKPluginEntry description.

See Also

GetPluginDllCount,CKPluginDll,UnLoadPluginDll,ReLoadPluginDll


CKPluginManager::ReLoadPluginDll

Method CKPluginManager::ReLoadPluginDll

CKERROR CKPluginManager::ReLoadPluginDll(int PluginDllIdx)

Reloads a given plugin DLL.

Parameters

Input argument PluginDllIdx

Index of the plugin DLL to load back.

Remarks

This method is only valid for a plugin DLL that has been previously unloaded with UnLoadPluginDll.

See Also

GetPluginDllCount,GetPluginDllInfo,CKPluginDll,UnLoadPluginDll


CKPluginManager::UnLoadPluginDll

Method CKPluginManager::UnLoadPluginDll

CKERROR CKPluginManager::UnLoadPluginDll(int PluginDllIdx)

Unloads a given plugin DLL.

Parameters

Input argument PluginDllIdx

Index of the plugin DLL to unload.

Remarks

+Unloading a plugin DLL invalidates every plugin that were declared by this DLL which can cause managers, behaviors or readers to be destroyed. +A Plugin DLL can be reload with the ReLoadPluginDll. +This method can be used to manages DLLs that implement the same functionnality at runtime.

See Also

GetPluginDllCount,GetPluginDllInfo,CKPluginDll,ReLoadPluginDll


CKPluginManager::FindComponent

Method CKPluginManager::FindComponent

CKPluginEntry* CKPluginManager::FindComponent(CKGUID Component,int catIdx)

Search for a given GUID amongst the plugins

Parameters

Input argument Component | A CKGUID identifying the plugin to retrieve.
Input argument catIdx | A valid category index (one of CK_PLUGIN_TYPE) or -1 to search all categories of plugins.

Remarks

+This method searches through every plugins for one with the given CKGUID (as given in its CKPluginInfo structure. +This method can be used to search for a behavior plugin given a behavior prototype GUID by setting catIdx to CKPLUGIN_BEHAVIOR_DLL.

See Also

CK_PLUGIN_TYPE,GetPluginCount,CKPluginEntry,CKPluginEntry


CKPluginManager::GetPluginCount

Method CKPluginManager::GetPluginCount

int CKPluginManager::GetPluginCount(int catIdx)

Returns the number of registred plugins in a given category

Parameters

Input argument catIdx

A valid category index (one of CK_PLUGIN_TYPE)

See Also

CK_PLUGIN_TYPE,GetPluginInfo,CKPluginEntry


CKPluginManager::GetPluginInfo

Method CKPluginManager::GetPluginInfo

CKPluginEntry* CKPluginManager::GetPluginInfo(int catIdx, int PluginIdx)

Returns the description of a plugin

Parameters

Input argument catIdx | A valid category index (one of CK_PLUGIN_TYPE)
Input argument PluginIdx | Index of the plugin which description should be returned.

Remarks

To retrieve a plugin from a GUID use FindComponent.

See Also

CK_PLUGIN_TYPE,GetPluginCount,CKPluginEntry,FindComponent


CKPluginManager::GetBitmapReader

Method CKPluginManager::GetBitmapReader

CKBitmapReader *CKPluginManager::GetBitmapReader(CKFileExtension& ext,CKGUID *preferedGUID)

Returns a bitmap reader.

Returns

A pointer to a valid CKBitmapReader if one was found or NULL otherwise.

Remarks

Returns a reader capable of reading file with the given extension ext. It may be several plugins that support the same extension, in which case a preferedGUID identifying the reader that should be returned can be given (optionnal , can be NULL).

See Also

CKBitmapReader,CKFileExtension,GetModelReader,GetMovieReader,GetSoundReader


CKPluginManager::GetModelReader

Method CKPluginManager::GetModelReader

CKModelReader *CKPluginManager::GetModelReader(CKFileExtension& ext,CKGUID *preferedGUID)

Returns a model reader.

Returns

A pointer to a valid CKModelReader if one was found or NULL otherwise.

Remarks

Returns a reader capable of reading file with the given extension ext. It may be several plugins that support the same extension, in which case a preferedGUID identifying the reader that should be returned can be given (optionnal , can be NULL).

See Also

CKModelReader,CKFileExtension,GetSoundReader,GetMovieReader,GetBitmapReader


CKPluginManager::GetMovieReader

Method CKPluginManager::GetMovieReader

CKMovieReader *CKPluginManager::GetMovieReader(CKFileExtension& ext,CKGUID *preferedGUID)

Returns a movie reader.

Returns

A pointer to a valid CKMovieReader if one was found or NULL otherwise.

Remarks

Returns a reader capable of reading file with the given extension ext. It may be several plugins that support the same extension, in which case a preferedGUID identifying the reader that should be returned can be given (optionnal , can be NULL).

See Also

CKMovieReader,CKFileExtension,GetSoundReader,GetModelReader,GetBitmapReader


CKPluginManager::GetSoundReader

Method CKPluginManager::GetSoundReader

CKSoundReader *CKPluginManager::GetSoundReader(CKFileExtension& ext,CKGUID *preferedGUID)

Returns a sound reader.

Returns

A pointer to a valid CKSoundReader if one was found or NULL otherwise.

Remarks

Returns a reader capable of reading file with the given extension ext. It may be several plugins that support the same extension, in which case a preferedGUID identifying the reader that should be returned can be given (optionnal , can be NULL).

See Also

CKSoundReader,CKFileExtension,GetModelReader,GetMovieReader,GetBitmapReader


External Managers classes

External manager plugins

Class CKInputManager

Keyboard,joystick and mouse management.

See Also

Plugins


CKInputManager

Class CKInputManager

Keyboard,joystick and mouse management.

CKBaseManager
Show brief derivation trees

CKInputManager

CKBaseManager
Show full derivation trees

CKInputManager

Remarks

The input manager is here to provide a centralized access to every available input devices. The input manager is not implemented in CK but rather as an external manager that can be replaced.

This class defines methods that every implementation of an input manager should implement so the default Virtools controller behaviors can work.

One can override the default input manager provided with Virtools to support new features simply by creating a new manager deriving from this class.

Groups

Joystick
Pure Virtual Method Method CheckJoystickConnected | (Re)enumerates joysticks connected to the computer to register them into in the input manager.
Pure Virtual Method Method GetJoystickButtonsState | Gets the buttons states of a joystick.
Pure Virtual Method Method GetJoystickCount | Returns the number of joystick registered in the input manager.
Pure Virtual Method Method GetJoystickPointOfViewAngle | Gets a joystick position of its Point of View (if available).
Pure Virtual Method Method GetJoystickPosition | Gets a joystick position.
Pure Virtual Method Method GetJoystickRotation | Gets a joystick rotation on its axis (if available).
Pure Virtual Method Method GetJoystickSliders | Gets the position of a joystick sliders (if available).
Pure Virtual Method Method IsJoystickAttached | Tests if a joystick is attached
Pure Virtual Method Method IsJoystickButtonDown | Tests if a joystick button is down
Keyboard
Pure Virtual Method Method EnableKeyboardRepetition | Enables/Disables keyboard repetition.
Pure Virtual Method Method GetKeyboardState | Retreive the current state of the whole keyboard.
Pure Virtual Method Method GetKeyFromBuffer | Gets a key event from the buffer.
Pure Virtual Method Method GetKeyFromName | Gets a key code from a key name.
Pure Virtual Method Method GetKeyName | Gets the key name
Pure Virtual Method Method GetNumberOfKeyInBuffer | Returns the number of keyboard events in the buffer.
Pure Virtual Method Method IsKeyboardAttached | Tests if a keyboard is attached
Pure Virtual Method Method IsKeyboardRepetitionEnabled | Tests if the keyboard repetition is enabled
Pure Virtual Method Method IsKeyDown | Returns whether a key is down
Pure Virtual Method Method IsKeyToggled | Returns whether a key has been toggled
Pure Virtual Method Method IsKeyUp | Returns whether a key is up
Mouse
Pure Virtual Method Method GetCursorVisibility | Gets the cursor visibility.
Pure Virtual Method Method GetMouseButtonsState | Gets the mouse buttons states.
Pure Virtual Method Method GetMousePosition | Gets the mouse position.
Pure Virtual Method Method GetMouseRelativePosition | Gets the relative position of the mouse.
Pure Virtual Method Method IsMouseAttached | Tests if a mouse is attached.
Pure Virtual Method Method IsMouseButtonDown | Test if a mouse button is down
Pure Virtual Method Method IsMouseClicked | Test if a mouse button has just been clicked
Pure Virtual Method Method IsMouseToggled | Test if a mouse button has just been toggled.
Pure Virtual Method Method ShowCursor | Shows/Hides a cursor.

See Also

CKContext::GetManagerByGuid,


CKInputManager::CheckJoystickConnected

Pure Virtual Method Method CKInputManager::CheckJoystickConnected

virtual void CKInputManager::CheckJoystickConnected()

(Re)enumerates joysticks connected to the computer to register them into in the input manager.

Remarks

This function is called at the input manager creation. It is also called on CKPlay. You can call it at runtime to detect new joystick connected during application is playing.

See Also

GetJoystickCount


CKInputManager::GetJoystickButtonsState

Pure Virtual Method Method CKInputManager::GetJoystickButtonsState

virtual CKDWORD CKInputManager::GetJoystickButtonsState(int iJoystick)

Gets the buttons states of a joystick.

Parameters

Input argument iJoystick

Index of the joystick to test.

Returns

A CKDWORD representing the state of the buttons. If a bit is set, the button at its position is pressed.

See Also

GetJoystickPosition, GetJoystickRotation


CKInputManager::GetJoystickCount

Pure Virtual Method Method CKInputManager::GetJoystickCount

virtual int CKInputManager::GetJoystickCount()

Returns the number of joystick registered in the input manager.

Returns

The number of joystick registered in the input manager (as an integer).

See Also

CheckJoystickConnected


CKInputManager::GetJoystickPointOfViewAngle

Pure Virtual Method Method CKInputManager::GetJoystickPointOfViewAngle

virtual void CKInputManager::GetJoystickPointOfViewAngle(int iJoystick,float* oAngle)

Gets a joystick position of its Point of View (if available).

Parameters

Input argument iJoystick | Index of the joystick to test.
Input argument oAngle | pointer on a float that will be filled with the angle of the Point of View.

See Also

GetJoystickSliders, GetJoystickRotation


CKInputManager::GetJoystickPosition

Pure Virtual Method Method CKInputManager::GetJoystickPosition

virtual void CKInputManager::GetJoystickPosition(int iJoystick,VxVector* oPosition)

Gets a joystick position.

Parameters

Input argument iJoystick | Index of the joystick to test.
Input argument oPosition | pointer on a VxVector that will be filled by the position on the 2 (or 3) joystick axis.

See Also

GetJoystickRotation, GetJoystickSliders


CKInputManager::GetJoystickRotation

Pure Virtual Method Method CKInputManager::GetJoystickRotation

virtual void CKInputManager::GetJoystickRotation(int iJoystick,VxVector* oRotation)

Gets a joystick rotation on its axis (if available).

Parameters

Input argument iJoystick | Index of the joystick to test.
Input argument oRotation | pointer on a VxVector that will be filled by the angle value on the joystick axis (0, 1, 2 or 3 where its available)

See Also

GetJoystickSliders, GetJoystickPosition


CKInputManager::GetJoystickSliders

Pure Virtual Method Method CKInputManager::GetJoystickSliders

virtual void CKInputManager::GetJoystickSliders(int iJoystick,Vx2DVector* oPosition)

Gets the position of a joystick sliders (if available).

Parameters

Input argument iJoystick | Index of the joystick to test.
Input argument oPosition | pointer on Vx2DVector that will be filled with the 2 sliders position (if available)

See Also

GetJoystickRotation, GetJoystickPosition


CKInputManager::IsJoystickAttached

Pure Virtual Method Method CKInputManager::IsJoystickAttached

virtual CKBOOL CKInputManager::IsJoystickAttached(int iJoystick)

Tests if a joystick is attached

Parameters

Input argument iJoystick

Index of the joystick to test.

Returns

TRUE if the given joystick is attached, FALSE otherwise.

See Also

GetJoystickPosition


CKInputManager::IsJoystickButtonDown

Pure Virtual Method Method CKInputManager::IsJoystickButtonDown

virtual CKBOOL CKInputManager::IsJoystickButtonDown(int iJoystick,int iButton)

Tests if a joystick button is down

Parameters

Input argument iJoystick | Index of the joystick to test.
Input argument iButton | index of the button to test.

Returns

TRUE if the button is pressed, FALSE otherwise.

See Also

GetJoystickButtonsState


CKInputManager::EnableKeyboardRepetition

Pure Virtual Method Method CKInputManager::EnableKeyboardRepetition

virtual void CKInputManager::EnableKeyboardRepetition(CKBOOL iEnable = TRUE)

Enables/Disables keyboard repetition.

Parameters

Input argument iEnable

TRUE to enable the keyboard repetition, FALSE to disable it.

See Also

IsKeyboardRepetitionEnabled


CKInputManager::GetKeyboardState

Pure Virtual Method Method CKInputManager::GetKeyboardState

virtual unsigned char* CKInputManager::GetKeyboardState()

Retreive the current state of the whole keyboard.

Returns

An array of 256 chars representing the state of each key. If the high bit of the byte is set, the key is down.

See Also

IsKeyboardAttached


CKInputManager::GetKeyFromBuffer

Pure Virtual Method Method CKInputManager::GetKeyFromBuffer

virtual int CKInputManager::GetKeyFromBuffer(int i, CKDWORD& oKey,CKDWORD* oTimeStamp = NULL)

Gets a key event from the buffer.

Parameters

Input argument i | index in the buffer
Input argument oKey | filled with the key code of the event (in the CKKEYBOARD enumeration)
Input argument oTimeStamp | if the pointer is valid, filled with the time stamp of the event.

Returns

Value | Meaning
KEY_PRESSED | if the key was pressed
KEY_RELEASED | if the key was released
NO_KEY | if the index is irrelevant.

See Also

GetNumberOfKeyInBuffer


CKInputManager::GetKeyFromName

Pure Virtual Method Method CKInputManager::GetKeyFromName

virtual CKDWORD CKInputManager::GetKeyFromName(XString& iKeyName)

Gets a key code from a key name.

Parameters

Input argument iKeyName

Name of the key code to retreive

Returns

Key code (in the CKKEYBOARD enumeration)

See Also

GetKeyName


CKInputManager::GetKeyName

Pure Virtual Method Method CKInputManager::GetKeyName

virtual void CKInputManager::GetKeyName(CKDWORD iKey, XString& oKeyName)

Gets the key name

Parameters

Input argument iKey | The key code we want the name, in the CKKEYBOARD enumeration.
Input argument oKeyName | XString filled with the key name.

See Also

GetKeyFromName


CKInputManager::GetNumberOfKeyInBuffer

Pure Virtual Method Method CKInputManager::GetNumberOfKeyInBuffer

virtual int CKInputManager::GetNumberOfKeyInBuffer()

Returns the number of keyboard events in the buffer.

Returns

The number of events in the buffer.

Remarks

The buffer contains the keyboard events that happened since the last frame.

See Also

GetKeyFromBuffer


CKInputManager::IsKeyboardAttached

Pure Virtual Method Method CKInputManager::IsKeyboardAttached

virtual CKBOOL CKInputManager::IsKeyboardAttached()

Tests if a keyboard is attached

Returns

TRUE if a keyboard is attached, FALSE otherwise.

See Also

GetKeyboardState


CKInputManager::IsKeyboardRepetitionEnabled

Pure Virtual Method Method CKInputManager::IsKeyboardRepetitionEnabled

virtual CKBOOL CKInputManager::IsKeyboardRepetitionEnabled()

Tests if the keyboard repetition is enabled

Returns

TRUE if the keyboard repetion is enabled, FALSE otherwise.

See Also

EnableKeyboardRepetition


CKInputManager::IsKeyDown

Pure Virtual Method Method CKInputManager::IsKeyDown

virtual CKBOOL CKInputManager::IsKeyDown(CKDWORD iKey,CKDWORD* oStamp=NULL)

Returns whether a key is down

Parameters

Input argument iKey | The key code to watch, in the CKKEYBOARD enumeration.
Input argument oStamp | If the pointer is valid, the function fills it with the time stamp when the key was pressed.

Returns

TRUE if the key is down.

See Also

IsKeyUp, IsKeyToggled


CKInputManager::IsKeyToggled

Pure Virtual Method Method CKInputManager::IsKeyToggled

virtual CKBOOL CKInputManager::IsKeyToggled(CKDWORD iKey, CKDWORD* oStamp=NULL)

Returns whether a key has been toggled

Parameters

Input argument iKey | The key code to watch, in the CKKEYBOARD enumeration.
Input argument oStamp | If the pointer is valid, the function fills it with the time stamp when the key was toggled.

Returns

TRUE if the key has been toggled.

See Also

IsKeyDown


CKInputManager::IsKeyUp

Pure Virtual Method Method CKInputManager::IsKeyUp

virtual CKBOOL CKInputManager::IsKeyUp(CKDWORD iKey)

Returns whether a key is up

Parameters

Input argument iKey

The key code to watch, in the CKKEYBOARD enumeration.

Returns

TRUE if the key is up.

See Also

IsKeyDown, IsKeyToggled


CKInputManager::GetCursorVisibility

Pure Virtual Method Method CKInputManager::GetCursorVisibility

virtual BOOL CKInputManager::GetCursorVisibility()

Gets the cursor visibility.

Returns

TRUE if the cursor is visible, FALSE otherwise.

See Also

ShowCursor


CKInputManager::GetMouseButtonsState

Pure Virtual Method Method CKInputManager::GetMouseButtonsState

virtual void CKInputManager::GetMouseButtonsState(CKBYTE oStates[4])

Gets the mouse buttons states.

Parameters

Input argument oStates

Array of 4 bytes that will be filled with the states of the potential 4 mouse buttons.

Remarks

If a button is down, it will have the mask KS_PRESSED. If a button is up, it will have the mask KS_RELEASED.

See Also

IsMouseButtonDown


CKInputManager::GetMousePosition

Pure Virtual Method Method CKInputManager::GetMousePosition

virtual void CKInputManager::GetMousePosition(Vx2DVector& oPosition ,CKBOOL iAbsolute = TRUE)

Gets the mouse position.

Parameters

Input argument oPosition | Vx2DVector containing the position of the mouse.
Input argument iAbsolute | TRUE if you want the position in screen coordinates, FALSE to have it in window coordinates.

See Also

IsKeyboardRepetitionEnabled


CKInputManager::GetMouseRelativePosition

Pure Virtual Method Method CKInputManager::GetMouseRelativePosition

virtual void CKInputManager::GetMouseRelativePosition(VxVector& oPosition)

Gets the relative position of the mouse.

Parameters

Input argument oPosition

VxVector containing the relative position of the mouse.

Remarks

The z component will contains the wheel relative displacement.

See Also

IsKeyboardRepetitionEnabled


CKInputManager::IsMouseAttached

Pure Virtual Method Method CKInputManager::IsMouseAttached

virtual CKBOOL CKInputManager::IsMouseAttached()

Tests if a mouse is attached.

Returns

TRUE if a mouse is attached. FALSE otherwise.

See Also

IsKeyboardRepetitionEnabled


CKInputManager::IsMouseButtonDown

Pure Virtual Method Method CKInputManager::IsMouseButtonDown

virtual CKBOOL CKInputManager::IsMouseButtonDown(CK_MOUSEBUTTON iButton)

Test if a mouse button is down

Parameters

Input argument iButton

Index of the button

Returns

TRUE if the mouse button is down

See Also

IsMouseClicked


CKInputManager::IsMouseClicked

Pure Virtual Method Method CKInputManager::IsMouseClicked

virtual CKBOOL CKInputManager::IsMouseClicked(CK_MOUSEBUTTON iButton)

Test if a mouse button has just been clicked

Parameters

Input argument iButton

Index of the button

Returns

TRUE if the mouse button has been clicked (it was up the previous frame and down now.)

See Also

IsMouseToggled


CKInputManager::IsMouseToggled

Pure Virtual Method Method CKInputManager::IsMouseToggled

virtual CKBOOL CKInputManager::IsMouseToggled(CK_MOUSEBUTTON iButton)

Test if a mouse button has just been toggled.

Parameters

Input argument iButton

Index of the button

Returns

TRUE if the mouse button has been released (it was down the previous frame and up now.)

See Also

IsMouseClicked


CKInputManager::ShowCursor

Pure Virtual Method Method CKInputManager::ShowCursor

virtual void CKInputManager::ShowCursor(BOOL iShow)

Shows/Hides a cursor.

Parameters

Input argument iShow

TRUE to show the cursor, FALSE to hide it.

See Also

GetCursorVisibility


External Readers classes

Media readers related classes

Class CKBitmapProperties | Bitmap readers image description
Class CKBitmapReader | Base class for bitmap readers.
Class CKDataReader | Base class for all reader plugins
Class CKModelReader | Base class for model readers
Class CKMovieProperties | Movie readers image description
Class CKMovieReader | Base class for movie readers.
Class CKSoundReader |

See Also

Plugins


CKBitmapProperties

Class CKBitmapProperties

Bitmap readers image description

Remarks

A Bitmap reader method use this structure to describe images being read or written. It is also used to stored the save options some readers can add. This is done by deriving from the CKBitmapProperties class. For a example of usage of CKBitmapProperties you can refer to the DDSReader sample available in the source code directory.

struct CKBitmapProperties {
    int                 m_Size;         // Size of this structure in byte (should be initialized )
    CKGUID              m_ReaderGuid;   // CKGUID that uniquely identifies the reader that created this properties structure
    CKFileExtension     m_Ext;          // File Extension of the image being described by this structure
    VxImageDescEx       m_Format;       // Optionnal Image format
    void*               m_Data;         // Optionnal Image data pointer
};

Groups

Data Members
Member Variable m_Data | Optionnal Image data pointer
Member Variable m_Extension | File Extension of the image being described by this structure
Member Variable m_Format | Optionnal Image format
Member Variable m_ReaderGuid | CKGUID that uniquely identifies the reader that created this properties structure
Member Variable m_ShortExtension | File Extension of the image being described by this structure
Member Variable m_Size | Size of this structure in byte (should be initialized in constructor in derived classes)

See Also

Creation of Bitmap Media Plugins,CKBitmapReader


CKBitmapProperties::m_Data

Member Variable CKBitmapProperties::m_Data

void* CKBitmapProperties::m_Data

Remarks

Optionnal Image data pointer


CKBitmapProperties::m_Extension

Member Variable CKBitmapProperties::m_Extension

CKFileExtension CKBitmapProperties::m_Extension

Remarks

File Extension of the image being described by this structure


CKBitmapProperties::m_Format

Member Variable CKBitmapProperties::m_Format

VxImageDescEx CKBitmapProperties::m_Format

Remarks

Optionnal Image format


CKBitmapProperties::m_ReaderGuid

Member Variable CKBitmapProperties::m_ReaderGuid

CKGUID CKBitmapProperties::m_ReaderGuid

Remarks

CKGUID that uniquely identifies the reader that created this properties structure


CKBitmapProperties::m_ShortExtension

Member Variable CKBitmapProperties::m_ShortExtension

CKFileExtensionShort CKBitmapProperties::m_ShortExtension

Remarks

File Extension of the image being described by this structure


CKBitmapProperties::m_Size

Member Variable CKBitmapProperties::m_Size

int CKBitmapProperties::m_Size

Remarks

Size of this structure in byte (should be initialized in constructor in derived classes)


CKBitmapReader

Class CKBitmapReader

Base class for bitmap readers.

CKDataReader
Show brief derivation trees

CKBitmapReader

CKDataReader
Show full derivation trees

CKBitmapReader

Remarks

Every bitmap reader must derive from this class. It declares the basic method for loading and saving a bitmap and managing the save options

Groups

Operations
Pure Virtual Method Method GetBitmapDefaultProperties | Returns the current default bitmap options.
Pure Virtual Method Method GetFlags | Returns the reader loading/saving capabilities.
Pure Virtual Method Method GetOptionDescription | Returns a string describing a given option.
Pure Virtual Method Method GetOptionsCount | Returns the number of options.
Pure Virtual Method Method GetReaderInfo | Returns a description of the reader.
Virtual Method Method IsAlphaSaved | Returns if the alpha channel will be saved.
Pure Virtual Method Method ReadASynchronousFile | Not Yet Supported.
Pure Virtual Method Method ReadFile | Loads a bitmap file.
Pure Virtual Method Method ReadMemory | Loads a bitmap file stored in memory.
Virtual Method Method ReadStream | Loads a bitmap file from a VxStream.
Pure Virtual Method Method Release | Destroys the reader.
Pure Virtual Method Method ReleaseMemory | Deletes a block of memory allocated by a previous SaveMemory call.
Pure Virtual Method Method SaveFile | Saves a image to a file
Pure Virtual Method Method SaveMemory | Saves an image into a memory block.
Pure Virtual Method Method SetBitmapDefaultProperties | Sets the current default bitmap options.

See Also

Creation of Bitmap Media Plugins,CKPluginManager::GetBitmapReader


CKBitmapReader::GetBitmapDefaultProperties

Pure Virtual Method Method CKBitmapReader::GetBitmapDefaultProperties

virtual void CKBitmapReader::GetBitmapDefaultProperties(CKBitmapProperties** Bp)

Returns the current default bitmap options.

See Also

SetBitmapDefaultProperties


CKBitmapReader::IsAlphaSaved

Virtual Method Method CKBitmapReader::IsAlphaSaved

virtual CKBOOL CKBitmapReader::IsAlphaSaved(CKBitmapProperties* bp)

Returns if the alpha channel will be saved.

Parameters

Input argument bp

A pointer to CKBitmapProperties containing the desired save format.

Returns

TRUE if format saves the alpha channel.

Remarks

This method returns whether the reader is capable of saving an alpha channel according to the given option in bp.


CKBitmapReader::ReadASynchronousFile

Pure Virtual Method Method CKBitmapReader::ReadASynchronousFile

virtual int CKBitmapReader::ReadASynchronousFile(char* name,CKBitmapProperties**)

Not Yet Supported.


CKBitmapReader::ReadFile

Pure Virtual Method Method CKBitmapReader::ReadFile

virtual int CKBitmapReader::ReadFile(char* name,CKBitmapProperties** ppBitmapProperties)

Loads a bitmap file.

Returns

Returns 0 if successful,an error code (CK_BITMAPREADER_ERROR) otherwise.

Remarks

Reads a file and fill up the ppBitmapProperties with a pointer to the properties of the read image. The name argument is the full path of the file, and can be an URL.

See Also

ReadMemory


CKBitmapReader::ReadMemory

Pure Virtual Method Method CKBitmapReader::ReadMemory

virtual int CKBitmapReader::ReadMemory(void* memory,int size,CKBitmapProperties**)

Loads a bitmap file stored in memory.

Returns

Returns 0 if successful,an error code (CK_BITMAPREADER_ERROR) otherwise.

Remarks

Synchronous Reading from memory

Reads an image from the memory pointer and fill up the ppBitmapProperties with a pointer to the properties of the read image.

See Also

ReadFile


CKBitmapReader::ReadStream

Virtual Method Method CKBitmapReader::ReadStream

virtual int CKBitmapReader::ReadStream(VxStream& iStream,CKBitmapProperties** oBitmapProperties)

Loads a bitmap file from a VxStream.

Returns

Returns 0 if successful,an error code (CK_BITMAPREADER_ERROR) otherwise.

Remarks

Reads an image from the iStream and fill up the ppBitmapProperties with a pointer to the properties of the read image.

See Also

ReadFile


CKBitmapReader::ReleaseMemory

Pure Virtual Method Method CKBitmapReader::ReleaseMemory

virtual void CKBitmapReader::ReleaseMemory(void* memory)

Deletes a block of memory allocated by a previous SaveMemory call.

Remarks

If the compilation options of a reader plugin and the program that actually uses it are not the same it can occur that the new operator used to create the file buffer in SaveMemory is not compatible with the delete operator in the program. For this reason the reader must implement a ReleaseMemory method that actually only calls delete operator on the block of memory it is given.

See Also

SaveMemory


CKBitmapReader::SaveFile

Pure Virtual Method Method CKBitmapReader::SaveFile

virtual int CKBitmapReader::SaveFile(char* name,CKBitmapProperties* pBitmapProperties)

Saves a image to a file

Returns

Returns the number of written bytes if successful.

Remarks

+Saves the image described by pBitmapProperties to the file whose path is name. +A simple implementation of this method can be done using the SaveMemory method and then writing the content of the memory to a file.

See Also

SaveFile


CKBitmapReader::SaveMemory

Pure Virtual Method Method CKBitmapReader::SaveMemory

virtual int CKBitmapReader::SaveMemory(void** memory,CKBitmapProperties* pBitmapProperties)

Saves an image into a memory block.

Returns

Returns the number of written bytes if successful, 0 otherwise.

Remarks

Allocate memory and writes the image corresponding to the pBitmapProperties argument into this memory. The pMemory pointer is filled with a pointer to the newly created memory. This is typically called by Virtools when storing an image inside a Cmo file. When the caller is done with this memory, it must call the ReleaseMemory method, so that the Plugin releases the memory.

See Also

ReleaseMemory,SaveFile


CKBitmapReader::SetBitmapDefaultProperties

Pure Virtual Method Method CKBitmapReader::SetBitmapDefaultProperties

virtual void CKBitmapReader::SetBitmapDefaultProperties(CKBitmapProperties* Bp)

Sets the current default bitmap options.

See Also

GetBitmapDefaultProperties


CKDataReader

Class CKDataReader

Base class for all reader plugins

Subclasses

CKBitmapReader, CKModelReader, CKMovieReader, and CKSoundReader

Remarks

This class declares the common methods used by all reader plugins which are:

Save Options (GetOptionDescription & GetOptionsCount) essentially used by bitmap plugins) Reader Description (GetReaderInfo) Readers loading/saving capabilities (GetFlags)

When done using a reader (normally returned by a call to the CKPluginManager), it must be released by calling its Release() method which will take care of deleting the reader object.

Groups

Operations
Pure Virtual Method Method GetFlags | Returns the reader loading/saving capabilities.
Pure Virtual Method Method GetOptionDescription | Returns a string describing a given option.
Pure Virtual Method Method GetOptionsCount | Returns the number of options.
Pure Virtual Method Method GetReaderInfo | Returns a description of the reader.
Pure Virtual Method Method Release | Destroys the reader.

See Also

Creation of Media Plugins,CKBitmapReader,CKSoundReader,CKMovieReader,CKModelReader


CKDataReader::GetFlags

Pure Virtual Method Method CKDataReader::GetFlags

virtual CK_DATAREADER_FLAGS CKDataReader::GetFlags()

Returns the reader loading/saving capabilities.

Returns

A combination of CK_DATAREADER_FLAGS reader capabilities.

Remarks

A Reader can load or save data from file,memory or an URL. This method returns a combination of CK_DATAREADER_FLAGS which indicates which of these functionnalities are supported.

See Also

CK_DATAREADER_FLAGS


CKDataReader::GetOptionDescription

Pure Virtual Method Method CKDataReader::GetOptionDescription

virtual CKSTRING CKDataReader::GetOptionDescription(int i)

Returns a string describing a given option.

Parameters

Input argument i

Index of option which name string should be returned.

Returns

String description of the i th option.

Remarks

Refer to The Media Options part in the Creation of Bitmap Media Plugins chapter for more details on this method.

See Also

GetOptionsCount,Creation of Bitmap Media Plugins


CKDataReader::GetOptionsCount

Pure Virtual Method Method CKDataReader::GetOptionsCount

virtual int CKDataReader::GetOptionsCount()

Returns the number of options.

Returns

Number of options this reader supports.

Remarks

Refer to The Media Options part in the Creation of Bitmap Media Plugins chapter for more details on this method.

See Also

Creation of Bitmap Media Plugins,GetOptionDescription


CKDataReader::GetReaderInfo

Pure Virtual Method Method CKDataReader::GetReaderInfo

virtual CKPluginInfo* CKDataReader::GetReaderInfo()

Returns a description of the reader.

Returns

A pointer to a CKPluginInfo structure that describes this reader.

See Also

CKPluginInfo


CKDataReader::Release

Pure Virtual Method Method CKDataReader::Release

virtual void CKDataReader::Release()

Destroys the reader.

Remarks

This method is often implemented as delete(this); as it should destroy the reader.


CKModelReader

Class CKModelReader

Base class for model readers

CKDataReader
Show brief derivation trees

CKModelReader

CKDataReader
Show full derivation trees

CKModelReader

Remarks

Only the Load and Save method are used for a model reader

Groups

Operations
Pure Virtual Method Method GetFlags | Returns the reader loading/saving capabilities.
Pure Virtual Method Method GetOptionDescription | Returns a string describing a given option.
Pure Virtual Method Method GetOptionsCount | Returns the number of options.
Pure Virtual Method Method GetReaderInfo | Returns a description of the reader.
Virtual Method Method Load | Loads a model file from a stream.
Pure Virtual Method Method Release | Destroys the reader.
Virtual Method Method Save | Saves a model file.

See Also

Creation of Model Media Plugins,Creation of Media Plugins,CKDataReader,CKPluginManager::GetModelReader


CKModelReader::Load

Virtual Method Method CKModelReader::Load

virtual CKERROR CKModelReader::Load(CKContext* context,CKSTRING FileName,CKObjectArray *liste,CKDWORD LoadFlags,CKCharacter *carac=NULL)
virtual CKERROR CKModelReader::Load(CKContext* context,const void* iBuffer, XDWORD iSize,CKObjectArray *liste,CKDWORD LoadFlags,CKCharacter *carac=NULL)
virtual CKERROR CKModelReader::Load(CKContext* context,VxStream* stream,CKObjectArray *liste,CKDWORD LoadFlags,CKCharacter *carac=NULL)

Loads a model file from a stream.

Parameters

Input argument FileName | Name of the file to load
Input argument iBuffer | pointer on the buffer to parse
Input argument iSize | size of the buffer to parse
Input argument context | A pointer to the CKContext to use to create objects inStream: reference to a VxStream object
Input argument liste | A pointer to a CKObjectArray that will be filled with the loaded objects.
Input argument LoadFlags | A combination of CK_LOAD_FLAGS

Returns

CK_OK if successful, an error code otherwise

See Also

VxStream,Creation of Model Media Plugins


CKModelReader::Save

Virtual Method Method CKModelReader::Save

virtual CKERROR CKModelReader::Save(CKContext* context,CKSTRING FileName,CKObjectArray *liste,CKDWORD SaveFlags)

Saves a model file.

Parameters

Input argument context | A pointer to the CKContext
Input argument FileName | Name of the file to save
Input argument liste | A pointer to a CKObjectArray that contains the objects to save

Returns

CK_OK if successful, an error code otherwise

See Also

Creation of Model Media Plugins


CKMovieProperties

Class CKMovieProperties

Movie readers image description

Remarks

A Movie reader method use this structure to describe images being read or written. It is also used to stored the save options some readers can add. This is done by deriving from the CKMovieProperties class. For a example of usage of CKMovieProperties you can refer to the AVIReader sample available in the source code directory.

struct CKMovieProperties {
    int                 m_Size;         // Size of this structure in byte
    CKGUID              m_ReaderGuid;   // CKGUID that uniquely identifies the reader that created this properties structure
    CKFileExtension     m_Ext;          // File Extension of the image being described by this structure
    VxImageDescEx       m_Format;       // Optionnal Image format
    void*               m_Data;         // Optionnal Image data pointer
};

Groups

Data Members
Member Variable m_Data | Optionnal Image data pointer
Member Variable m_Extension | File Extension of the image being described by this structure
Member Variable m_Format | Optionnal Image format
Member Variable m_ReaderGuid | CKGUID that uniquely identifies the reader that created this properties structure
Member Variable m_ShortExtension | File Extension of the image being described by this structure
Member Variable m_Size | Size of this structure in byte (should be initialized in constructor in derived classes)
Constructors
Method CKMovieProperties | Dtor

See Also

Creation of Movie Media Plugins,CKMovieReader


CKMovieProperties::m_Data

Member Variable CKMovieProperties::m_Data

void* CKMovieProperties::m_Data

Remarks

Optionnal Image data pointer


CKMovieProperties::m_Extension

Member Variable CKMovieProperties::m_Extension

CKFileExtension CKMovieProperties::m_Extension

Remarks

File Extension of the image being described by this structure


CKMovieProperties::m_Format

Member Variable CKMovieProperties::m_Format

VxImageDescEx CKMovieProperties::m_Format

Remarks

Optionnal Image format


CKMovieProperties::m_ReaderGuid

Member Variable CKMovieProperties::m_ReaderGuid

CKGUID CKMovieProperties::m_ReaderGuid

Remarks

CKGUID that uniquely identifies the reader that created this properties structure


CKMovieProperties::m_ShortExtension

Member Variable CKMovieProperties::m_ShortExtension

CKFileExtensionShort CKMovieProperties::m_ShortExtension

Remarks

File Extension of the image being described by this structure


CKMovieProperties::m_Size

Member Variable CKMovieProperties::m_Size

int CKMovieProperties::m_Size

Remarks

Size of this structure in byte (should be initialized in constructor in derived classes)


CKMovieProperties::CKMovieProperties

Method CKMovieProperties::CKMovieProperties

CKMovieProperties::CKMovieProperties()

Remarks

Dtor


CKMovieReader

Class CKMovieReader

Base class for movie readers.

CKDataReader
Show brief derivation trees

CKMovieReader

CKDataReader
Show full derivation trees

CKMovieReader

Remarks

Every movie reader must derive from this class. It declares the basic method for loading a movie Refer to the AVIReader sample available in the source code directory for more details.

Groups

Operations
Pure Virtual Method Method GetFlags | Returns the reader loading/saving capabilities.
Pure Virtual Method Method GetMovieFrameCount | Returns the number of image frames in the movie.
Pure Virtual Method Method GetMovieLength | Returns the length in millseconds of the movie.
Pure Virtual Method Method GetOptionDescription | Returns a string describing a given option.
Pure Virtual Method Method GetOptionsCount | Returns the number of options.
Pure Virtual Method Method GetReaderInfo | Returns a description of the reader.
Pure Virtual Method Method OpenFile | Opens a movie file.
Pure Virtual Method Method ReadFrame | Decode a frame of the movie
Pure Virtual Method Method Release | Destroys the reader.

See Also

Creation of Movie Media Plugins,CKPluginManager::GetMovieReader


CKMovieReader::GetMovieFrameCount

Pure Virtual Method Method CKMovieReader::GetMovieFrameCount

virtual int CKMovieReader::GetMovieFrameCount()

Returns the number of image frames in the movie.

Remarks

A file must have been opened with OpenFile before this method can be used

See Also

OpenFile,GetMovieLength,ReadFrame


CKMovieReader::GetMovieLength

Pure Virtual Method Method CKMovieReader::GetMovieLength

virtual int CKMovieReader::GetMovieLength()

Returns the length in millseconds of the movie.

Remarks

A file must have been opened with OpenFile before this method can be used

See Also

OpenFile,GetMovieFrameCount


CKMovieReader::OpenFile

Pure Virtual Method Method CKMovieReader::OpenFile

virtual CKERROR CKMovieReader::OpenFile(char* name)

Opens a movie file.

Remarks

+Open the file which path is the name argument. +Return 0 (zero) if successful or an CK_MOVIEREADER_ERROR error. +Once the file is opened, images can be read with ReadFrame method

See Also

ReadFrame,GetMovieFrameCount


CKMovieReader::ReadFrame

Pure Virtual Method Method CKMovieReader::ReadFrame

virtual CKERROR CKMovieReader::ReadFrame(int f,CKMovieProperties** ppMovieProperties)

Decode a frame of the movie

Remarks

+Fills up ppMovieProperties with a pointer to a description of an image, which corresponds to the frame number f of the movie. +Returns 0 (zero) if no error. Frame 0 (zero) is the first frame.

See Also

OpenFile,GetMovieLength


CKSoundReader

Class CKSoundReader

CKDataReader
Show brief derivation trees

CKSoundReader

CKDataReader
Show full derivation trees

CKSoundReader

Groups

Data Members
Member Variable m_SubFileMem | Used to keep data in memory when read from VxBigfile files when sound is streamed
Operations
Pure Virtual Method Method Decode |
Pure Virtual Method Method GetDataBuffer |
Pure Virtual Method Method GetDataSize |
Pure Virtual Method Method GetDuration |
Pure Virtual Method Method GetFlags | Returns the reader loading/saving capabilities.
Pure Virtual Method Method GetOptionDescription | Returns a string describing a given option.
Pure Virtual Method Method GetOptionsCount | Returns the number of options.
Pure Virtual Method Method GetReaderInfo | Returns a description of the reader.
Pure Virtual Method Method GetWaveFormat |
Pure Virtual Method Method OpenFile |
Pure Virtual Method Method Pause |
Pure Virtual Method Method Play |
Virtual Method Method ReadMemory |
Pure Virtual Method Method Release | Destroys the reader.
Pure Virtual Method Method Resume |
Pure Virtual Method Method Seek |
Pure Virtual Method Method Stop |


CKSoundReader::m_SubFileMem

Member Variable CKSoundReader::m_SubFileMem

void* CKSoundReader::m_SubFileMem

Remarks

Used to keep data in memory when read from VxBigfile files when sound is streamed


CKSoundReader::Decode

Pure Virtual Method Method CKSoundReader::Decode

virtual CKERROR CKSoundReader::Decode()


CKSoundReader::GetDataBuffer

Pure Virtual Method Method CKSoundReader::GetDataBuffer

virtual CKERROR CKSoundReader::GetDataBuffer(BYTE **buf, int *size)


CKSoundReader::GetDataSize

Pure Virtual Method Method CKSoundReader::GetDataSize

virtual int CKSoundReader::GetDataSize()


CKSoundReader::GetDuration

Pure Virtual Method Method CKSoundReader::GetDuration

virtual int CKSoundReader::GetDuration()


CKSoundReader::GetWaveFormat

Pure Virtual Method Method CKSoundReader::GetWaveFormat

virtual CKERROR CKSoundReader::GetWaveFormat(CKWaveFormat *wfe)


CKSoundReader::OpenFile

Pure Virtual Method Method CKSoundReader::OpenFile

virtual CKERROR CKSoundReader::OpenFile(char *file)


CKSoundReader::Pause

Pure Virtual Method Method CKSoundReader::Pause

virtual CKERROR CKSoundReader::Pause()


CKSoundReader::Play

Pure Virtual Method Method CKSoundReader::Play

virtual CKERROR CKSoundReader::Play()


CKSoundReader::ReadMemory

Virtual Method Method CKSoundReader::ReadMemory

virtual CKERROR CKSoundReader::ReadMemory(void* memory, int size)


CKSoundReader::Resume

Pure Virtual Method Method CKSoundReader::Resume

virtual CKERROR CKSoundReader::Resume()


CKSoundReader::Seek

Pure Virtual Method Method CKSoundReader::Seek

virtual CKERROR CKSoundReader::Seek(int pos)


CKSoundReader::Stop

Pure Virtual Method Method CKSoundReader::Stop

virtual CKERROR CKSoundReader::Stop()


Miscellaneous Classes

Miscellaneous classes

Class CK2dCurve | Class describing curves (Acceleration,percentage curves)
Class CK2dCurvePoint | Class describing curve control point (tangent and TCB parameters )
Class CKBaseManager | Base Class for managers.
Class CKBitmapData | Base class for bitmaps management
Class CKCriticalSectionObject | Class managing a critical section mechanism
Class CKDataArray | Array that contains a collection of data, each column with a unique type of data
Class CKDependencies | Storage of dependencies options.
Class CKDependenciesContext | Storage of dependencies, when performing objects operations like copy, delete, etc.
Class CKFile | CKFile provides functions to save/load files in Virtools format.
Class CKPathManager | Files paths management
Class CKStateChunk | Used to store CK object states
Class CKStateObject | Class managing a global state mechanism
Class CKSynchroObject | Class managing a rendez-vous mechanism
Container classes | CKObjects containers

See Also

Classes


CK2dCurve

Class CK2dCurve

Class describing curves (Acceleration,percentage curves)

Remarks

Important : CK2dCurve DOES NOT derive from CKObject... !

A 2dCurve is a spline defined by an array of control points (CK2dCurvePoint). A property of this curve is that it is injective ( for every X there is one and only one corresponding Y value). This class is usually used to describe acceleration or time variations.

Most of the time this class is used in parameters for behaviors.

Its 3D equivalent is a CKCurve.

Groups

Operations
Method AddControlPoint | Adds a control point.
Method DeleteControlPoint | Removes a control point.
Method GetControlPoint | Returns a specific control point
Method GetControlPointCount | Gets the number of control points
Method GetLength | Returns the total length of the curve.
Method GetPos | Gets the 2D vector corresponding to a given step on the curve
Method GetY | Retrieves the Y value corresponding to a given X value

See Also

CK2dCurvePoint,CKCurve


CK2dCurve::AddControlPoint

Method CK2dCurve::AddControlPoint

void CK2dCurve::AddControlPoint(const Vx2DVector& pos)

Adds a control point.

Parameters

Input argument pos

A Vx2DVector containing the position of the point to create.

Remarks

The x and y components values of the position should be between 0 and 1

See Also

GetControlPoint,GetControlPointCount,RemoveControlPoint


CK2dCurve::DeleteControlPoint

Method CK2dCurve::DeleteControlPoint

void CK2dCurve::DeleteControlPoint(CK2dCurvePoint* cpt)

Removes a control point.

Parameters

Input argument cpt

A pointer to the CK2dCurvePoint to remove

Remarks

To retrieve a specific control point use GetControlPoint.

See Also

GetControlPoint,GetControlPointCount,RemoveControlPoint


CK2dCurve::GetControlPoint

Method CK2dCurve::GetControlPoint

CK2dCurvePoint* CK2dCurve::GetControlPoint(int pos)

Returns a specific control point

Returns

A pointer to the pos th control point in the curve

Remarks

The minimum control point count is 2

See Also

GetControlPointCount


CK2dCurve::GetControlPointCount

Method CK2dCurve::GetControlPointCount

int CK2dCurve::GetControlPointCount()

Gets the number of control points

Returns

The number of control points in the curve

Remarks

The minimum control point count is 2

See Also

GetControlPoint


CK2dCurve::GetLength

Method CK2dCurve::GetLength

float CK2dCurve::GetLength()

Returns the total length of the curve.

Returns

Length of the curve.

See Also

GetY,GetPos


CK2dCurve::GetPos

Method CK2dCurve::GetPos

CKERROR CK2dCurve::GetPos(float step,Vx2DVector *pos)

Gets the 2D vector corresponding to a given step on the curve

Parameters

Input argument step | Float ranging from 0.0 to 1.0, it represents the progression along the curve.
Input argument pos | A pointer to a Vx2dVector that will be filled with the coordinates matching the given step

Returns

Value | Meaning
CK_OK | if the function succeeds
CKERR_INVALIDPARAMETER | if step is invalid

See Also

GetY


CK2dCurve::GetY

Method CK2dCurve::GetY

float CK2dCurve::GetY(float X)

Retrieves the Y value corresponding to a given X value

Parameters

Input argument X

Coordinate on the X axis in the range 0..1

Returns

The Y coordinate corresponding to the X value

See Also

GetPos


CK2dCurvePoint

Class CK2dCurvePoint

Class describing curve control point (tangent and TCB parameters )

Remarks

A Control point describes where a curve should pass and how it should behave at this point. This can be set using incoming and outgoing tangents or using TCB parameters which are tension, continuity and bias.

Groups

Point Flags | Position | Point Tangents | TCB Parameters | Operations | Point tangents

Point Flags
Method IsLinear | Checks whether the next segment of the curve is linear.
Position
Method GetLength | Gets Curve length at this point.
Method GetPosition | Returns the position of this control point.
Method SetPosition | Sets the position of this control point.
Point Tangents
TCB Parameters
Method GetBias | Gets the Bias of the curve at this point.
Method GetContinuity | Gets the Continuity of the curve at this point
Method GetTension | Gets the Tension of the curve at this point
Method SetBias | Sets the Bias of the curve at this point
Method SetContinuity | Sets the Continuity of the curve at this point
Method SetTension | Sets the Tension of the curve at this point
Operations
Method GetCurve | Gets the 2D curve which owns this control point.
Method UseTCB | Uses TCB data or explicit tangents SetBias,SetTension,GetContinuity
Point tangents
Method GetInTangent | Gets the incoming tangents at this control point.
Method GetOutTangent | Gets the outgoing tangents at this control point.
Method SetInTangent | Sets the incoming tangent
Method SetOutTangent | Sets the outgoing tangent

See Also

CK2dCurve


CK2dCurvePoint::IsLinear

Method CK2dCurvePoint::IsLinear

CKBOOL CK2dCurvePoint::IsLinear() const
void CK2dCurvePoint::SetLinear(CKBOOL linear=FALSE)

Checks whether the next segment of the curve is linear.

Parameters

linear: TRUE to have straight line from this point to the next.

Returns

Returns TRUE if the curve will be a straight line to next point.

See Also

UseTCB,SetBias,SetTension,GetContinuity


CK2dCurvePoint::GetLength

Method CK2dCurvePoint::GetLength

float CK2dCurvePoint::GetLength() const

Gets Curve length at this point.

Returns

Length of the curve. Remarks;


CK2dCurvePoint::GetPosition

Method CK2dCurvePoint::GetPosition

Vx2DVector& CK2dCurvePoint::GetPosition()

Returns the position of this control point.

Returns

A reference to the position of this control point.

See Also

SetPosition


CK2dCurvePoint::SetPosition

Method CK2dCurvePoint::SetPosition

void CK2dCurvePoint::SetPosition(const Vx2DVector& pos)

Sets the position of this control point.

Parameters

Input argument pos

A reference to a Vx2DVector that contain the new position of the point.

Remarks

Changing the position of a control point in a curve may change its index in the list of control point of the curve as they are sorted by increasing x values.

See Also

GetPosition


CK2dCurvePoint::GetBias

Method CK2dCurvePoint::GetBias

float CK2dCurvePoint::GetBias() const

Gets the Bias of the curve at this point.

Returns

Bias

See Also

SetBias,SetTension,SetContinuity


CK2dCurvePoint::GetContinuity

Method CK2dCurvePoint::GetContinuity

float CK2dCurvePoint::GetContinuity() const

Gets the Continuity of the curve at this point

Returns

Continuity

See Also

SetBias,SetTension,SetContinuity


CK2dCurvePoint::GetTension

Method CK2dCurvePoint::GetTension

float CK2dCurvePoint::GetTension() const

Gets the Tension of the curve at this point

Returns

Tension

See Also

SetBias,SetTension,SetContinuity


CK2dCurvePoint::SetBias

Method CK2dCurvePoint::SetBias

void CK2dCurvePoint::SetBias(float b)

Sets the Bias of the curve at this point

Parameters

Input argument b

Bias value

See Also

GetBias,SetTension,SetContinuity


CK2dCurvePoint::SetContinuity

Method CK2dCurvePoint::SetContinuity

void CK2dCurvePoint::SetContinuity(float c)

Sets the Continuity of the curve at this point

Parameters

Input argument c

Continuity value

See Also

SetBias,SetTension,GetContinuity


CK2dCurvePoint::SetTension

Method CK2dCurvePoint::SetTension

void CK2dCurvePoint::SetTension(float t)

Sets the Tension of the curve at this point

Parameters

Input argument t

Tension value

See Also

SetBias,GetTension,SetContinuity


CK2dCurvePoint::GetCurve

Method CK2dCurvePoint::GetCurve

CK2dCurve *CK2dCurvePoint::GetCurve() const

Gets the 2D curve which owns this control point.

Returns

A pointer to the CK2dCurve

See Also

CKObject, CK2dCurve


CK2dCurvePoint::UseTCB

Method CK2dCurvePoint::UseTCB

void CK2dCurvePoint::UseTCB(CKBOOL use=TRUE)
CKBOOL CK2dCurvePoint::IsTCB() const

Uses TCB data or explicit tangents SetBias,SetTension,GetContinuity

Parameters

Input argument use

TRUE to force usage of TCB data, FALSE to use tangents.

Remarks

Each curve point has incoming and outgoing tangents. These tangents can be automatically calculated using TCB parameters ( SetTension,SetContinuity,SetBias) or given explicitly through SetInTangent,SetOutTangent

See Also

SetTension,SetContinuity,SetBias,SetInTangent,SetOutTangent


CK2dCurvePoint::GetInTangent

Method CK2dCurvePoint::GetInTangent

Vx2DVector& CK2dCurvePoint::GetInTangent()

Gets the incoming tangents at this control point.

Returns

A reference on the incoming tangent

Remarks

If the control point is using TCB parameters the tangents will be automatically computed by the curve

See Also

GetInTangent,SetOutTangent


CK2dCurvePoint::GetOutTangent

Method CK2dCurvePoint::GetOutTangent

Vx2DVector& CK2dCurvePoint::GetOutTangent()

Gets the outgoing tangents at this control point.

Returns

A reference on the outgoing tangent

Remarks

If the control point is using TCB parameters the tangents will be automatically computed by the curve

See Also

GetInTangent,SetOutTangent


CK2dCurvePoint::SetInTangent

Method CK2dCurvePoint::SetInTangent

void CK2dCurvePoint::SetInTangent(const Vx2DVector& in)

Sets the incoming tangent

Parameters

out:A Vx2DVector describing the incoming

Remarks

If the control point is using TCB parameters the tangents will be automatically computed by the curve

See Also

GetInTangent,GetOutTangent


CK2dCurvePoint::SetOutTangent

Method CK2dCurvePoint::SetOutTangent

void CK2dCurvePoint::SetOutTangent(const Vx2DVector& out)

Sets the outgoing tangent

Parameters

Input argument out

A Vx2DVector describing the outgoing tangent

Remarks

If the control point is using TCB parameters the tangents will be automatically computed by the curve

See Also

GetInTangent,GetOutTangent


CKBaseManager

Class CKBaseManager

Base Class for managers.

Subclasses

CKAttributeManager, CKBehaviorManager, CKCollisionManager, CKFloorManager, CKGridManager, CKInputManager, CKInterfaceManager, CKMessageManager, CKMidiManager, CKObjectManager, CKParameterManager, CKPathManager, CKRenderManager, CKShaderManager, CKSoundManager, CKTimeManager, CKVariableManager, and CKVideoManager

Remarks

This class provides virtual methods that can be override by any managers. Any manager that inherits from CKBaseManager can override function to do some processing.

The instances of managers may be retrieved through the global function CKContext::GetManagerByGuid()

Some default managers implemented in Virtools can be accessed directly : See Managers Access

Groups

Manager Info
Virtual Method Method GetFunctionPriority | Returns the priority of the specified manager function.
Method GetGuid | Acces to Manager GUID
Method GetName | Acces to Manager name
Virtual Method Method GetValidFunctionsMask | Returns list of functions implemented by the manager.
Saving manager data
Virtual Method Method LoadData | Called to load manager data.
Virtual Method Method SaveData | Called to save manager data.
Events
Virtual Method Method OnCKEnd | Called at deletion of a CKContext
Virtual Method Method OnCKInit | Called at the end of the creation of a CKContext.
Virtual Method Method OnCKPause | Called when the process loop is paused.
Virtual Method Method OnCKPlay | Called when the process loop is started .
Virtual Method Method OnCKPostReset | Called after the composition has been restarted.
Virtual Method Method OnCKReset | Called before the composition is reset.
Virtual Method Method OnPostBackToFront | Called after the backbuffer is presented.
Virtual Method Method OnPostCopy | Called at the end of a copy.
Virtual Method Method OnPostFullScreen | Called after switching to/from fullscreen.
Virtual Method Method OnPostRender | Called after the rendering of the 3D objects .
Virtual Method Method OnPostSpriteRender | Called after the rendering of foreground 2D entities.
Virtual Method Method OnPreBackToFront | Called before the backbuffer is presented.
Virtual Method Method OnPreCopy | Called at the beginning of a copy.
Virtual Method Method OnPreFullScreen | Called before switching to/from fullscreen.
Virtual Method Method OnPreRender | Called before the rendering of the 3D objects.
Virtual Method Method OnPreSpriteRender | Called Before the rendering of background 2D entities.
Virtual Method Method OnRasterizerEvent | Called for specific rasterizer events.
Virtual Method Method PostClearAll | Called at the end of a CKContext::ClearAll operation.
Virtual Method Method PostLaunchScene | Called after a scene became active.
Virtual Method Method PostLoad | Called at the end of a load operation.
Virtual Method Method PostProcess | Called at the end of each process loop.
Virtual Method Method PostSave | Called at the end of a save operation.
Virtual Method Method PreClearAll | Called at the beginning of a CKContext::ClearAll operation.
Virtual Method Method PreLaunchScene | Called before a scene becomes active.
Virtual Method Method PreLoad | Called at the beginning of a load operation.
Virtual Method Method PreProcess | Called at the beginning of each process loop.
Virtual Method Method PreSave | Called at the beginning of a save operation.
Virtual Method Method SequenceAddedToScene | Called when objects are added to a scene
Virtual Method Method SequenceDeleted | Called after objects have been deleted.
Virtual Method Method SequenceRemovedFromScene | Called when objects are removed from a scene
Virtual Method Method SequenceToBeDeleted | Called just before objects are deleted.

See Also

CKContext::RegisterNewManager,Implementing a external Manager


CKBaseManager::GetFunctionPriority

Virtual Method Method CKBaseManager::GetFunctionPriority

virtual int CKBaseManager::GetFunctionPriority(CKMANAGER_FUNCTIONS Function)

Returns the priority of the specified manager function.

Returns

A integer giving priority for the specified function.

Remarks

Override this function if you want to specify a priority for one or several functions of your manager. The default implementation returns a priority of 0 for all functions.

Example

To ensure that your PostProcess() function will be one of the first to be called amongst all managers:

           int MyManager::GetFunctionPriority(CKMANAGER_FUNCTIONS Function)
           {
               if (Function==CKMANAGER_FUNC_PostProcess) return 10000; // High Priority
               return 0;
           }

See Also

CKMANAGER_FUNCTIONS


CKBaseManager::GetGuid

Method CKBaseManager::GetGuid

CKGUID CKBaseManager::GetGuid()

Acces to Manager GUID

Returns

CKGUID of this manager.

Remarks

Each Manager is given an unique GUID. When creating a new manager it should assign itself a GUID and name before registering itsef.

CKAttributeManager::CKAttributeManager(CKContext *Context):CKBaseManager(Context,ATTRIBUTE_MANAGER_GUID,"Attribute Manager")
{
    ....
    ....
    Context->RegisterNewManager(this);
}

See Also

CKContext::RegisterNewManager,GetName


CKBaseManager::GetName

Method CKBaseManager::GetName

CKSTRING CKBaseManager::GetName()

Acces to Manager name

Returns

Name of this manager.

Remarks

Each Manager can be given a name. When creating a new manager it should assign itself a GUID and name before registering itsef.

CKAttributeManager::CKAttributeManager(CKContext *Context):CKBaseManager(Context,ATTRIBUTE_MANAGER_GUID,"Attribute Manager")
{
    ....
    ....
    Context->RegisterNewManager(this);
}

See Also

CKContext::RegisterNewManager,GetGuid


CKBaseManager::GetValidFunctionsMask

Virtual Method Method CKBaseManager::GetValidFunctionsMask

virtual CKDWORD CKBaseManager::GetValidFunctionsMask()

Returns list of functions implemented by the manager.

Returns

A combination of CKMANAGER_FUNCTIONS. Remarks. You must override this function to indicate which functions your manager implements.

Example

The attribute manager implements four CKBaseManager functions :PreClearAll,PostLoad,OnSequenceAddedToscene
and OnSequenceRemovedFromScene so its GetValidFunctionsMask looks like this:

           virtual CKDWORD GetValidFunctionsMask() { return CKMANAGER_FUNC_PreClearAll             |
                                                       CKMANAGER_FUNC_PostLoad             |
                                                       CKMANAGER_FUNC_OnSequenceAddedToScene  |
                                                       CKMANAGER_FUNC_OnSequenceRemovedFromScene;   }

See Also

CKMANAGER_FUNCTIONS


CKBaseManager::LoadData

Virtual Method Method CKBaseManager::LoadData

virtual CKERROR CKBaseManager::LoadData(CKStateChunk *chunk,CKFile* LoadedFile)

Called to load manager data.

Parameters

Input argument chunk | A pointer to a CKStateChunk that was saved in the file.
Input argument LoadedFile | A pointer to the CKFile being loaded.

Returns

CK_OK if successful or an error code otherwise.

Remarks

During a load operation, each manager is automatically called if there was a chunk saved in the file with SaveData.

See Also

CKStateChunk,SaveData


CKBaseManager::SaveData

Virtual Method Method CKBaseManager::SaveData

virtual CKStateChunk* CKBaseManager::SaveData(CKFile* SavedFile)

Called to save manager data.

Parameters

Input argument SavedFile

A pointer to the CKFile being saved.

Returns

This function should return a valid CKStateChunk that contain data to save or NULL if there is nothing to save.

Remarks

During a save operation, each manager is given the opportunity to save its data in the file. The file being saved is given for information only and must not be modified. It can be used to decide whether it is worth saving data for your manager.

See Also

CKStateChunk,LoadData


CKBaseManager::OnCKEnd

Virtual Method Method CKBaseManager::OnCKEnd

virtual CKERROR CKBaseManager::OnCKEnd()

Called at deletion of a CKContext

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function if you need to clean up things at the end of the session. This method is called at the beginning of the deletion of the CKContext, the manager is also deleted a short time after. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnCKEnd for this function to get called.

See Also

Main Virtools Events,OnCKInit,CKCloseContext


CKBaseManager::OnCKInit

Virtual Method Method CKBaseManager::OnCKInit

virtual CKERROR CKBaseManager::OnCKInit()

Called at the end of the creation of a CKContext.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function if you need to add specific processing at initialization. If your manager is registered after the context has been created and if it implements the OnCKInit() function then, this function will be called upon registration. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnCKInit for this function to get called.

See Also

Main Virtools Events,OnCKEnd,CKCreateContext


CKBaseManager::OnCKPause

Virtual Method Method CKBaseManager::OnCKPause

virtual CKERROR CKBaseManager::OnCKPause()

Called when the process loop is paused.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnCKPause for this function to get called.

See Also

Main Virtools Events,CKContext::Reset,OnCKReset,OnCKPostReset,OnCKPlay.


CKBaseManager::OnCKPlay

Virtual Method Method CKBaseManager::OnCKPlay

virtual CKERROR CKBaseManager::OnCKPlay()

Called when the process loop is started .

Returns

CK_OK if successful or an error code otherwise.

Remarks

You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnCKPlay for this function to get called.

See Also

Main Virtools Events,CKContext::Reset,OnCKReset,OnCKPostReset,OnCKPause.


CKBaseManager::OnCKPostReset

Virtual Method Method CKBaseManager::OnCKPostReset

virtual CKERROR CKBaseManager::OnCKPostReset()

Called after the composition has been restarted.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnCKPostReset for this function to get called.

See Also

Main Virtools Events ,CKContext::Reset,OnCKReset,OnCKPause,OnCKPlay.


CKBaseManager::OnCKReset

Virtual Method Method CKBaseManager::OnCKReset

virtual CKERROR CKBaseManager::OnCKReset()

Called before the composition is reset.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnCKReset for this function to get called.

See Also

Main Virtools Events,CKContext::Reset,OnCKPostReset,OnCKPause,OnCKPlay.


CKBaseManager::OnPostBackToFront

Virtual Method Method CKBaseManager::OnPostBackToFront

virtual CKERROR CKBaseManager::OnPostBackToFront(CKRenderContext* dev)

Called after the backbuffer is presented.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing after the backbuffer is presented. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPostBackToFront for this function to get called.

See Also

OnPreBackToFront,CKRenderContext::Render,Understanding the Render Loop,GetValidFunctionsMask


CKBaseManager::OnPostCopy

Virtual Method Method CKBaseManager::OnPostCopy

virtual CKERROR CKBaseManager::OnPostCopy(CKDependenciesContext& context)

Called at the end of a copy.

Parameters

Input argument context

A CKDependenciesContext containing the objects being copied.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the beginning of a copy operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPostCopy for this function to get called.

See Also

Main Virtools Events,OnPreCopy,CKContext::CopyObjects


CKBaseManager::OnPostFullScreen

Virtual Method Method CKBaseManager::OnPostFullScreen

virtual CKERROR CKBaseManager::OnPostFullScreen(BOOL Going2Fullscreen,CKRenderContext* dev)

Called after switching to/from fullscreen.

Parameters

Input argument Going2Fullscreen | TRUE if we are going to fullscreen , FALSE if returning to windowed mode.
Input argument dev | A Pointer to the CKRenderContext that has just changed of video mode.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing after a context switch to/from fullscreen. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPostFullScreen for this function to get called.

See Also

OnPreBackToFront,CKRenderContext::Render,Understanding the Render Loop,GetValidFunctionsMask


CKBaseManager::OnPostRender

Virtual Method Method CKBaseManager::OnPostRender

virtual CKERROR CKBaseManager::OnPostRender(CKRenderContext* dev)

Called after the rendering of the 3D objects .

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing after the rendering of the 3D scene occured. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPostRender for this function to get called.

See Also

OnPreRender,OnPostSpriteRender,CKRenderContext::Render,Understanding the Render Loop


CKBaseManager::OnPostSpriteRender

Virtual Method Method CKBaseManager::OnPostSpriteRender

virtual CKERROR CKBaseManager::OnPostSpriteRender(CKRenderContext* dev)

Called after the rendering of foreground 2D entities.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing after the rendering of the foreground 2D entities occured. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPostSpriteRender for this function to get called.

See Also

OnPostRender,OnPreRender,CKRenderContext::Render,Understanding the Render Loop


CKBaseManager::OnPreBackToFront

Virtual Method Method CKBaseManager::OnPreBackToFront

virtual CKERROR CKBaseManager::OnPreBackToFront(CKRenderContext* dev)

Called before the backbuffer is presented.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing before the backbuffer is presented. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPreBackToFront for this function to get called.

See Also

OnPostBackToFront,CKRenderContext::Render,Understanding the Render Loop,GetValidFunctionsMask


CKBaseManager::OnPreCopy

Virtual Method Method CKBaseManager::OnPreCopy

virtual CKERROR CKBaseManager::OnPreCopy(CKDependenciesContext& context)

Called at the beginning of a copy.

Parameters

Input argument context

A CKDependenciesContext containing the objects being copied.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the beginning of a copy operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPreCopy for this function to get called.

See Also

Main Virtools Events,OnPostCopy,CKContext::CopyObjects


CKBaseManager::OnPreFullScreen

Virtual Method Method CKBaseManager::OnPreFullScreen

virtual CKERROR CKBaseManager::OnPreFullScreen(BOOL Going2Fullscreen, CKRenderContext* dev)

Called before switching to/from fullscreen.

Parameters

Input argument Going2Fullscreen | TRUE if we are going to fullscreen , FALSE if returning to windowed mode.
Input argument dev | A Pointer to the CKRenderContext that is currently changing mode.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing before a context switch to/from fullscreen. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPreFullScreen for this function to get called.

See Also

OnPreBackToFront,CKRenderContext::Render,Understanding the Render Loop,GetValidFunctionsMask


CKBaseManager::OnPreRender

Virtual Method Method CKBaseManager::OnPreRender

virtual CKERROR CKBaseManager::OnPreRender(CKRenderContext* dev)

Called before the rendering of the 3D objects.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing before the rendering of the scene occured. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPreRender for this function to get called.

See Also

OnPostRender,OnPostSpriteRender,CKRenderContext::Render,Understanding the Render Loop


CKBaseManager::OnPreSpriteRender

Virtual Method Method CKBaseManager::OnPreSpriteRender

virtual CKERROR CKBaseManager::OnPreSpriteRender(CKRenderContext* dev)

Called Before the rendering of background 2D entities.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing before the rendering of the background 2D entities occured. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnPostSpriteRender for this function to get called.

See Also

OnPostRender,OnPreRender,CKRenderContext::Render,Understanding the Render Loop


CKBaseManager::OnRasterizerEvent

Virtual Method Method CKBaseManager::OnRasterizerEvent

virtual CKERROR CKBaseManager::OnRasterizerEvent(CKRST_EVENTS Event,CKRenderContext* dev)

Called for specific rasterizer events.

Parameters

Input argument Event | Event that was sent by the rasterizer.
Input argument dev | A Pointer to the CKRenderContext that has just changed of video mode.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing when a render context is created/destroyed or resized. According to implementation (DirectX , OpenGL,etc.) some events can occur such as LostDevice with DirectX that you might need to handle when directly using DirectX objects in a manager. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnRasterizerEvent for this function to get called.

See Also

CKRenderContext::Render,Understanding the Render Loop,GetValidFunctionsMask


CKBaseManager::PostClearAll

Virtual Method Method CKBaseManager::PostClearAll

virtual CKERROR CKBaseManager::PostClearAll()

Called at the end of a CKContext::ClearAll operation.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the end of a CKContext::ClearAll operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PostClearAll for this function to get called.

See Also

Main Virtools Events,PreClearAll,CKContext::ClearAll,


CKBaseManager::PostLaunchScene

Virtual Method Method CKBaseManager::PostLaunchScene

virtual CKERROR CKBaseManager::PostLaunchScene(CKScene* OldScene,CKScene* NewScene)

Called after a scene became active.

Parameters

Input argument OldScene | Previous active scene.
Input argument NewScene | Scene that have been activated.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override these functions to add specific processing at the beginning and at the end of a LaunchScene operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PostLaunchScene for this function to get called.

See Also

Main Virtools Events,PreLaunchScene


CKBaseManager::PostLoad

Virtual Method Method CKBaseManager::PostLoad

virtual CKERROR CKBaseManager::PostLoad()

Called at the end of a load operation.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the end of a load operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PostLoad for this function to get called.

See Also

Main Virtools Events,PreSave,PostSave,PreLoad,CKContext::Load


CKBaseManager::PostProcess

Virtual Method Method CKBaseManager::PostProcess

virtual CKERROR CKBaseManager::PostProcess()

Called at the end of each process loop.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the end of a CKContext::Process operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PostProcess for this function to get called.

See Also

Main Virtools Events,PreProcess,CKContext::Process,


CKBaseManager::PostSave

Virtual Method Method CKBaseManager::PostSave

virtual CKERROR CKBaseManager::PostSave()

Called at the end of a save operation.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the end of a save operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PostSave for this function to get called.

See Also

Main Virtools Events,PreSave,PostSave,PreLoad,CKContext::Load


CKBaseManager::PreClearAll

Virtual Method Method CKBaseManager::PreClearAll

virtual CKERROR CKBaseManager::PreClearAll()

Called at the beginning of a CKContext::ClearAll operation.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the beginning of a CKContext::ClearAll operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PreClearAll for this function to get called.

See Also

Main Virtools Events,PostClearAll,CKContext::ClearAll


CKBaseManager::PreLaunchScene

Virtual Method Method CKBaseManager::PreLaunchScene

virtual CKERROR CKBaseManager::PreLaunchScene(CKScene* OldScene,CKScene* NewScene)

Called before a scene becomes active.

Parameters

Input argument OldScene | Previous active scene.
Input argument NewScene | Scene to become active.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override these functions to add specific processing at the beginning and at the end of a LaunchScene operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PreLaunchScene for this function to get called.

See Also

Main Virtools Events,PostLaunchScene,


CKBaseManager::PreLoad

Virtual Method Method CKBaseManager::PreLoad

virtual CKERROR CKBaseManager::PreLoad()

Called at the beginning of a load operation.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the beginning of a load operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PreLoad for this function to get called.

See Also

Main Virtools Events,PreSave,PostSave,PostLoad,CKContext::Load


CKBaseManager::PreProcess

Virtual Method Method CKBaseManager::PreProcess

virtual CKERROR CKBaseManager::PreProcess()

Called at the beginning of each process loop.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the beginning of a CKContext::Process operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PreProcess for this function to get called.

See Also

Main Virtools Events,PostProcess,CKContext::Process,


CKBaseManager::PreSave

Virtual Method Method CKBaseManager::PreSave

virtual CKERROR CKBaseManager::PreSave()

Called at the beginning of a save operation.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function to add specific processing at the beginning of a save operation. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_PreSave for this function to get called.

See Also

Main Virtools Events,PreSave,PostSave,PreLoad,CKContext::Load


CKBaseManager::SequenceAddedToScene

Virtual Method Method CKBaseManager::SequenceAddedToScene

virtual CKERROR CKBaseManager::SequenceAddedToScene(CKScene *scn,CK_ID *objids,int count)

Called when objects are added to a scene

Parameters

Input argument scn | A pointer to the CKScene to which objects where added.
Input argument objids | A pointer to a list of CK_ID of the objects being added to the scene.
Input argument count | number of objects in objids list.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override these functions to add specific processing when adding or removing objects from scene You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnSequenceAddedToScene for this function to get called.

See Also

Main Virtools Events,SequenceRemovedFromScene


CKBaseManager::SequenceDeleted

Virtual Method Method CKBaseManager::SequenceDeleted

virtual CKERROR CKBaseManager::SequenceDeleted(CK_ID *objids,int count)

Called after objects have been deleted.

Parameters

Input argument objids | A pointer to a list of CK_ID of the objects being deleted.
Input argument count | number of objects in objids list.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function if you need to add specific processing after objects have been deleted. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnSequenceDeleted for this function to get called.

See Also

Main Virtools Events,CKContext::DestroyObjects,SequenceToBeDeleted


CKBaseManager::SequenceRemovedFromScene

Virtual Method Method CKBaseManager::SequenceRemovedFromScene

virtual CKERROR CKBaseManager::SequenceRemovedFromScene(CKScene *scn,CK_ID *objids,int count)

Called when objects are removed from a scene

Parameters

Input argument scn | A pointer to the CKScene to which objects where added.
Input argument objids | A pointer to a list of CK_ID of the objects being added to the scene.
Input argument count | number of objects in objids list.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override these functions to add specific processing when adding or removing objects from scene You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnSequenceRemovedFromScene for this function to get called.

See Also

Main Virtools Events,SequenceAddedToScene,


CKBaseManager::SequenceToBeDeleted

Virtual Method Method CKBaseManager::SequenceToBeDeleted

virtual CKERROR CKBaseManager::SequenceToBeDeleted(CK_ID *objids,int count)

Called just before objects are deleted.

Parameters

Input argument objids | A pointer to a list of CK_ID of the objects being deleted.
Input argument count | number of objects in objids list.

Returns

CK_OK if successful or an error code otherwise.

Remarks

You can override this function if you need to add specific processing before objects are deleted. You must override GetValidFunctionsMask and return a value including CKMANAGER_FUNC_OnSequenceToBeDeleted for this function to get called.

See Also

Main Virtools Events,CKContext::DestroyObjects,SequenceDeleted


CKBitmapData

Class CKBitmapData

Base class for bitmaps management

Subclasses

CKTexture

Remarks

CKBitmapData is used as a base class for CKTexture and is used as an aggregate in CKSprite class since they share the same functionnalities.

This class provides the base methods for loading/saving bitmaps or movies.

Surface Data can be retrieve with the GetPixel or LockSurfacePtr function

Information is also given about pixel format but in the current implementation images are always stored in 32 bit per pixel.

These bitmaps can be flagged as transparent using a specific transparency color.

The class also provides methods to set the way bitmaps should be store inside compositions files.

The image and movie loading functions are not documented in this base class but in the CKTexture and CKSprite documentation: CKTexture::LoadImage and CKSprite::LoadImage

Groups

Creation | Slots | Bitmap Storage Info | Movie | Surface data access | Bitmap storage info | Cube Map | Save Options | System Caching | Transparency | Video memory management | Volume Map

Creation
Method CreateImage | Creates an empty image.
Method ResizeImages | Resizes all slots.
Method SaveImage | Saves an image slot to a file.
Method SaveImageAlpha | Saves an image alpha channel slot to a file.
Slots
Method GetCurrentSlot | Returns current slot index.
Method GetSlotCount | Returns the number of slot (images) in this bitmap.
Method GetSlotFileName | Returns the name of the file used to load a bitmap slot.
Method ReleaseAllSlots | Deletes all the images.
Method ReleaseSlot | Removes an image.
Method SetCurrentSlot | Sets the current active image.
Method SetSlotCount | Sets the number of slot (images) in this bitmap.
Method SetSlotFileName | Sets the name of the file used to load a bitmap slot.
Bitmap Storage Info
Movie
Method GetMovieFileName | Returns the name of the movie file used by this bitmap.
Method GetMovieReader | Returns the movie reader used to decompress the current movie.
Surface data access
Method FlushSurfacePtr | Flush a slot system memory
Method GetPixel | Gets the color of a pixel.
Method HasOriginalFile | tells if the bitmap can be restored from the original file
Method LockSurfacePtr | Returns a pointer to the image surface buffer.
Method ReleaseSurfacePtr | Marks a slot as modified.
Method SetPixel | Sets the color of a pixel.
Bitmap storage info
Method GetHeight | Gets the image height
Method GetImageDesc | Gets Image format description
Method GetWidth | Gets the image width
Cube Map
Method SetCubeMap | Setup the bitmap to store a cubemap
Save Options
Method SetSaveFormat | Sets the saving format.
Method SetSaveOptions | Sets the saving options.
System Caching
Method SetSystemCaching | Sets the system memory caching option.
Transparency
Method GetTransparentColor | Returns the transparent color.
Method IsTransparent | Returns whether color keyed transparency is enabled.
Method SetPickThreshold | Sets pick threshold value.
Method SetTransparent | Enables or disables the color key transparency.
Method SetTransparentColor | Sets the transparent color.
Video memory management
Method AuthorizeConditionalNonPow2 | Do we authorize to create the video texture with a non power of two size
Method GetDesiredVideoFormat | Returns the desired pixel format in video memory.
Method SetDesiredVideoFormat | Sets the desired surface pixel format in video memory.
Method SetDynamicHint | Sets a hint to indicate the bitmap is changed frequently.
Volume Map
Method SetVolumeMap | Setup the bitmap to store a volume map

See Also

CKTexture,CKSprite


CKBitmapData::CreateImage

Method CKBitmapData::CreateImage

CKBOOL CKBitmapData::CreateImage(int Width,int Height,int BPP=32,int Slot=0,void* ImagePointer = NULL)

Creates an empty image.

Parameters

Input argument Width | width in pixel of the bitmap to create
Input argument Height | height in pixel of the bitmap to create
Input argument BPP | Bit per pixel of the bitmap
Input argument Slot | If there a multiple images, index of the image slot to create.
Input argument ImagePointer | You can provide a image pointer that will be used instead of allocating it in CKBitmap Data. The pointer must NOT be deleted afterwards and will be deleted by CKBitmapData when the slot is deleted. If the system caching mode is CKBITMAP_PROCEDURAL (See SetSystemCaching) the image pointer must be a 32 bit ARGB image allocated with the correct Width and Height. Otherwise if the system caching mode is CKBITMAP_VIDEOSHADOW or CKBITMAP_DISCARD the image data must be in the same format than video memory pixel format.

Returns

TRUE if successful, FALSE otherwise.

Remarks

The bitmap data is initialized to black with full alpha (all colors to 0xFF000000) The name for the created slot is set to “” If there was already some slots created but with a different width or height the method returns FALSE.

See Also

SaveImage,


CKBitmapData::ResizeImages

Method CKBitmapData::ResizeImages

CKBOOL CKBitmapData::ResizeImages(int Width,int Height)

Resizes all slots.

Parameters

Input argument Width | new width in pixel
Input argument Height | new height in pixel

Returns

TRUE if successful, FALSE otherwise.

Remarks

This method resize every images to the given size.

See Also

CreateImage


CKBitmapData::SaveImage

Method CKBitmapData::SaveImage

CKBOOL CKBitmapData::SaveImage(CKSTRING Name,int Slot=0,CKBOOL CKUseFormat=FALSE)
CKBOOL CKBitmapData::SaveImage(CKSTRING Name,int Slot,BOOL CKUseFormat)

Saves an image slot to a file.

Returns

TRUE if successful, FALSE otherwise.

Remarks

The image format depends on the image readers installed. The default available readers support BMP,TGA,JPG,PNG and GIF format

See Also

CreateImage,CKBitmapReader


CKBitmapData::SaveImageAlpha

Method CKBitmapData::SaveImageAlpha

CKBOOL CKBitmapData::SaveImageAlpha(CKSTRING Name,int Slot=0)

Saves an image alpha channel slot to a file.

Returns

TRUE if successful.

Remarks

The image format depends on the image readers installed. The default available readers support BMP,TGA,JPG,PNG and GIF format

See Also

CreateImage,CKBitmapReader


CKBitmapData::GetCurrentSlot

Method CKBitmapData::GetCurrentSlot

int CKBitmapData::GetCurrentSlot()

Returns current slot index.

Returns

Current image slot index.

See Also

GetSlotCount,SetSlotCount,SetCurrentSlot


CKBitmapData::GetSlotCount

Method CKBitmapData::GetSlotCount

int CKBitmapData::GetSlotCount()

Returns the number of slot (images) in this bitmap.

Returns

Number of images.

See Also

SetSlotCount,GetCurrentSlot,SetCurrentSlot


CKBitmapData::GetSlotFileName

Method CKBitmapData::GetSlotFileName

CKSTRING CKBitmapData::GetSlotFileName(int Slot)

Returns the name of the file used to load a bitmap slot.

Parameters

slot: image slot index

Returns

A pointer to the name of the file which was used to load this bitmap slot

See Also

SetSlotFileName


CKBitmapData::ReleaseAllSlots

Method CKBitmapData::ReleaseAllSlots

CKBOOL CKBitmapData::ReleaseAllSlots()

Deletes all the images.

Returns

TRUE if successful.

See Also

GetSlotCount,GetCurrentSlot,SetCurrentSlot


CKBitmapData::ReleaseSlot

Method CKBitmapData::ReleaseSlot

CKBOOL CKBitmapData::ReleaseSlot(int Slot)

Removes an image.

Parameters

Input argument Slot

Index of the image to remove.

Returns

TRUE if successful, FALSE if the slot does not exist or the bitmap is a movie.

See Also

GetSlotCount,GetCurrentSlot,SetCurrentSlot


CKBitmapData::SetCurrentSlot

Method CKBitmapData::SetCurrentSlot

CKBOOL CKBitmapData::SetCurrentSlot(int Slot)

Sets the current active image.

Parameters

Input argument Slot

Image slot index.

Returns

TRUE if successful, FALSE otherwise.

See Also

GetSlotCount,SetSlotCount,GetCurrentSlot


CKBitmapData::SetSlotCount

Method CKBitmapData::SetSlotCount

CKBOOL CKBitmapData::SetSlotCount(int Count)

Sets the number of slot (images) in this bitmap.

Parameters

Input argument Count

Image slots to allocate.

Returns

TRUE if successful, FALSE otherwise.

See Also

GetSlotCount,GetCurrentSlot,SetCurrentSlot


CKBitmapData::SetSlotFileName

Method CKBitmapData::SetSlotFileName

CKBOOL CKBitmapData::SetSlotFileName(int Slot,CKSTRING Filename)

Sets the name of the file used to load a bitmap slot.

Parameters

Input argument Slot | image slot index
Input argument Filename | image slot file name

Returns

TRUE if successful, FALSE otherwise.

See Also

GetSlotFileName


CKBitmapData::GetMovieFileName

Method CKBitmapData::GetMovieFileName

CKSTRING CKBitmapData::GetMovieFileName()

Returns the name of the movie file used by this bitmap.

Returns

A pointer to the name of the file which was used to load this bitmap or NULL if this bitmap is not a movie.

See Also

CKTexture::LoadMovie,CKSprite::LoadMovie,GetMovieReader


CKBitmapData::GetMovieReader

Method CKBitmapData::GetMovieReader

CKMovieReader* CKBitmapData::GetMovieReader()

Returns the movie reader used to decompress the current movie.

Returns

Pointer to CKMovieReader

Remarks

This method returns a movie reader if one is present,NULL otherwise.

See Also

CKTexture::LoadMovie,CKSprite::LoadMovie,GetMovieFileName,CKMovieReader


CKBitmapData::FlushSurfacePtr

Method CKBitmapData::FlushSurfacePtr

CKBOOL CKBitmapData::FlushSurfacePtr(int Slot=-1)

Flush a slot system memory

Parameters

Input argument Slot

In a multi-images bitmap, number of the image slot to mark as invalid.

Remarks

This method frees the memory allocated in system memory for a given bitmap slot.

See Also

LockSurfacePtr,SetPixel


CKBitmapData::GetPixel

Method CKBitmapData::GetPixel

CKDWORD CKBitmapData::GetPixel(int x,int y,int slot=-1)

Gets the color of a pixel.

Parameters

Input argument x | X position of the pixel to set the color of.
Input argument y | Y position of the pixel to set the color of.
Input argument slot | Index of the slot in which the pixel should be get or -1 for the current slot.

Returns

Color of the pixel (32 bit ARGB)

Remarks

There is no check on the validity of x or y parameter so its the user responsability.

See Also

LockSurfacePtr,SetPixel


CKBitmapData::HasOriginalFile

Method CKBitmapData::HasOriginalFile

CKBOOL CKBitmapData::HasOriginalFile()

tells if the bitmap can be restored from the original file

Returns

TRUE if it can.


CKBitmapData::LockSurfacePtr

Method CKBitmapData::LockSurfacePtr

CKBYTE *CKBitmapData::LockSurfacePtr(int Slot=-1)

Returns a pointer to the image surface buffer.

Parameters

Input argument Slot

In a multi-images texture, index of the image slot to get surface pointer of. -1 means the current active slot.

Returns

A valid pointer to the texture buffer or NULL if failed.

Remarks

When dealing with textures or sprites the return value is a pointer on the system memory copy of the texture. If any changes are made (write access) to the image surface, you must either call CKTexture::Restore which immediatly copies the texture back in video memory or ReleaseSurfacePtr() which flags this bitmap as to be reloaded before it is used next time.

See Also

ReleaseSurfacePtr,SetPixel,GetPixel


CKBitmapData::ReleaseSurfacePtr

Method CKBitmapData::ReleaseSurfacePtr

CKBOOL CKBitmapData::ReleaseSurfacePtr(int Slot=-1)

Marks a slot as modified.

Parameters

Input argument Slot

In a multi-images bitmap, number of the image slot to mark as invalid.

Returns

TRUE if successful.

Remarks

When changes are made to the bitmap data (using LockSurfacePtr or SetPixel) this method marks the changed slot so that they can reloaded in video memory when necessary (for textures and sprites).

See Also

LockSurfacePtr,SetPixel


CKBitmapData::SetPixel

Method CKBitmapData::SetPixel

CKBOOL CKBitmapData::SetPixel(int x,int y,CKDWORD col,int slot=-1)

Sets the color of a pixel.

Parameters

Input argument x | X position of the pixel to set the color of.
Input argument y | Y position of the pixel to set the color of.
Input argument col | A Dword ARGB color to set
Input argument slot | Index of the slot in which the pixel should be set or -1 for the current slot.

Returns

TRUE if successful.

Remarks

There is no check on the validity of x or y parameters so its the user responsability. Sets the color of a pixel in the copy of the texture in system memory. If this is used on a texture changes will only be visible after using CKTexture::Restore() function to force the texture to re-load from system memory.

See Also

LockSurfacePtr,GetPixel,ReleaseSurfacePtr


CKBitmapData::GetHeight

Method CKBitmapData::GetHeight

int CKBitmapData::GetHeight()

Gets the image height

Returns

Image height

See Also

GetBytesPerLine,GetWidth,GetBitsPerPixel


CKBitmapData::GetImageDesc

Method CKBitmapData::GetImageDesc

CKBOOL CKBitmapData::GetImageDesc(VxImageDescEx& oDesc)

Gets Image format description

Parameters

desc: A VxImageDescEx that will contain the image format description.

Returns

TRUE if successful.

Remarks

The desc parameter will be filled with the size,pitch,bpp and mask information for the bitmap.

See Also

VxImageDescEx,GetWidth,GetHeight,GetBitsPerPixel


CKBitmapData::GetWidth

Method CKBitmapData::GetWidth

int CKBitmapData::GetWidth()

Gets the image width

Returns

Image width

See Also

GetBytesPerLine,GetHeight,GetBitsPerPixel


CKBitmapData::SetCubeMap

Method CKBitmapData::SetCubeMap

void CKBitmapData::SetCubeMap(CKBOOL CubeMap)
CKBOOL CKBitmapData::IsCubeMap()

Setup the bitmap to store a cubemap

Parameters

Input argument CubeMap

TRUE if bitmap is to hold a cube map.

Returns

TRUE if the bitmap is set to store a cubemap.

Remarks

If Cubemap is TRUE , 6 slots are created to store the 6 faces of a cube map.


CKBitmapData::SetSaveFormat

Method CKBitmapData::SetSaveFormat

CKBitmapProperties* CKBitmapData::GetSaveFormat()
void CKBitmapData::SetSaveFormat(CKBitmapProperties* format)

Sets the saving format.

Parameters

Input argument format

A CKBitmapProperties that contain the format in which the bitmap should be saved.

Remarks

If the save options have been set to CKTEXTURE_IMAGEFORMAT you can specify a format in which the bitmap will be converted before being saved inside the composition file. The CKBitmapProperties structure contains the CKGUID of a BitmapReader that is to be used plus some additionnal settings specific to each format.

See Also

SetSaveOptions,CKBitmapProperties,CKBitmapReader


CKBitmapData::SetSaveOptions

Method CKBitmapData::SetSaveOptions

virtual CK_BITMAP_SYSTEMCACHING CKSprite::GetSystemCaching() CK_PURE
CK_BITMAP_SAVEOPTIONS CKBitmapData::GetSaveOptions()
CK_BITMAP_SYSTEMCACHING CKBitmapData::GetSystemCaching()
void CKBitmapData::SetSaveOptions(CK_BITMAP_SAVEOPTIONS Options)

Sets the saving options.

Parameters

Input argument Options

Save Options.

Remarks

When saving a composition textures or sprites can be kept as reference to external files or converted to a given format and saved inside the composition file. The CK_BITMAP_SAVEOPTIONS enumeration exposes the available options.

See Also

SetSaveFormat,CK_BITMAP_SAVEOPTIONS


CKBitmapData::SetSystemCaching

Method CKBitmapData::SetSystemCaching

void CKBitmapData::SetSystemCaching(CK_BITMAP_SYSTEMCACHING iOptions)

Sets the system memory caching option.

Parameters

Input argument iOptions

System Caching Options.

Remarks

The system memory caching option specify whether a copy of the image must be kept for textures and sprites and in which format this copy should be kept...

See Also

SetSaveFormat,CK_BITMAP_SYSTEMCACHING


CKBitmapData::GetTransparentColor

Method CKBitmapData::GetTransparentColor

CKDWORD CKBitmapData::GetTransparentColor()

Returns the transparent color.

Returns

Color: A 32 bit ARGB transparent color.

Remarks

0x00000000 (black) is the default transparent color.

See Also

SetTranparentColor,SetTransparent


CKBitmapData::IsTransparent

Method CKBitmapData::IsTransparent

CKBOOL CKBitmapData::IsTransparent()

Returns whether color keyed transparency is enabled.

Parameters

Transparency: TRUE activates transparency, FALSE disables it.

Returns

TRUE if successful.

TRUE if color keying is enabled.

See Also

IsTransparent


CKBitmapData::SetPickThreshold

Method CKBitmapData::SetPickThreshold

void CKBitmapData::SetPickThreshold(int pt)
int CKBitmapData::GetPickThreshold()

Sets pick threshold value.

Parameters

Input argument pt

Pick threshold value to be set.

Remarks

+The pick threshold is used when picking object with transparent textures. +It is the minimum value for alpha component below which picking is not valid. So this value is supposed to be in the range 0..255 and the default value 0 means the picking is always valid. But if a value >0 is used and the texture use transparency (some pixels of the bitmap will have alpha component of 0) an object will not be picked on its transparent part.

See Also

CKRenderContext::Pick


CKBitmapData::SetTransparent

Method CKBitmapData::SetTransparent

void CKBitmapData::SetTransparent(CKBOOL Transparency)

Enables or disables the color key transparency.

Parameters

Input argument Transparency

TRUE activates transparency, FALSE disables it.

Remarks

0x00000000 (black) is the default transparent color. +Setting on the transparency and a transparent color automatically updates the alpha channel so that pixel with the transparent color have a 0 alpha value.

See Also

IsTransparent,SetTranparentColor


CKBitmapData::SetTransparentColor

Method CKBitmapData::SetTransparentColor

void CKBitmapData::SetTransparentColor(CKDWORD Color)

Sets the transparent color.

Parameters

Input argument Color

A 32 bit ARGB transparent color.

Remarks

0x00000000 (black) is the default transparent color. Setting on the transparency and a transparent color automatically updates the alpha channel so that pixel with the transparent color have a 0 alpha value.

See Also

GetTranparentColor,SetTransparent


CKBitmapData::AuthorizeConditionalNonPow2

Method CKBitmapData::AuthorizeConditionalNonPow2

void CKBitmapData::AuthorizeConditionalNonPow2(CKBOOL iAuthorize)
CKBOOL CKBitmapData::IsConditionalNonPow2Authorized()

Do we authorize to create the video texture with a non power of two size

Remarks

+Non power of two tetures can be used when the video cards implies the following limitations on those: +Addressing mode is set to clamp. +Mipmapping is disabled. +DXT formats are not supported for these textures. +On recent graphics card this hint can be taken into account to generate efficient dynamic textures. +If the Texture or sprite is already in video memory you will have to reload it in video memory using FreeVideoMemory/SystemToVideoMemory


CKBitmapData::GetDesiredVideoFormat

Method CKBitmapData::GetDesiredVideoFormat

VX_PIXELFORMAT CKBitmapData::GetDesiredVideoFormat()

Returns the desired pixel format in video memory.

Returns

Desired pixel format for this texture in video memory.

See Also

GetVideoPixelFormat,SetDesiredVideoFormat,CKRenderManager::SetDesiredTexturesVideoFormat


CKBitmapData::SetDesiredVideoFormat

Method CKBitmapData::SetDesiredVideoFormat

void CKBitmapData::SetDesiredVideoFormat(VX_PIXELFORMAT pf)

Sets the desired surface pixel format in video memory.

Parameters

Input argument pf

A VX_PIXELFORMAT giving the desired pixel format.

Remarks

+As its name indicates theis method only sets a “desired” video memory pixel format. The render engine will try to use this format is possible otherwise should find the nearest appropriate pixel format. +Newly created textures use the desired format given in CKRenderManager::SetDesiredTexturesVideoFormat

See Also

GetVideoPixelFormat,GetDesiredVideoFormat,CKRenderManager::SetDesiredTexturesVideoFormat


CKBitmapData::SetDynamicHint

Method CKBitmapData::SetDynamicHint

void CKBitmapData::SetDynamicHint(CKBOOL Dynamic)
CKBOOL CKBitmapData::GetDynamicHint()

Sets a hint to indicate the bitmap is changed frequently.

Remarks

+If the bitmap content is changed very frequently or to generate dynamic video sprites / textures you should set this hint. +On recent graphics card this hint can be taken into account to generate efficient dynamic textures. +This hint is not saved it can be used on textures and sprite created on the fly. +If the Texture or sprite is already in video memory you will have to reload it in video memory using FreeVideoMemory/SystemToVideoMemory


CKBitmapData::SetVolumeMap

Method CKBitmapData::SetVolumeMap

void CKBitmapData::SetVolumeMap(CKBOOL VolumeMap)
CKBOOL CKBitmapData::IsVolumeMap()

Setup the bitmap to store a volume map

Parameters

CubeMap: TRUE if bitmap is to hold a volume map.

Returns

TRUE if the bitmap is set to store a volume map.

Remarks

If VolumeMap is TRUE , the texture slots are used to generate volume slices (Depth).


CKCriticalSectionObject

Class CKCriticalSectionObject

Class managing a critical section mechanism

CKObject
Show brief derivation trees

CKCriticalSectionObject

CKObject
Show full derivation trees

CKCriticalSectionObject

Remarks

A CriticalSection enables objects to acces resources using behaviors without risks of being executed concurrently. An object ask for the right to use a section through EnterCriticalSection and warm that is has finished with LeaveCriticalSection

This class is mainly used by the corresponding parameter type CKPGUID_CRITICALSECTION.

The class id of CKCriticalSectionObject is CKCID_CRITICALSECTION

Groups

Operations
Method EnterCriticalSection | Try to enter a critical section with an object.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method LeaveCriticalSection | Leave a previouly entered critical section.
Method Reset | Resets the crtical section.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)


CKCriticalSectionObject::EnterCriticalSection

Method CKCriticalSectionObject::EnterCriticalSection

CKBOOL CKCriticalSectionObject::EnterCriticalSection(CKBeObject *asker)

Try to enter a critical section with an object.

Parameters

The object trying to get the virtual resource handled by the critical section object.

Returns

TRUE if the resource was free, FALSE otherwise

Remarks

Once a resource has been taken, none objects (either the same that has already taken it) can enter the critical section anymore, until the taker leave it with LeaveCriticalSection.

See Also

LeaveCriticalSection,Reset


CKCriticalSectionObject::LeaveCriticalSection

Method CKCriticalSectionObject::LeaveCriticalSection

CKBOOL CKCriticalSectionObject::LeaveCriticalSection(CKBeObject *asker)

Leave a previouly entered critical section.

Parameters

The object leaving it.

Returns

TRUE if the virtual resource is released, FALSE otherwise.

Remarks

Only the taker can successfully leave a critical section. If another object leave it, nothing happens.

See Also

EnterCriticalSection,Reset


CKCriticalSectionObject::Reset

Method CKCriticalSectionObject::Reset

void CKCriticalSectionObject::Reset()

Resets the crtical section.

Remarks

After a call to Reset(), the virtual resource handled by this critical section is free again.

See Also

EnterCriticalSection,LeaveCriticalSection


CKDataArray

Class CKDataArray

Array that contains a collection of data, each column with a unique type of data

CKObject

CKSceneObject

CKBeObject
Show brief derivation trees

CKDataArray

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKDataArray

Remarks

There exist four basic types of elements you can put in a data array. These types are defined in CK_ARRAYTYPE. The operations provided with the functions ColumnOperate and ColumnTransform only work with basic numeric types (CKARRAYTYPE_INT and CKARRAYTYPE_FLOAT) and not with a parameter of type “Integer” for example. The comparaison, as used by the functions Sort,FindLine, TestRow, etc... fully works with basic types (CKARRAYTYPE_INT, CKARRAYTYPE_FLOAT and CKARRAYTYPE_STRING) and works with comparaison type EQUAL or NOTEQUAL with object types (CKARRAYTYPE_OBJECT and CKARRAYTYPE_PARAMETER) (it compares the ID of the object and it does a memcmp on the content of the two compared parameter.) The class id of CKDataArray is CKCID_DATAARRAY.

Groups

Operations | Algorithm Functions | Column Format Functions | Elements Functions | Rows Functions

Operations
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method PasteShortcut | Paste a shortcut of a parameter on an existing compatible parameter
Method RemoveShortcut | Remove a shortcut parameter (if it exists)
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Method SetElementValueFromValue | Use to set a value from a parameter
Algorithm Functions
Method ColumnsOperate | Apply an operation between two colums into a third
Method ColumnTransform | Transform the elements of a column by operating them with a given value
Method CreateGroup | Create a group from elements matching a value This function clears the group for you.
Method GetCount | Get the count of elements verifying a condition (operator)
Method GetHighest | Find the highest value in the given column of an array
Method GetLowest | Find the lowest value in the given column of an array
Method GetNearest | Find the nearest value of a reference value in the given column of an array
Method Product | Calculate the product of a column of an array
Method RandomShuffle | Randomize the order of the rows in the array
Method Reverse | Reverse the order of the rows of the array
Method Sort | Sort the array on a column criteria, ascending or descending
Method Sum | Calculate the sum of a column of an array
Method Unique | Delete all the rows containing sequence of equal values, leaving only the first one of the sequence.
Column Format Functions
Method GetColumnCount | Return the column count.
Method GetColumnName | Get the name of a column
Method GetColumnParameterGuid | Return the parameter type of a column
Method GetColumnType | Return the type of a column
Method GetKeyColumn | Return the index of the key column.
Method InsertColumn | Insert a column to the array, with a name and a type.
Method MoveColumn | Move a column
Method RemoveColumn | Remove a column from an array
Method SetColumnName | Rename the selected column of an array.
Method SetColumnType | Change the type of the selected column of an array.
Method SetKeyColumn | Set the key column of an array.
Elements Functions
Method GetElement | Return a pointer on the .
Method GetElementObject | Return a pointer of an object in the array.
Method GetElementStringValue | Return the string value of an element of an array
Method GetElementValue | Return the value of an element of an array.
Method GetElementValue_VSL | VSL binding of the GetElementValue function
Method GetStringValue | Convert an element value to a string
Method LoadElements | load elements into an array from a formatted file
Method SetElementStringValue | Set the value of an element from a string
Method SetElementValue | Set the value of a specified element
Method SetElementValue_VSL | VSL binding of the SetElementValue function
Method WriteElements | write elements from an array to a file
Rows Functions
Method AddRow | Add a row in an array
Method Clear | Clear the entire array
Method FindRow | Find the first row matching a key in a column
Method FindRowIndex | Find the index of the first row matching a key in a column
Method GetRow | Get a row of an array
Method GetRowCount | Get the number of rows in the array.
Method InsertRow | Add a row in an array before a specified row index
Method MoveRow | Move a row in the array
Method RemoveRow | Remove the nth row
Method SwapRows | Swap two rows of an array
Method TestRow | Test a row on a column


CKDataArray::PasteShortcut

Method CKDataArray::PasteShortcut

CKBOOL CKDataArray::PasteShortcut(int i,int c,CKParameter* pout)

Remarks

Paste a shortcut of a parameter on an existing compatible parameter


CKDataArray::RemoveShortcut

Method CKDataArray::RemoveShortcut

CKParameterOut* CKDataArray::RemoveShortcut(int i,int c)

Remarks

Remove a shortcut parameter (if it exists)


CKDataArray::SetElementValueFromValue

Method CKDataArray::SetElementValueFromValue

CKBOOL CKDataArray::SetElementValueFromValue(int i,int c,void* value,int type)

Remarks

Use to set a value from a parameter


CKDataArray::ColumnsOperate

Method CKDataArray::ColumnsOperate

void
CKDataArray::ColumnsOperate(int c1,CK_BINARYOPERATOR op,int c2,int cr)

Apply an operation between two colums into a third

Parameters

Input argument c1 | first operand column
Input argument op | operator to apply (CKADD, CKSUB, CKMUL, CKDIV)
Input argument c2 | second operand column
Input argument cr | column result

Remarks

Operate two colums into a third

This Function only works with Integer and Float The result column can be one of the two operand column.

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::ColumnTransform

Method CKDataArray::ColumnTransform

void
CKDataArray::ColumnTransform(int c,CK_BINARYOPERATOR op,CKDWORD key)

Transform the elements of a column by operating them with a given value

Parameters

Input argument c | index of the column to operate
Input argument op | operator to apply (CKADD, CKSUB, CKMUL, CKDIV)
Input argument key | second operand

Remarks

Transform the values by operating them with the given value

This Function only works with Integer and Float

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::CreateGroup

Method CKDataArray::CreateGroup

void
CKDataArray::CreateGroup(int mc,CK_COMPOPERATOR op,CKDWORD key,int size,CKGroup* group,int ec)

Parameters

Input argument mc | column in which to make the comparaison
Input argument op | Comparaision operator (CKEQUAL, CKNOTEQUAL, CKGREATER....)
Input argument key | value to compare with the elements of the array
Input argument size | size of the value in case of it's a parameter
Input argument group | pointer to a CKGroup already created.
Input argument ec | index of the column in which the entities to be added to the group will be found

Remarks

Create a group from elements matching a value

This function clears the group for you.

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::GetCount

Method CKDataArray::GetCount

int
CKDataArray::GetCount(int c,CK_COMPOPERATOR op,CKDWORD key,int size)

Get the count of elements verifying a condition (operator)

Parameters

Input argument c | column in which to make the comparaison
Input argument op | Comparaision operator (CKEQUAL, CKNOTEQUAL, CKGREATER....)
Input argument key | value to compare with the elements of the array
Input argument size | size of the value in case of it's a parameter

Returns

Number of elements verifying the comparaison.

Remarks

Get the count of elements verifying a condition (operator)

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::GetHighest

Method CKDataArray::GetHighest

CKBOOL
CKDataArray::GetHighest(int c,int& row)

Find the highest value in the given column of an array

Parameters

Input argument c | index of the column to search
Input argument row | index of the row found

Returns

TRUE if the row was found, FALSE otherwise.

Remarks

Find the highest value in the given column

This Function only works with Integer, Float and Strings

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::GetLowest

Method CKDataArray::GetLowest

CKBOOL
CKDataArray::GetLowest(int c,int& row)

Find the lowest value in the given column of an array

Parameters

Input argument c | index of the column to search
Input argument row | index of the row found

Returns

TRUE if the value§ was found, FALSE otherwise.

Remarks

Find the lowest value in the given column

This Function only works with Integer, Float and Strings

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::GetNearest

Method CKDataArray::GetNearest

CKBOOL CKDataArray::GetNearest(int c,void* value,int& row)

Find the nearest value of a reference value in the given column of an array

Parameters

Input argument c | index of the column to search
Input argument value | reference value to compare with.
Input argument row | index of the row found

Returns

TRUE if successful,FALSE otherwise.

Remarks

Find the nearest value in the given column

This Function only works with Integer, Float and Strings

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::Product

Method CKDataArray::Product

CKDWORD
CKDataArray::Product(int c)

Calculate the product of a column of an array

Parameters

Input argument c

index of the column

Returns

The product of all the ements of the column

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::RandomShuffle

Method CKDataArray::RandomShuffle

void
CKDataArray::RandomShuffle()

Randomize the order of the rows in the array

Remarks

Shuffle the array

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::Reverse

Method CKDataArray::Reverse

void
CKDataArray::Reverse()

Reverse the order of the rows of the array

Remarks

Reverse the array

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::Sort

Method CKDataArray::Sort

void
CKDataArray::Sort(int c,CKBOOL ascending)

Sort the array on a column criteria, ascending or descending

Parameters

Input argument c | index of the column on which to process the elements comparaison
Input argument ascending | whether you want the elements to be in ascending order (otherwise it is in descending order)

Remarks

Sort the array on the column, ascending or descending

This Function only works with Integer, Float and Strings

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform


CKDataArray::Sum

Method CKDataArray::Sum

CKDWORD
CKDataArray::Sum(int c)

Calculate the sum of a column of an array

Parameters

Input argument c

index of the column

Returns

The sum of all the ements of the column

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::Unique

Method CKDataArray::Unique

void
CKDataArray::Unique(int c)

Delete all the rows containing sequence of equal values, leaving only the first one of the sequence.

Parameters

Input argument c

index of the column on which to process the elements comparaison

Remarks

Remove the elements identical in the array

If you want have only one row of each value in your array, you need to first sort the array on this column, then apply a unique on the same column This function doesn't alter the global order of the array

See Also

CKDataArray::GetHighest,CKDataArray::GetLowest,CKDataArray::ColumnTransform,CKDataArray::Sort


CKDataArray::GetColumnCount

Method CKDataArray::GetColumnCount

int
CKDataArray::GetColumnCount()

Return the column count.

Returns

The number of columns.

See Also

GetColumnParameterGuid,GetKeyColumn,InsertColumn,MoveColumn,RemoveColumn,SetColumnName,SetColumnType


CKDataArray::GetColumnName

Method CKDataArray::GetColumnName

char*
CKDataArray::GetColumnName(int c)

Get the name of a column

Parameters

Input argument c

Index of the column we want the name.

Returns

The real name of the column (not a copy so don't delete it).

Remarks

Get Column Name

This function return NULL if the column doesn't exist.

See Also

SetKeyColumn,GetColumnParameterGuid,GetColumnCount,InsertColumn,MoveColumn,RemoveColumn,SetColumnName,SetColumnType


CKDataArray::GetColumnParameterGuid

Method CKDataArray::GetColumnParameterGuid

CKGUID
CKDataArray::GetColumnParameterGuid(int c)

Return the parameter type of a column

Parameters

Input argument c

Index of the column we want the parameter type.

Returns

The parameter type of the elements in this column.

Remarks

Get Column Parameter GUID

This function return CKGUID(0,0) if the column doesn't exist or if the basic type of the column is not CKARRAYTYPE_PARAMETER.

See Also

SetKeyColumn,GetColumnCount,InsertColumn,MoveColumn,RemoveColumn,SetColumnName,SetColumnType


CKDataArray::GetColumnType

Method CKDataArray::GetColumnType

CK_ARRAYTYPE
CKDataArray::GetColumnType(int c)

Return the type of a column

Parameters

Input argument c

Index of the column we want the type.

Returns

The type of the elements in this column.

Remarks

Get Column Type

This function return 0 if the column doesn't exist.

See Also

SetKeyColumn,GetColumnParameterGuid,GetColumnCount,InsertColumn,MoveColumn,RemoveColumn,SetColumnName,SetColumnType


CKDataArray::GetKeyColumn

Method CKDataArray::GetKeyColumn

int
CKDataArray::GetKeyColumn()

Return the index of the key column.

Returns

Index of the key column

Remarks

This function returns -1 if no key column are defined.

See Also

SetKeyColumn,GetColumnParameterGuid,GetColumnCount,InsertColumn,MoveColumn,RemoveColumn,SetColumnName,SetColumnType


CKDataArray::InsertColumn

Method CKDataArray::InsertColumn

void
CKDataArray::InsertColumn(int iCdst,CK_ARRAYTYPE iType,char* iName,CKGUID iPguid)

Insert a column to the array, with a name and a type.

Parameters

Input argument iCdst | Column before which you whish to insert (-1 for end insertion).
Input argument iType | Elements type of the column you want to add
Input argument iName | Name of the column you want to add.
Input argument iPguid | Parameter guid, if you choose CKARRAYTYPE_PARAMETER as element type.

Remarks

If there is already rows created, elements will be added to them, with default values (0 in most of the case, NULL string for CKARRAYTYPE_STRING). The name can not be NULL.

See Also

SetKeyColumn,GetColumnParameterGuid,GetColumnCount,RemoveColumn,SetColumnName,GetColumnType


CKDataArray::MoveColumn

Method CKDataArray::MoveColumn

void
CKDataArray::MoveColumn(int csrc,int cdst)

Move a column

Parameters

Input argument csrc | Index of the column to move
Input argument cdst | Index of the column to insert before (-1 means after everything)

See Also

SetKeyColumn,GetColumnParameterGuid,GetColumnCount,InsertColumn,RemoveColumn,SetColumnName,GetColumnType


CKDataArray::RemoveColumn

Method CKDataArray::RemoveColumn

void
CKDataArray::RemoveColumn(int c)

Remove a column from an array

Parameters

Input argument c

Index of the column to remove

Remarks

All the elements in the removed column will be deleted and all the columns right to it will be left shifted. The strings and the parameter will be automatically freed.

See Also

SetKeyColumn,GetColumnParameterGuid,GetColumnCount,InsertColumn,MoveColumn,SetColumnName,GetColumnType


CKDataArray::SetColumnName

Method CKDataArray::SetColumnName

void
CKDataArray::SetColumnName(int c,char* name)

Rename the selected column of an array.

Parameters

Input argument c

index of the column to rename

Remarks

The name can't be NULL.

See Also

SetKeyColumn,GetColumnParameterGuid,GetColumnCount,InsertColumn,MoveColumn,RemoveColumn,GetColumnName,GetColumnType


CKDataArray::SetColumnType

Method CKDataArray::SetColumnType

void
CKDataArray::SetColumnType(int c,CK_ARRAYTYPE type,CKGUID paramguid)

Change the type of the selected column of an array.

Parameters

Input argument c | index of the column to change type
Input argument type | new type of the column
Input argument paramguid | Parameter guid, if you choose CKARRAYTYPE_PARAMETER as element type.

Remarks

The name can't be NULL.

See Also

SetKeyColumn,GetColumnParameterGuid,GetColumnCount,InsertColumn,MoveColumn,RemoveColumn,SetColumnName,GetColumnType


CKDataArray::SetKeyColumn

Method CKDataArray::SetKeyColumn

void
CKDataArray::SetKeyColumn(int c)

Set the key column of an array.

Parameters

Input argument c

Index of the column to set as the key column.

Remarks

Set Key Column

You can unset the key column by giving -1 as index.

See Also

GetColumnParameterGuid,GetColumnCount,GetKeyColumn,InsertColumn,MoveColumn,RemoveColumn,SetColumnName,SetColumnType


CKDataArray::GetElement

Method CKDataArray::GetElement

CKDWORD*
CKDataArray::GetElement(int i,int c)

Return a pointer on the .

Parameters

Input argument i | Index of the row of the element to get
Input argument c | Index of the column of the element to get

Returns

An object pointer or NULL

See Also

LoadElements,WriteElements


CKDataArray::GetElementObject

Method CKDataArray::GetElementObject

CKObject*
CKDataArray::GetElementObject(int i,int c)

Return a pointer of an object in the array.

Parameters

Input argument i | Index of the row of the element to get
Input argument c | Index of the column of the element to get

Returns

An object pointer or NULL

See Also

LoadElements,WriteElements


CKDataArray::GetElementStringValue

Method CKDataArray::GetElementStringValue

int
CKDataArray::GetElementStringValue(int i,int c,char* svalue)

Return the string value of an element of an array

Parameters

Input argument i | Index of the row of the element to get
Input argument c | Index of the column of the element to get
Input argument svalue | buffer that will contain the string value (pass NULL if you want to know the size to allocate)

Returns

number of character in the buffer

Remarks

Get the string of a value of an existing element

See Also

CKDataArray::SetElementValue,CKDataArray::GetElement,CKDataArray::LoadElements,CKDataArray::WriteElements


CKDataArray::GetElementValue

Method CKDataArray::GetElementValue

CKBOOL
CKDataArray::GetElementValue(int i,int c,void* value)

Return the value of an element of an array.

Parameters

Input argument i | Index of the row of the element to get
Input argument c | Index of the column of the element to get
Input argument value | A pointer to a memory zone already allocated to receive element value.

Returns

Value | Meaning
TRUE | if it got sucessfully the value
FALSE | otherwise.

See Also

SetElementValue,GetElement,LoadElements,WriteElements


CKDataArray::GetElementValue_VSL

Method CKDataArray::GetElementValue_VSL

CKBOOL
CKDataArray::GetElementValue_VSL(int i,int c,void* value)

VSL binding of the GetElementValue function

Parameters

Input argument i | Index of the row of the element to get
Input argument c | Index of the column of the element to get
Input argument value | A pointer to a memory zone already allocated to receive element value.

Returns

Value | Meaning
TRUE | if it got successfully the value
FALSE | otherwise.

See Also

SetElementValue,GetElement,LoadElements,WriteElements


CKDataArray::GetStringValue

Method CKDataArray::GetStringValue

int
CKDataArray::GetStringValue(CKDWORD key,int c,char* svalue)

Convert an element value to a string

Parameters

Input argument key | value to convert
Input argument c | column from which the value come (necessary to know the value format)
Input argument svalue | buffer that will contain the string value (pass NULL if you want to know the size to allocate)

Returns

number of character in the buffer

Remarks

Get the string of a value of an existing element

See Also

CKDataArray::SetElementValue,CKDataArray::GetElement,CKDataArray::LoadElements,CKDataArray::WriteElements


CKDataArray::LoadElements

Method CKDataArray::LoadElements

CKBOOL
CKDataArray::LoadElements(CKSTRING string,CKBOOL append,int column)

load elements into an array from a formatted file

Parameters

Input argument string | Name of the file to load (absolute or relative)
Input argument append | whether you want to add to the existing elements or not
Input argument column | index of the first column you're starting to read into

Returns

Value | Meaning
TRUE | if no error occured
FALSE | otherwise

Remarks

load elements into an array from a formatted file

You can only read integer, floats strings and parameters (float,angle,percentage,int,bool,string, vector,color,2dvector,matrix and objects (it will search an object in memory with the same name that the one saved)) from a file.

See Also

CKDataArray::SetElementValue,CKDataArray::GetElement,CKDataArray::WriteElements


CKDataArray::SetElementStringValue

Method CKDataArray::SetElementStringValue

CKBOOL
CKDataArray::SetElementStringValue(int i,int c,char* svalue)

Set the value of an element from a string

Parameters

Input argument i | Index of the row of the element to set
Input argument c | Index of the column of the element to set
Input argument svalue | buffer containing the string value of the element to set

Returns

Value | Meaning
TRUE | if no error occured
FALSE | otherwise

Remarks

Set the value of an existing element with a string

An object set with a string value is the first object found matching the name given, no matter what the class is.

See Also

CKDataArray::SetElementValue,CKDataArray::GetElement,CKDataArray::LoadElements,CKDataArray::WriteElements


CKDataArray::SetElementValue

Method CKDataArray::SetElementValue

CKBOOL
CKDataArray::SetElementValue(int i,int c,void* value,int size)
CKBOOL CKDataArray::SetElementValueFromParameter(int i,int c,CKParameter* pout)
CKBOOL CKDataArray::SetElementObject(int i,int c,CKObject* object)

Set the value of a specified element

Parameters

Input argument i | Index of the row of the element to modify
Input argument c | Index of the column of the element to modify
Input argument value | a pointer on a int, a float, a string, a CK_ID or anything in a parameter you want the value to be set in an element of the array.
Input argument size | size in bytes of the data stored in value pointer. pout: A CKParameter that contains the value to set. object: A CKObject or derived object to set as value.

Returns

Value | Meaning
TRUE | if it set sucessfully the value
FALSE | otherwise.

Remarks

This function provide no test on the key column, so uniqueness won't be preserved using this function. SetElementValueFromParameter sets the value using a parameter SetElementObject sets the value if it is an object.

See Also

SetElementValue,GetElement,LoadElements,WriteElements


CKDataArray::SetElementValue_VSL

Method CKDataArray::SetElementValue_VSL

CKBOOL
CKDataArray::SetElementValue_VSL(int i,int c,void* value,int size)

VSL binding of the SetElementValue function

Parameters

Input argument i | Index of the row of the element to modify
Input argument c | Index of the column of the element to modify
Input argument value | a pointer on a int, a float, a string, a CK_ID or anything in a parameter you want the value to be set in an element of the array.
Input argument size | size in bytes of the data stored in value pointer. pout: A CKParameter that contains the value to set. object: A CKObject or derived object to set as value.

Returns

Value | Meaning
TRUE | if it set sucessfully the value
FALSE | otherwise.

Remarks

This function provide no test on the key column, so uniqueness won't be preserved using this function. SetElementValueFromParameter sets the value using a parameter SetElementObject sets the value if it is an object.

See Also

SetElementValue,GetElement,LoadElements,WriteElements


CKDataArray::WriteElements

Method CKDataArray::WriteElements

CKBOOL
CKDataArray::WriteElements(CKSTRING string,int column,int number,CKBOOL iAppend)

write elements from an array to a file

Parameters

Input argument string | Name of the file to write (absolute or relative)
Input argument column | index of the first column you're writing to the file
Input argument number | number of column you want to write to the file
Input argument iAppend | TRUE to append the content of the array to the file.

Returns

Value | Meaning
TRUE | if no error occured
FALSE | otherwise

Remarks

write elements from an array to a file

You can only write integer, floats, strings and parameters (float,angle,percentage,int,bool,string, vector,color,2dvector,matrix and objects (only the name of the object will be saved, so you have to be sure of the name uniqueness if you want to load the array back)) to a file.

See Also

CKDataArray::SetElementValue,CKDataArray::GetElement,CKDataArray::LoadElements


CKDataArray::AddRow

Method CKDataArray::AddRow

void
CKDataArray::AddRow()

Add a row in an array

See Also

InsertRow,GetRow,RemoveRow,FindRow


CKDataArray::Clear

Method CKDataArray::Clear

void CKDataArray::Clear(CKBOOL Params=TRUE)
void
CKDataArray::Clear(BOOL Parameters)

Clear the entire array

Remarks

Clear the entire array

See Also

InsertRow,GetRow,RemoveRow,FindRow


CKDataArray::FindRow

Method CKDataArray::FindRow

CKDataRow*
CKDataArray::FindRow(int c,CK_COMPOPERATOR op,CKDWORD key,int size,int startindex)

Find the first row matching a key in a column

Parameters

Input argument c | column in which to make the comparaison
Input argument op | Comparaision operator (CKEQUAL, CKNOTEQUAL, CKGREATER....)
Input argument key | value to compare with the elements of the array
Input argument size | size of the value in case of it's a parameter
Input argument startindex | row index where to begin the search

Returns

An STL const iterator on a CKDataRow (vector<CKDWORD>). You CANNOT directly change values of the row with this iterator.

Remarks

Find a line with the current key : search in the column c and return the line index (-1) if none

See Also

InsertRow,GetRow,RemoveRow,FindRowIndex


CKDataArray::FindRowIndex

Method CKDataArray::FindRowIndex

int
CKDataArray::FindRowIndex(int c,CK_COMPOPERATOR op,CKDWORD key,int size,int startindex)

Find the index of the first row matching a key in a column

Parameters

Input argument c | column in which to make the comparaison
Input argument op | Comparaision operator (CKEQUAL, CKNOTEQUAL, CKGREATER....)
Input argument key | value to compare with the elements of the array
Input argument size | size of the value in case of it's a parameter
Input argument startindex | row index where to begin the search

Returns

the index of the first row found. -1 if none found.

Remarks

Find a line with the current key : search in the column c and return the line index (-1) if none

See Also

InsertRow,GetRow,RemoveRow,FindRow


CKDataArray::GetRow

Method CKDataArray::GetRow

CKDataRow*
CKDataArray::GetRow(int n)

Get a row of an array

Parameters

Input argument n

Index of the row to get

Returns

An STL const iterator on a CKDataRow (vector<CKDWORD>). You CANNOT change values of the row with this iterator.

Remarks

Get the nth line

See Also

InsertRow,GetRow,RemoveRow,FindRow


CKDataArray::GetRowCount

Method CKDataArray::GetRowCount

int
CKDataArray::GetRowCount()

Get the number of rows in the array.

Returns

Return the number of rows in the array.

Remarks

Get line count

See Also

InsertRow,GetRow,RemoveRow,FindRow


CKDataArray::InsertRow

Method CKDataArray::InsertRow

CKDataRow*
CKDataArray::InsertRow(int n)

Add a row in an array before a specified row index

Parameters

Input argument n

Index of the row to insert before. -1 means to the end of the array

Returns

A pointer on the new CKDataRow (XSArray<CKDWORD>). You can directly change values of the row with this.

See Also

GetRow,RemoveRow,FindRow


CKDataArray::MoveRow

Method CKDataArray::MoveRow

void CKDataArray::MoveRow(int rsrc,int rdst)

Move a row in the array

Parameters

Input argument rsrc | index of the row to move
Input argument rdst | index of the row to insert before (-1 means after all)

See Also

InsertRow,GetRow,RemoveRow,FindRow


CKDataArray::RemoveRow

Method CKDataArray::RemoveRow

void CKDataArray::RemoveRow(int n)

Remove the nth row

Parameters

Input argument n

The index of the row to remove

Remarks

Remove the nth line

See Also

AddRow,GetRow,RemoveRow,FindRow


CKDataArray::SwapRows

Method CKDataArray::SwapRows

void
CKDataArray::SwapRows(int i1,int i2)

Swap two rows of an array

Parameters

Input argument i1 | index of the first row to swap
Input argument i2 | index of the second row to swap

Remarks

swap two lines in the array

See Also

InsertRow,GetRow,RemoveRow,FindRow


CKDataArray::TestRow

Method CKDataArray::TestRow

CKBOOL
CKDataArray::TestRow(int row,int c,CK_COMPOPERATOR op,CKDWORD key,int size)

Test a row on a column

Parameters

Input argument row | Index of the row to test
Input argument c | column in which to make the test
Input argument op | Comparaision operator (CKEQUAL, CKNOTEQUAL, CKGREATER....)
Input argument key | value to compare with the elements of the array
Input argument size | size of the value in case of it's a parameter

Returns

Value | Meaning
TRUE | if the test succeed
FALSE | otherwise

Remarks

Test a row on a column

See Also

InsertRow,GetRow,RemoveRow,FindRowIndex


CKDependencies

XSArray<CKDWORD>
Show full derivation trees

CKDependencies

Remarks

See Object Dependencies Options chapter for more details on this class.

This class derived from an XSArray. It contains the dependencies options used for copying, destroying, etc. objects. Each index of the array contains the specific options for the class ID equals to the index.

These options are visible in the file CKDependenciesConstants.h

The m_Flags members is used to set a mode of dependencies (either none, full or custom). in Full or None mode the

You can obtain a CKDependencies filled with default dependencies for each class with the global function CKGetDefaultClassDependencies(), or copy them to a new CKDependencies for modifying them afterward with CKCopyDefaultClassDependencies().

Groups

Data Members
Member Variable m_Flags | Flags defining the mode of dependencies.
Operations
Method ModifyOptions | Modify the dependencies options for a specific class id.

See Also

CKGetDefaultClassDependencies,CKCopyDefaultClassDependencies,CKDependenciesContext,Object Dependencies Options


CKDependencies::m_Flags

Member Variable CKDependencies::m_Flags

CK_DEPENDENCIES_FLAGS CKDependencies::m_Flags

Flags defining the mode of dependencies.

See Also

CK_DEPENDENCIES_FLAGS


CKDependencies::ModifyOptions

Method CKDependencies::ModifyOptions

void CKDependencies::ModifyOptions(CK_CLASSID cid,CKDWORD add, CKDWORD rem)

Modify the dependencies options for a specific class id.

Remarks

For example we do not want that when copying objects, meshes of a CK3dEntity be copied. For this we modify the option for the CK3dEntity class

Example

ModifyOptions(CKCID_3DENTITY,0,CK_DEPENDENCIES_COPY_3DENTITY_MESH);

See Also

Object Dependencies Options


CKDependenciesContext

Class CKDependenciesContext

Storage of dependencies, when performing objects operations like copy, delete, etc.

Groups

Operations
Method AddObjects | Add objects to be considered by the dependencies context.
Method ContainClassID | Checks if a specific class id is contained in the objects prepared to be copied.
Method Copy | Copy all the objects added to the dependencies context.
Method FillDependencies | Creates an XObjectArray filled with the objects that have been prepared by the dependencies context.
Method FillRemappedDependencies | Returns the objects that have been remapped by the dependencies context after a copy.
Method GetClassDependencies | Gets the dependencies options for a given class id.
Method GetObjects | Returns the object at the given index.
Method GetObjectsCount | Returns the number of objects added to the dependencies context.
Method IsDependenciesHere | Tests if a CK_ID is in the dependencies context.
Method IsInMode | Gets the operation mode for this dependencies context.
Method Remap | Remaps a CKObject.
Method RemapID | Remaps a CK_ID.
Method SetClassDependencies |
Method SetCreationMode | Sets the creation mode for subsequent object creation.
Method SetOperationMode | Sets the operation mode for this dependencies context.
Method StartDependencies | Sets dependencies options for the subsequent operations to come.
Method StopDependencies | Stops using the actual dependencies options.

See Also

CKDependencies,CKContext


CKDependenciesContext::AddObjects

Method CKDependenciesContext::AddObjects

void
CKDependenciesContext::AddObjects(CK_ID* ids,int count)

Add objects to be considered by the dependencies context.

Parameters

Input argument ids | a pointer on CK_IDs.
Input argument count | count of ids in the array given.

See Also

GetObjectsCount,AddObjects


CKDependenciesContext::ContainClassID

Method CKDependenciesContext::ContainClassID

CKBOOL CKDependenciesContext::ContainClassID(CK_CLASSID Cid)

Checks if a specific class id is contained in the objects prepared to be copied.

Parameters

Input argument Cid

Class ID which options should be returned.

Returns

TRUE if the dependencies to be copied contain an object of class Cid.

See Also

CK_DEPENDENCIES_OPMODE, IsInMode


CKDependenciesContext::Copy

Method CKDependenciesContext::Copy

void
CKDependenciesContext::Copy(CKSTRING appendstring)

Copy all the objects added to the dependencies context.

Parameters

Input argument appendstring

the string, if any, to append at the end of the name of created copies.

Remarks

The objects will be created using creation options set by SetCreationMode. The objects copied will be accessed by the GetObject and GetObjectCount functions.

See Also

CKDependencies, StartDependencies


CKDependenciesContext::FillDependencies

Method CKDependenciesContext::FillDependencies

XObjectArray
CKDependenciesContext::FillDependencies()

Creates an XObjectArray filled with the objects that have been prepared by the dependencies context.

Returns

An XObjectArray filled with objects prepared by the CKDependenciesContext.

See Also

CKDependencies, StartDependencies


CKDependenciesContext::FillRemappedDependencies

Method CKDependenciesContext::FillRemappedDependencies

XObjectArray
CKDependenciesContext::FillRemappedDependencies()

Returns the objects that have been remapped by the dependencies context after a copy.

Returns

An XObjectArray filled with objects copied by the CKDependenciesContext.

See Also

CKDependencies, StartDependencies,FillDependencies


CKDependenciesContext::GetClassDependencies

Method CKDependenciesContext::GetClassDependencies

CKDWORD CKDependenciesContext::GetClassDependencies(int c)

Gets the dependencies options for a given class id.

Parameters

Input argument c

Class ID which options should be returned.

Returns

The options for this class id.

See Also

CKDependencies, StartDependencies


CKDependenciesContext::GetObjects

Method CKDependenciesContext::GetObjects

CKObject*
CKDependenciesContext::GetObjects(int i)

Returns the object at the given index.

Returns

The object at the given index.

Remarks

After a copy, this function returns the copied object at the index of the source one.

See Also

GetObject,AddObjects


CKDependenciesContext::GetObjectsCount

Method CKDependenciesContext::GetObjectsCount

int
CKDependenciesContext::GetObjectsCount()

Returns the number of objects added to the dependencies context.

Returns

Number of objects added to the dependencies context.

Remarks

This is the number of objects added by AddObjects(), not the total number of objects, considering the dependencies too.

See Also

GetObject,AddObjects


CKDependenciesContext::IsDependenciesHere

Method CKDependenciesContext::IsDependenciesHere

CKBOOL CKDependenciesContext::IsDependenciesHere(CK_ID id)

Tests if a CK_ID is in the dependencies context.

Parameters

Input argument id

CK_ID to test.

Returns

TRUE if the object is here, FALSE otherwise.

See Also

RemapID


CKDependenciesContext::IsInMode

Method CKDependenciesContext::IsInMode

CKBOOL CKDependenciesContext::IsInMode(CK_DEPENDENCIES_OPMODE m)

Gets the operation mode for this dependencies context.

Returns

The operation mode desired.

See Also

CK_DEPENDENCIES_OPMODE, SetOperationMode


CKDependenciesContext::Remap

Method CKDependenciesContext::Remap

CKObject* CKDependenciesContext::Remap(const CKObject* o)

Remaps a CKObject.

Parameters

Input argument o

the CKObject to remap.

Returns

Returns the remapped object, or the old object if it wasn't in the dependencies context.

See Also

RemapID


CKDependenciesContext::RemapID

Method CKDependenciesContext::RemapID

CK_ID CKDependenciesContext::RemapID(CK_ID& id)

Remaps a CK_ID.

Parameters

Input argument id

the CK_ID to remap. If the object was in the dependencies context, it is changed. Otherwise, it remains unchanged.

Returns

Returns the remapped value of the CK_ID given, or the old value if it wasn't in the dependencies context.

See Also

Remap


CKDependenciesContext::SetClassDependencies

Method CKDependenciesContext::SetClassDependencies

void CKDependenciesContext::SetClassDependencies(int c, CKDWORD opt)


CKDependenciesContext::SetCreationMode

Method CKDependenciesContext::SetCreationMode

void CKDependenciesContext::SetCreationMode(CK_OBJECTCREATION_OPTIONS m)

Sets the creation mode for subsequent object creation.

Parameters

Input argument m

the creation mode desired.

See Also

CK_DEPENDENCIES_OPMODE, IsInMode


CKDependenciesContext::SetOperationMode

Method CKDependenciesContext::SetOperationMode

void CKDependenciesContext::SetOperationMode(CK_DEPENDENCIES_OPMODE m)

Sets the operation mode for this dependencies context.

Parameters

Input argument m

the operation mode desired.

See Also

CK_DEPENDENCIES_OPMODE, IsInMode


CKDependenciesContext::StartDependencies

Method CKDependenciesContext::StartDependencies

void CKDependenciesContext::StartDependencies(CKDependencies* d)

Sets dependencies options for the subsequent operations to come.

Parameters

Input argument d

a CKDependencies.

Remarks

You'll need to call this function before calling Copy() for example if you wan't full or custom dependencies to be taken into account.

See Also

CKDependencies,StopDependencies


CKDependenciesContext::StopDependencies

Method CKDependenciesContext::StopDependencies

void CKDependenciesContext::StopDependencies()

Stops using the actual dependencies options.

Remarks

You'll need to call this function before calling Copy() for example if you wan't full or custom dependencies to be taken into account.

See Also

CKDependencies, StartDependencies


CKFile

Class CKFile

CKFile provides functions to save/load files in Virtools format.

Remarks

A CKFile is created through CreateCKFile and should be deleted after use using DeleteCKFile. Once created a CKFile can be used to save one or more objects to disk or memory. Normally you should not have to use this class directly since the CKContext::Load and CKContext::Save methods handle most cases.

Groups

Operations
Method EndSave | Add obj to the list of objects to be saved as references
Method GetMissingPlugins | Dependencies :
Method IncludeFile |
Method IsObjectToBeSaved |
Method Load | Direct Loading
Method LoadAndSave | Used to update from old file formats
Method LoadFileData |
Method OpenFile | Loading (OpenFile then LoadFileData )
Method OpenMemory |
Method OpenStream |
Method RemapManagerInt | Remap every chunks according to the conversion table
Method SaveObject |
Method SaveObjectAsReference | Add obj to the list of objects to be saved
Method SaveObjects |
Method SetResolveReferenceCallback | Sets a customized reference resolution function, which replaces CKFile::ResolveReference() implementation.
Method StartSave | Saving

See Also

CreateCKFile,DeleteCKFile


CKFile::EndSave

Method CKFile::EndSave

CKERROR CKFile::EndSave()

Remarks

Add obj to the list of objects to be saved as references


CKFile::GetMissingPlugins

Method CKFile::GetMissingPlugins

XClassArray<CKFilePluginDependencies> *CKFile::GetMissingPlugins()

Remarks

Dependencies :


CKFile::IncludeFile

Method CKFile::IncludeFile

CKBOOL CKFile::IncludeFile(CKSTRING FileName,int SearchPathCategory = -1)


CKFile::IsObjectToBeSaved

Method CKFile::IsObjectToBeSaved

CKBOOL CKFile::IsObjectToBeSaved(CK_ID iID)


CKFile::Load

Method CKFile::Load

CKERROR CKFile::Load(CKSTRING filename,CKObjectArray *list,CK_LOAD_FLAGS Flags=CK_LOAD_DEFAULT)
CKERROR CKFile::Load(void* MemoryBuffer,int BufferSize,CKObjectArray *list,CK_LOAD_FLAGS Flags=CK_LOAD_DEFAULT)
CKERROR CKFile::Load(VxStream* stream,CKObjectArray *list,CK_LOAD_FLAGS Flags=CK_LOAD_DEFAULT)

Remarks

Direct Loading


CKFile::LoadAndSave

Method CKFile::LoadAndSave

void CKFile::LoadAndSave(CKSTRING filename,CKSTRING filename_new)

Remarks

Used to update from old file formats


CKFile::LoadFileData

Method CKFile::LoadFileData

CKERROR CKFile::LoadFileData(CKObjectArray *list)


CKFile::OpenFile

Method CKFile::OpenFile

CKERROR CKFile::OpenFile(CKSTRING filename,CK_LOAD_FLAGS Flags=CK_LOAD_DEFAULT)

Remarks

Loading (OpenFile then LoadFileData )


CKFile::OpenMemory

Method CKFile::OpenMemory

CKERROR CKFile::OpenMemory(void* MemoryBuffer,int BufferSize,CK_LOAD_FLAGS Flags=CK_LOAD_DEFAULT)


CKFile::OpenStream

Method CKFile::OpenStream

CKERROR CKFile::OpenStream(VxStream* stream,CK_LOAD_FLAGS Flags=CK_LOAD_DEFAULT)


CKFile::RemapManagerInt

Method CKFile::RemapManagerInt

void CKFile::RemapManagerInt(CKGUID Manager,int* ConversionTable,int TableSize)

Remarks

Remap every chunks according to the conversion table


CKFile::SaveObject

Method CKFile::SaveObject

void CKFile::SaveObject(CKObject *obj,CKDWORD flags=CK_STATESAVE_ALL)


CKFile::SaveObjectAsReference

Method CKFile::SaveObjectAsReference

void CKFile::SaveObjectAsReference(CKObject *obj,CKDWORD flags=0)

Remarks

Add obj to the list of objects to be saved


CKFile::SaveObjects

Method CKFile::SaveObjects

void CKFile::SaveObjects(CKObjectArray *array,CKDWORD flags=CK_STATESAVE_ALL)
void CKFile::SaveObjects(CK_ID* ids,int count,CKDWORD flags=CK_STATESAVE_ALL)
void CKFile::SaveObjects(CKObject** obs,int count,CKDWORD flags=CK_STATESAVE_ALL)


CKFile::SetResolveReferenceCallback

Method CKFile::SetResolveReferenceCallback

void CKFile::SetResolveReferenceCallback(CKRRCALLBACKFCT iCallback)

Remarks

Sets a customized reference resolution function, which replaces CKFile::ResolveReference() implementation.


CKFile::StartSave

Method CKFile::StartSave

CKERROR CKFile::StartSave(CKSTRING filename,CKDWORD Flags=CK_STATESAVE_ALL)

Remarks

Saving


CKPathManager

Class CKPathManager

Files paths management

CKBaseManager
Show brief derivation trees

CKPathManager

CKBaseManager
Show full derivation trees

CKPathManager

Remarks

The path manager holds a set of paths that everybody can use to retrieve a file.

These paths are put into relevant categories (bitmap,sound,datas) but new categories for application specific data can be defined.

The Path manager also provides some utility methods to work on paths.

At startup (creation of the CKContext) , the path manager always registers three default category:

"Bitmap Paths"  : Index 0
"Data Paths"    : Index 1
"Sound Paths"   : Index 2

Groups

Operations | Categories | File retrieving | Paths | Utilities

Operations
Method AddBigFile | Register a BigFile : Absolute path
Method GetBigFile | Gets a registered BigFile by index
Method GetBigFileCount | Gets the count of registered BigFiles
Method IsBigFilePath | Is the given path reference a file in a BigFile
Method OpenSubFile | Is the given path reference a file in a BigFile
Method RemoveBigFile | remove a BigFile by index
Method RemoveCategory | Removes a category using its name or its index in category list
Method StartProfile | Starts profiling.
Method StopProfile | Stops profiling.
Categories
Method AddCategory | Adds a new path category.
Method GetCategoryCount | Returns the number of registred categories.
Method GetCategoryIndex | Givens its name returns index of a category.
Method GetCategoryName | Returns the name of a given category.
Method RenameCategory | Renames the given category.
File retrieving
Method ResolveFileName | Finds a file in the paths
Paths
Method AddPath | Adds a path inside a category.
Method GetPathCount | Returns the number of paths inside a category.
Method GetPathIndex | Returns the index of a path given its name and category.
Method GetPathName | Returns the name of a path inside a category.
Method RemovePath | Removes the name of a path given its index and category.
Method RenamePath | Changes the name of a path given its index and category.
Method SwapPaths | Swaps two paths in a category.
Utilities
Method AddEscapedSpace | Converts '' (space) characters to '%20' characters
Method GetVirtoolsTemporaryFolder | Returns the Virtools temporary storage folder.
Method PathIsAbsolute | Returns whether a path is absolute
Method PathIsFile | Returns whether a path contains 'file:'
Method PathIsUNC | Returns whether a path is UNC
Method PathIsURL | Returns whether a path is an URL
Method RemoveEscapedSpace | Converts '%20' characters to ''(space) characters

See Also

CKContext::GetPathManager


CKPathManager::AddBigFile

Method CKPathManager::AddBigFile

CKERROR CKPathManager::AddBigFile(const char* iFileName)

Remarks

Register a BigFile : Absolute path


CKPathManager::GetBigFile

Method CKPathManager::GetBigFile

const char* CKPathManager::GetBigFile(int iIndex)

Remarks

Gets a registered BigFile by index


CKPathManager::GetBigFileCount

Method CKPathManager::GetBigFileCount

int CKPathManager::GetBigFileCount()

Remarks

Gets the count of registered BigFiles


CKPathManager::IsBigFilePath

Method CKPathManager::IsBigFilePath

CKBOOL CKPathManager::IsBigFilePath(const char* iPath)

Remarks

Is the given path reference a file in a BigFile


CKPathManager::OpenSubFile

Method CKPathManager::OpenSubFile

XBOOL CKPathManager::OpenSubFile(const char* iPath,VxSubFile* oSubFile)

Remarks

Is the given path reference a file in a BigFile


CKPathManager::RemoveBigFile

Method CKPathManager::RemoveBigFile

CKERROR CKPathManager::RemoveBigFile(int iIndex)

Remarks

remove a BigFile by index


CKPathManager::RemoveCategory

Method CKPathManager::RemoveCategory

CKERROR CKPathManager::RemoveCategory(int catIdx)

Remarks

Removes a category using its name or its index in category list


CKPathManager::AddCategory

Method CKPathManager::AddCategory

int CKPathManager::AddCategory(XString& cat)

Adds a new path category.

Parameters

Input argument cat

Name of the category to create.

Returns

An integer giving the index for the newly created category or -1 if the category already exist.

Remarks

Three categories are always registred at start up : Bitmaps (index 0) , Datas (index 1) and *Sounds*(index 2)

See Also

GetCategoryCount,GetCategoryName,GetCategoryIndex,RenameCategory


CKPathManager::GetCategoryCount

Method CKPathManager::GetCategoryCount

int CKPathManager::GetCategoryCount()

Returns the number of registred categories.

Returns

An integer giving the number of existing path categories.

Remarks

Three categories are always registred at start up : Bitmaps (index 0) , Datas (index 1) and *Sounds*(index 2)

See Also

AddCategory,GetCategoryName,GetCategoryIndex,RenameCategory


CKPathManager::GetCategoryIndex

Method CKPathManager::GetCategoryIndex

int CKPathManager::GetCategoryIndex(XString& cat)

Givens its name returns index of a category.

Parameters

Input argument cat

A XString containing the category name.

Returns

Index of the category or -1 if not found.

Remarks

Three categories are always registred at start up : Bitmaps (index 0) , Datas (index 1) and *Sounds*(index 2)

See Also

AddCategory,GetCategoryCount,RenameCategory,GetCategoryName


CKPathManager::GetCategoryName

Method CKPathManager::GetCategoryName

CKERROR CKPathManager::GetCategoryName(int catIdx,XString& catName)

Returns the name of a given category.

Parameters

Input argument catIdx | Index of the category which name should be returned.
Input argument catName | A XString that will be filled with the category name.

Returns

CK_OK.

Remarks

Three categories are always registred at start up : Bitmaps (index 0) , Datas (index 1) and *Sounds*(index 2)

See Also

AddCategory,GetCategoryCount,GetCategoryIndex,RenameCategory


CKPathManager::RenameCategory

Method CKPathManager::RenameCategory

CKERROR CKPathManager::RenameCategory(int catIdx, XString& newName)

Renames the given category.

Parameters

Input argument catIdx

Index of the category which name should be changed. catName: A XString containing the new category name.

Returns

CK_OK.

Remarks

Three categories are always registred at start up : Bitmaps (index 0) , Datas (index 1) and *Sounds*(index 2)

See Also

AddCategory,GetCategoryCount,GetCategoryIndex,GetCategoryName


CKPathManager::ResolveFileName

Method CKPathManager::ResolveFileName

CKERROR CKPathManager::ResolveFileName(XString& File, int catIdx,int startIdx)

Finds a file in the paths

Parameters

Input argument File | A XString containing the name of file to find.
Input argument catIdx | Index of the category to be used.
Input argument startIdx | Index of the first path to use in the given category (should be -1 the first time)

Returns

Value | Meaning
CKERR_INVALIDFILE | if the filename is invalid,
CKERR_NOTFOUND | if the file was not found in the paths and
CK_OK | if successful.

Remarks

If startIdx is -1 the following tests are made: First the registered BigFiles are parsed Then the given filename is absolute we try this path Then the start path (CK2.Dll path) Then path from where the last Virtools(.Cmo,.Vmo) file was loaded (CKContext::GetLastCmoLoaded) Then the current directory Then the Virtools temporary storage folder (GetVirtoolsTemporaryFolder) Then we take try with every path in the catIdx category in the order they are stored beginning at startIdx.

See Also

CK_PATHMANAGER_CATEGORY,AddPath,SwapPaths


CKPathManager::AddPath

Method CKPathManager::AddPath

int CKPathManager::AddPath(int catIdx , XString& path)

Adds a path inside a category.

Parameters

Input argument catIdx | Index of the category.
Input argument path | Name of the path to be added

Returns

Index of the newly added path.

See Also

CK_PATHMANAGER_CATEGORY,GetPathCount,GetPathName,GetPathIndex,RenamePath,RemovePath,SwapPaths,ResolveFileName


CKPathManager::GetPathCount

Method CKPathManager::GetPathCount

int CKPathManager::GetPathCount(int catIdx)

Returns the number of paths inside a category.

Parameters

Input argument catIdx

Index of the category.

Returns

Number of paths inthis category.

See Also

CK_PATHMANAGER_CATEGORY,GetPathName,AddPath,GetPathIndex,RenamePath,RemovePath,SwapPaths,ResolveFileName


CKPathManager::GetPathIndex

Method CKPathManager::GetPathIndex

int CKPathManager::GetPathIndex(int catIdx, XString& path)

Returns the index of a path given its name and category.

Parameters

Input argument catIdx | Index of the category.
Input argument path | Name of the path which index is to be returned

Returns

Index of the path or -1 if not found.

See Also

CK_PATHMANAGER_CATEGORY,GetPathCount,GetPathName,AddPath,RenamePath,RemovePath,SwapPaths,ResolveFileName


CKPathManager::GetPathName

Method CKPathManager::GetPathName

CKERROR CKPathManager::GetPathName(int catIdx, int pathIdx,XString& path)

Returns the name of a path inside a category.

Parameters

Input argument catIdx | Index of the category.
Input argument pathIdx | Index of the path to be retrieved.
Input argument path | A XString that will be filled with the path name.

Returns

CK_OK.

See Also

CK_PATHMANAGER_CATEGORY,GetPathCount,AddPath,GetPathIndex,RenamePath,RemovePath,SwapPaths,ResolveFileName


CKPathManager::RemovePath

Method CKPathManager::RemovePath

CKERROR CKPathManager::RemovePath(int catIdx , int pathIdx)

Removes the name of a path given its index and category.

Parameters

Input argument catIdx | Index of the category.
Input argument pathIdx | Index of the path to be removed.

Returns

CK_OK.

See Also

CK_PATHMANAGER_CATEGORY,GetPathCount,GetPathName,AddPath,GetPathIndex,RenamePath,SwapPaths,ResolveFileName


CKPathManager::RenamePath

Method CKPathManager::RenamePath

CKERROR CKPathManager::RenamePath(int catIdx, int pathIdx, XString& path)

Changes the name of a path given its index and category.

Parameters

Input argument catIdx | Index of the category.
Input argument pathIdx | Index of the path to be renamed.
Input argument path | new name for the path.

Returns

CK_OK.

See Also

CK_PATHMANAGER_CATEGORY,GetPathCount,GetPathName,AddPath,GetPathIndex,RemovePath,SwapPaths,ResolveFileName


CKPathManager::SwapPaths

Method CKPathManager::SwapPaths

CKERROR CKPathManager::SwapPaths(int catIdx, int pathIdx1, int pathIdx2)

Swaps two paths in a category.

Parameters

Input argument catIdx | Index of the category.
Input argument pathIdx1 | Index of the path to be swapped.
Input argument pathIdx2 | Index of the path to be swapped.

Returns

CK_OK.

Remarks

Use this method to sort the search order when resolving a filename.

See Also

CK_PATHMANAGER_CATEGORY,GetPathCount,GetPathName,AddPath,GetPathIndex,RenamePath,ResolveFileName


CKPathManager::AddEscapedSpace

Method CKPathManager::AddEscapedSpace

void CKPathManager::AddEscapedSpace(XString &str)

Converts '' (space) characters to '%20' characters

Parameters

Input argument str

A XString to convert.

Remarks

This method is used to convert string for use in web pages, it replaces unauthorized characters which % followed by the ascii code. (i.e. a blank space will be replaces by %20)

See Also

RemoveEscapedSpace


CKPathManager::GetVirtoolsTemporaryFolder

Method CKPathManager::GetVirtoolsTemporaryFolder

XString CKPathManager::GetVirtoolsTemporaryFolder()

Returns the Virtools temporary storage folder.

Returns

A string containing the path used by Virtools to store temporary data.

Remarks

+When opening a Virtools file, the engine may need to extract files stored inside it. They are stored in a temporary folder which is deleted upon application exit. +The user can use this folder to store its own temporary files knowing they will be deleted.

See Also

VxGetTempPath


CKPathManager::PathIsAbsolute

Method CKPathManager::PathIsAbsolute

BOOL CKPathManager::PathIsAbsolute(XString& file)

Returns whether a path is absolute

Returns

TRUE if file contrains ':/' or ':\'.


CKPathManager::PathIsFile

Method CKPathManager::PathIsFile

BOOL CKPathManager::PathIsFile(XString& file)

Returns whether a path contains 'file:'

Returns

TRUE if file contrains 'file:'


CKPathManager::PathIsUNC

Method CKPathManager::PathIsUNC

BOOL CKPathManager::PathIsUNC(XString& file)

Returns whether a path is UNC

Returns

TRUE if file contrains '\\' or '//'.


CKPathManager::PathIsURL

Method CKPathManager::PathIsURL

BOOL CKPathManager::PathIsURL(XString& file)

Returns whether a path is an URL

Returns

TRUE if file contrains 'http:','ftp:' or 'javascript:'


CKPathManager::RemoveEscapedSpace

Method CKPathManager::RemoveEscapedSpace

void CKPathManager::RemoveEscapedSpace(char *str)

Converts '%20' characters to ''(space) characters

Parameters

Input argument str

string to convert.

Remarks

This method is the counterpart of AddEscapedSpace.

See Also

AddEscapedSpace


CKStateChunk

Class CKStateChunk

Used to store CK object states

Remarks

The first use of CKStateChunk by the library is to store CK object states.( snapshot ) Instance of this class are returned by the CKSaveObjectState or CreateCKStateChunk method that is implemented for all instances of CKObject and of its derived classes. They are used as argument to the CKReadObjectState method.

The second use is to create blocks of data that can be saved to the disk or in memory. Methods of CKStateChunk provide easy ways to write and read any type of CkObjects, integer, float array, buffer ,bitmap, string ,etc.. in a buffer.

Instances of CKStateChunk should be explicitely deleted with the DeleteCKStateChunk function.

Groups

Operations | Bitmap functions | Creation Functions | Iterating Functions | Managers | Misc Read-Write Functions | Objects | Sub Chunks | Type Definitions

Operations
Method CheckSize |
Method ReadAndFillBuffer_LEndian | fills buffer with known size (must be allocated )
Method ReadAndFillBuffer_LEndian16 | fills buffer with known size (must be allocated )
Method ReadReaderBitmap |
Method ReadStringUntilZero | returns the length of the string including the terminating null caracter (str must already be allocated)
Method WriteReaderBitmap |
Bitmap functions
Method ReadBitmap | Reads the image data from chunk and creates a bitmap from it.
Method ReadBitmap2 | Returns the image data read from the chunk.
Method ReadRawBitmap | Returns raw bitmap data and fills the Image Description.
Method WriteBitmap | Writes the given bitmap handle into the chunk.
Method WriteRawBitmap | Writes the given Image Data in raw bitmap format
Creation Functions
Method AddChunk | Appends the given chunk.
Method AddChunkAndDelete | Appends the given chunk.
Method Clear | Clears an instance of CKStateChunk
Method Clone | Copies an instance of CKStateChunk to this chunk.
Method CloseChunk | Closes a chunk.
Method GetChunkClassID | Gives the class id of CKStateChunk.
Method GetChunkVersion | Gives the version number of CKStateChunk.
Method GetCurrentPos | Gives the current position of the read/write cursor in the buffer of the chunk.
Method GetDataSize | Gives the size of Data in the chunk
Method GetDataVersion | Gives the version number of Data in the chunk
Method Goto | Sets current position of the read/write buffer of the chunk to the specified position.
Method LockReadBuffer | Returns a pointer to the chunk buffer at the current read position.
Method LockWriteBuffer | Returns a buffer at the current write position in the StateChunk.
Method ReadIdentifier | Reads identifier from chunk.
Method SetDataVersion | Sets the version number of Data in the chunk
Method Skip | Skips specified number of CKDWORDs from read/write buffer of the chunk from its current position.
Method StartRead | Initialises the reader parameters.
Method StartWrite | Initialises the writer parameters.
Method WriteIdentifier | Writes given identifier to chunk.
Iterating Functions
Method SeekIdentifier | Searches the given Id in the chunk data.
Method SeekIdentifierAndReturnSize | Searches the given identifer in the chunk data and returns the size corresponding to data written after it.
Managers
Method ReadManagerInt | Returns the value read and fills GUID data of the manager from Manager sequece.
Method ReadManagerIntSequence | Returns the value read from a manager sequece.
Method StartManagerReadSequence | Gets GUID of the manager and length of manager sequence.
Method StartManagerSequence | Creates a new sequence of Managers.
Method WriteManagerInt | Writes data and GUID of the manager into the state chunk.
Method WriteManagerSequence | Writes data into a Manager sequece.
Misc Read-Write Functions
Method ReadAndFillBuffer | Reads a buffer.
Method ReadBuffer | Reads a buffer of CKBYTE.
Method ReadByte | Reads a byte.
Method ReadDword | Reads a CKDWORD.
Method ReadDwordAsWords | Reads a CKDWORD as 2 CKWORD.
Method ReadFloat | Reads a float value.
Method ReadGuid | Reads a GUID.
Method ReadInt | Reads an integer.
Method ReadMatrix | Reads a matrix.
Method ReadString | Reads a string.
Method ReadVector | Reads a vector.
Method ReadWord | Reads a CKWORD.
Method WriteBuffer | Writes buffer of specified size.
Method WriteByte | Writes a byte.
Method WriteDword | Writes a CKDWORD.
Method WriteDwordAsWords | Writes a CKDWORD as 2 CKWORDs.
Method WriteFloat | Writes a float value.
Method WriteGuid | Writes a GUID.
Method WriteInt | Writes an integer.
Method WriteMatrix | Writes a matrix.
Method WriteString | Writes a string.
Method WriteVector | Writes a vector.
Method WriteWord | Writes a CKWORD.
Objects
Method ReadObject | Returns an object of the given context from the chunk.
Method ReadObjectID | Reads an object ID from the chunk.
Method StartObjectIDSequence | Creates a new object ID sequence in the chunk.
Method StartReadSequence | Returns the number of data written in a sequence..
Method WriteObjectID | Writes the given object ID to the chunk.
Method WriteObjectIDSequence | Writes an object ID to the chunk
Sub Chunks
Method StartSubChunkSequence | Creates a new subchunk branch.
Method WriteSubChunk | Writes a subchunk into a chunk.
Method WriteSubChunkSequence | Writes a subchunk into a chunk.
Type Definitions
Method ReadSubChunk |

See Also

Using State Chunks, CKSaveObjectState, CKReadObjectState, DeleteCKStateChunk


CKStateChunk::CheckSize

Method CKStateChunk::CheckSize

void CKStateChunk::CheckSize(int size)


CKStateChunk::ReadAndFillBuffer_LEndian

Method CKStateChunk::ReadAndFillBuffer_LEndian

void CKStateChunk::ReadAndFillBuffer_LEndian(int size,void* buffer)

Remarks

fills buffer with known size (must be allocated )


CKStateChunk::ReadAndFillBuffer_LEndian16

Method CKStateChunk::ReadAndFillBuffer_LEndian16

void CKStateChunk::ReadAndFillBuffer_LEndian16(int size,void* buffer)

Remarks

fills buffer with known size (must be allocated )


CKStateChunk::ReadReaderBitmap

Method CKStateChunk::ReadReaderBitmap

CKBOOL CKStateChunk::ReadReaderBitmap(const VxImageDescEx& desc)


CKStateChunk::ReadStringUntilZero

Method CKStateChunk::ReadStringUntilZero

int CKStateChunk::ReadStringUntilZero(char* str, int maxSize)

Remarks

returns the length of the string including the terminating null caracter (str must already be allocated)


CKStateChunk::WriteReaderBitmap

Method CKStateChunk::WriteReaderBitmap

void CKStateChunk::WriteReaderBitmap(const VxImageDescEx& desc,CKBitmapReader* reader,CKBitmapProperties* bp)


CKStateChunk::ReadBitmap

Method CKStateChunk::ReadBitmap

BITMAP_HANDLE CKStateChunk::ReadBitmap()

Reads the image data from chunk and creates a bitmap from it.

Returns

Handle to the Bitmap created.

Remarks

Depending upon the image format, respective reader is selected. A plug in to support I/O of various file formats is required.

See Also

WriteBitmap


CKStateChunk::ReadBitmap2

Method CKStateChunk::ReadBitmap2

BYTE* CKStateChunk::ReadBitmap2(VxImageDescEx& bdesc)

Returns the image data read from the chunk.

Parameters

Input argument bdesc

Image Description

Returns

NULL if no Image Data in the chunk else Buffer containing the Image data.

Remarks

A plug in is required to read a specific image format.

See Also

ReadBitmap, WriteBitmap


CKStateChunk::ReadRawBitmap

Method CKStateChunk::ReadRawBitmap

BYTE* CKStateChunk::ReadRawBitmap(VxImageDescEx& desc)

Returns raw bitmap data and fills the Image Description.

Parameters

Input argument desc

Image description to fill.

Returns

Buffer with image data of the bitmap if successful, NULL otherwise.

Remarks

Converts raw bit map data read from chunk to the VxImageDescEx format. Image description contains its height, width, colormasks, bits per pixel and Image Data. Raw bitmap data contains RGBA values.

See Also

WriteRawBitmap


CKStateChunk::WriteBitmap

Method CKStateChunk::WriteBitmap

void CKStateChunk::WriteBitmap(BITMAP_HANDLE bitmap,CKSTRING ext)

Writes the given bitmap handle into the chunk.

Parameters

Input argument bitmap | Handle of the bitmap to be written to chunk.
Input argument ext | A string to specify File format.

Remarks

Writes the bitmap data along with the format specifier. A plug in to support I/O of various file formats is required.

See Also

ReadBitmap


CKStateChunk::WriteRawBitmap

Method CKStateChunk::WriteRawBitmap

void CKStateChunk::WriteRawBitmap(const VxImageDescEx& desc)

Writes the given Image Data in raw bitmap format

Parameters

Input argument desc

Image description.

Remarks

Converts the given Imange data into raw bitmap data and writes it to chunk. Image must be 32 bits.

See Also

ReadRawBitmap


CKStateChunk::AddChunk

Method CKStateChunk::AddChunk

void CKStateChunk::AddChunk(CKStateChunk *chunk)

Appends the given chunk.

Parameters

Input argument chunk

Chunk to be appended.

Remarks

Appends the chunk to this chunk, Memory allocated to argument chunk is not deleted. Endian architectures are taken care.

See Also

AddChunkAndDelete


CKStateChunk::AddChunkAndDelete

Method CKStateChunk::AddChunkAndDelete

void CKStateChunk::AddChunkAndDelete(CKStateChunk *chunk)

Appends the given chunk.

Parameters

Input argument chunk

Chunk to be appended.

Remarks

Appends the chunk to this chunk, Memory allocated to argument chunk is deleted. Endian architectures are taken care.

See Also

AddChunk


CKStateChunk::Clear

Method CKStateChunk::Clear

void CKStateChunk::Clear()

Clears an instance of CKStateChunk

Remarks

Clears an instance of CKStateChunk, deletes and initiates all data members to null.

See Also

StartRead, StartWrite


CKStateChunk::Clone

Method CKStateChunk::Clone

void CKStateChunk::Clone(CKStateChunk *chunk)

Copies an instance of CKStateChunk to this chunk.

Parameters

Input argument chunk

Pointer to chunk that is to be copied.

Remarks

Copies the data of an instance of CKStateChunk to current chunk object.

See Also

Clear, StratRead, StartWrite


CKStateChunk::CloseChunk

Method CKStateChunk::CloseChunk

void CKStateChunk::CloseChunk()

Closes a chunk.

Remarks

When you have finished writing, call this fucntion to finalize the chunk. The data size is updated and consistent after this function.

See Also

StartWrite


CKStateChunk::GetChunkClassID

Method CKStateChunk::GetChunkClassID

CK_CLASSID CKStateChunk::GetChunkClassID()

Gives the class id of CKStateChunk.

Returns

Class ID of the chunk.

See Also

GetChunkVersion, GetDataVersion


CKStateChunk::GetChunkVersion

Method CKStateChunk::GetChunkVersion

short int CKStateChunk::GetChunkVersion()

Gives the version number of CKStateChunk.

Returns

Version number of the chunk.

See Also

GetChunkClassID, GetDataVersion


CKStateChunk::GetCurrentPos

Method CKStateChunk::GetCurrentPos

int CKStateChunk::GetCurrentPos()

Gives the current position of the read/write cursor in the buffer of the chunk.

Returns

Current position in the chunk.

Remarks

Returns -1 if reader is not present, else the current position.

See Also

CKSaveObjectStates


CKStateChunk::GetDataSize

Method CKStateChunk::GetDataSize

int CKStateChunk::GetDataSize()

Gives the size of Data in the chunk

Returns

Size of data in the chunk.

See Also

UpdateDataSize


CKStateChunk::GetDataVersion

Method CKStateChunk::GetDataVersion

short int CKStateChunk::GetDataVersion()

Gives the version number of Data in the chunk

Returns

Version number of data in the chunk.

See Also

GetChunkVersion, GetChunkClassID


CKStateChunk::Goto

Method CKStateChunk::Goto

void CKStateChunk::Goto(int DwordOffset)

Sets current position of the read/write buffer of the chunk to the specified position.

Parameters

Input argument DwordOffset

Position in a chunk to be set.

Remarks

Goto does not check for position validity.

See Also

CKSaveObjectStates


CKStateChunk::LockReadBuffer

Method CKStateChunk::LockReadBuffer

void* CKStateChunk::LockReadBuffer()

Returns a pointer to the chunk buffer at the current read position.

Returns

A pointer to the statechunk databuffer at the current read position if read buffer is present, else returns NULL.

See Also

LockWriteBuffer, Skip


CKStateChunk::LockWriteBuffer

Method CKStateChunk::LockWriteBuffer

void* CKStateChunk::LockWriteBuffer(int DwordCount)

Returns a buffer at the current write position in the StateChunk.

Parameters

Input argument DwordCount

Size of the buffer to be allocated.

Returns

Returns a buffer at the current write position in the StateChunk of at least DwordCount if write buffer is present, else returns NULL

Remarks

This function can be used to copy data in it in the desired order, To advance the write position Skip method can be used(usually with the same DwordCount)

See Also

LockReadBuffer, Skip


CKStateChunk::ReadIdentifier

Method CKStateChunk::ReadIdentifier

CKDWORD CKStateChunk::ReadIdentifier()

Reads identifier from chunk.

Returns

identifier read from the chunk.

Remarks

Usefull only if you are sure you are positionned onto an identifier, to read its value. Takes care of Little/Big Endian architectures into account. To search for an identifier, use SeekIdentifier

See Also

WriteIdentifier, SeekIdentifier


CKStateChunk::SetDataVersion

Method CKStateChunk::SetDataVersion

void CKStateChunk::SetDataVersion(short int version)

Sets the version number of Data in the chunk

Parameters

Input argument version

Version number of data in the chunk.

See Also

GetDataVersion


CKStateChunk::Skip

Method CKStateChunk::Skip

void CKStateChunk::Skip(int DwordCount)

Skips specified number of CKDWORDs from read/write buffer of the chunk from its current position.

Parameters

Input argument DwordCount

CKDWORD count from current position in the read/write buffer to be skipped.

Remarks

The count is in length of CKDWORD. Skip extends the buffer if skipping outside of the allocated data.

See Also

CKSaveObjectStates


CKStateChunk::StartRead

Method CKStateChunk::StartRead

void CKStateChunk::StartRead()

Initialises the reader parameters.

Remarks

You must call this function before reading data from a chunk. Initialises reader's current & previous identifier positions to 0. If the chunk has no reader, a new one is created.

See Also

StartWrite


CKStateChunk::StartWrite

Method CKStateChunk::StartWrite

void CKStateChunk::StartWrite()

Initialises the writer parameters.

Remarks

You must call this function once before starting to write. Initialises writer's current & previous identifier positions to 0. If the chunk has no writer, a new one is created.

See Also

StartRead, CloseChunk


CKStateChunk::WriteIdentifier

Method CKStateChunk::WriteIdentifier

void CKStateChunk::WriteIdentifier(CKDWORD id)

Writes given identifier to chunk.

Parameters

Input argument id

identifier to be written.

Remarks

An identifier is a CKDWORD that can easily be retrieved when reading back the chunk. Takes care of Little/Big Endian architectures into account.

See Also

ReadIdentifier, SeekIdentifier


CKStateChunk::SeekIdentifier

Method CKStateChunk::SeekIdentifier

CKBOOL CKStateChunk::SeekIdentifier(CKDWORD id)

Searches the given Id in the chunk data.

Parameters

Input argument id

identifier to be searched

Returns

TRUE if identifier given is found in the data, FALSE otherwise.

Remarks

Searches the given identifier in the data. The reading cursor is then placed just after the identifier. If you want to know the size of the data written after the identifier, use SeekIdentifierAndReturnSize

See Also

WriteIdentifier, SeekIdentifierAndReturnSize


CKStateChunk::SeekIdentifierAndReturnSize

Method CKStateChunk::SeekIdentifierAndReturnSize

int CKStateChunk::SeekIdentifierAndReturnSize(CKDWORD id)

Searches the given identifer in the chunk data and returns the size corresponding to data written after it.

Parameters

Input argument id

identifier to be searched

Returns

Data size for the data with given identifier. -1 if the identifier is not found.

Remarks

Searches the given ID in the data, and returns the data size for that data entry. allows to write an array of fixed size elements just after an identifier and being able to know their number when reading them back just by divising the size of the identifier by the fixed size of an element.

See Also

WriteIdentifier, SeekIdentifier


CKStateChunk::ReadManagerInt

Method CKStateChunk::ReadManagerInt

int CKStateChunk::ReadManagerInt(CKGUID* Manager)

Returns the value read and fills GUID data of the manager from Manager sequece.

Parameters

Input argument Manager

Pointer to a GUID of the manager.

Returns

The value read.

See Also

StartManagerSequence, WriteManagerSequence, ReadManagerIntSequence, WriteManagerInt


CKStateChunk::ReadManagerIntSequence

Method CKStateChunk::ReadManagerIntSequence

int CKStateChunk::ReadManagerIntSequence()

Returns the value read from a manager sequece.

Returns

The current value read in manager sequece.

See Also

StartManagerSequence, StartManagerReadSequence


CKStateChunk::StartManagerReadSequence

Method CKStateChunk::StartManagerReadSequence

int CKStateChunk::StartManagerReadSequence(CKGUID *Manager)

Gets GUID of the manager and length of manager sequence.

Parameters

Input argument Manager

Pointer to a CKGUID of the manager.

Returns

Length of the Manager sequence.

See Also

StartManagerSequence, ReadManagerIntSequence


CKStateChunk::StartManagerSequence

Method CKStateChunk::StartManagerSequence

void CKStateChunk::StartManagerSequence(CKGUID man,int count)

Creates a new sequence of Managers.

Parameters

Input argument man | guid of the manager to be added.
Input argument count | Length of the manager sequence.

Remarks

Number of Manager present in the sequence must be pre decided.

See Also

WriteManagerSequence


CKStateChunk::WriteManagerInt

Method CKStateChunk::WriteManagerInt

void CKStateChunk::WriteManagerInt(CKGUID Manager,int val)

Writes data and GUID of the manager into the state chunk.

Parameters

Input argument Manager | GUID of the manager.
Input argument val | Data to be written.

Remarks

You should use StartManagerSequence and WriteManagerSequence instead to write a bunch of data.

See Also

StartManagerSequence, WriteManagerSequence


CKStateChunk::WriteManagerSequence

Method CKStateChunk::WriteManagerSequence

void CKStateChunk::WriteManagerSequence(int val)

Writes data into a Manager sequece.

Parameters

Input argument val

Data to be written.

Remarks

You must not write more data than precised in the StartManagerSequence.

See Also

StartManagerSequence, WriteManagerInt


CKStateChunk::ReadAndFillBuffer

Method CKStateChunk::ReadAndFillBuffer

void CKStateChunk::ReadAndFillBuffer(int size,void* buffer)
void CKStateChunk::ReadAndFillBuffer(void* buffer)
void CKStateChunk::ReadAndFillBuffer_LEndian(void* buffer)
void CKStateChunk::ReadAndFillBuffer_LEndian16(void* buffer)

Reads a buffer.

Parameters

Input argument size | Size of data to be read instead of calculating the size from CKDWORD.
buffer | Pointer to the buffer to be filled.

Remarks

Reads a buffer from current positon of chunk. Takes care of Endian problems. ReadAndFillBuffer : read a buffer of CKBYTE ReadAndFillBuffer_LEndian : read a buffer of CKDWORD ReadAndFillBuffer_LEndian16 : read a buffer of CKWORD

See Also

ReadBuffer, ReadAndFillBuffer_LEndian, ReadAndFillBuffer_LEndian16


CKStateChunk::ReadBuffer

Method CKStateChunk::ReadBuffer

int CKStateChunk::ReadBuffer(void** buffer)

Reads a buffer of CKBYTE.

Parameters

Input argument buffer

Pointer to the buffer address to be created.

Returns

Size of data that is read.

Remarks

Reads a buffer from current positon of chunk. Required memory for the buffer is allocated. Takes care of Endian problems. The client must take care of the buffer deletion.

See Also

ReadAndFillBuffer, WriteBuffer


CKStateChunk::ReadByte

Method CKStateChunk::ReadByte

CKBYTE CKStateChunk::ReadByte()

Reads a byte.

Returns

Byte that is read at the current position.

Remarks

takes care of endian problems.

See Also

WriteByte


CKStateChunk::ReadDword

Method CKStateChunk::ReadDword

CKDWORD CKStateChunk::ReadDword()

Reads a CKDWORD.

Returns

CKDWORD that is read at the current position.

Remarks

Takes care of endian problems.

See Also

WriteDword


CKStateChunk::ReadDwordAsWords

Method CKStateChunk::ReadDwordAsWords

CKDWORD CKStateChunk::ReadDwordAsWords()

Reads a CKDWORD as 2 CKWORD.

Returns

DWord that is read as words.

Remarks

Takes care of endian problems.

See Also

WriteDwordAsWords, CKDWORD, CKWORD


CKStateChunk::ReadFloat

Method CKStateChunk::ReadFloat

float CKStateChunk::ReadFloat()

Reads a float value.

Returns

Float value that is read.

See Also

WriteFloat


CKStateChunk::ReadGuid

Method CKStateChunk::ReadGuid

CKGUID CKStateChunk::ReadGuid()

Reads a GUID.

Returns

GUID that is read.

Remarks

Takes care of endian problems.

See Also

WriteGuid


CKStateChunk::ReadInt

Method CKStateChunk::ReadInt

int CKStateChunk::ReadInt()

Reads an integer.

Returns

Integer that is read at the current position.

Remarks

Takes care of endian problems.

See Also

WriteInt


CKStateChunk::ReadMatrix

Method CKStateChunk::ReadMatrix

void CKStateChunk::ReadMatrix(VxMatrix& mat)

Reads a matrix.

Parameters

Input argument mat

Matrix to be read.

Remarks

Takes care of Endian problems.

See Also

WriteMatrix


CKStateChunk::ReadString

Method CKStateChunk::ReadString

int CKStateChunk::ReadString(XString& oString)
int CKStateChunk::ReadString(CKSTRING* str)
XString CKStateChunk::ReadString()

Reads a string.

Parameters

Input argument str

String to be filled after reading.

Returns

Length of the string that is read.

Remarks

returns the length of the string including the terminating null caracter

See Also

CKSaveObjectStates, WriteString


CKStateChunk::ReadVector

Method CKStateChunk::ReadVector

void CKStateChunk::ReadVector(VxVector& v)
void CKStateChunk::ReadVector(VxVector* v)

Reads a vector.

Parameters

&v : Vector to be read, passed by reference. *v : Vector to be read, Pointer to vector is passed as argument.

Remarks

Takes care of Endian problems.

See Also

WriteVector


CKStateChunk::ReadWord

Method CKStateChunk::ReadWord

CKWORD CKStateChunk::ReadWord()

Reads a CKWORD.

Returns

Word that is read at the current position.

Remarks

Takes care of endian problems.

See Also

WriteWord


CKStateChunk::WriteBuffer

Method CKStateChunk::WriteBuffer

void CKStateChunk::WriteBuffer(int size,void *buf)
void CKStateChunk::WriteBuffer_LEndian(int size,void *buf)
void CKStateChunk::WriteBuffer_LEndian16(int size,void *buf)
void CKStateChunk::WriteBufferNoSize(int size,void *buf)
void CKStateChunk::WriteBufferNoSize_LEndian(int size,void *buf)
void CKStateChunk::WriteBufferNoSize_LEndian16(int size,void *buf)

Writes buffer of specified size.

Parameters

Input argument size | size of the buffer to be written.
Input argument buf | pointer to the buffer.

Remarks

If buffer is null it writes 0. The effective size occupied is multiple of 4 (bytes). use WriteBuffer to write an array of CKBYTE (or char) use WriteBuffer_LEndian to write an array of CKDWORD (or float) use WriteBuffer_LEndian16 to write an array of CKWORD use WriteBufferNoSize to write an array of CKBYTE with a fixed, supposed known size (the size is not written) WriteBufferNoSize_LEndian : same as WriteBufferNoSize for CKDWORDs. WriteBufferNoSize_LEndian16 : same as WriteBufferNoSize for CKWORDs.

See Also

ReadBuffer


CKStateChunk::WriteByte

Method CKStateChunk::WriteByte

void CKStateChunk::WriteByte(CKCHAR byte)

Writes a byte.

Parameters

Input argument byte

Byte to be written

Remarks

takes in fact the space of a CKDWORD in the chunk. takes care of endian problems.

See Also

ReadByte


CKStateChunk::WriteDword

Method CKStateChunk::WriteDword

void CKStateChunk::WriteDword(CKDWORD data)

Writes a CKDWORD.

Parameters

Input argument data

CKDWORD that is to be written.

Remarks

Takes care of endian problems.

See Also

ReadDword


CKStateChunk::WriteDwordAsWords

Method CKStateChunk::WriteDwordAsWords

void CKStateChunk::WriteDwordAsWords(CKDWORD data)

Writes a CKDWORD as 2 CKWORDs.

Parameters

Input argument data

DWord that is to be written as words.

Remarks

Takes care of endian problems.

See Also

ReadDwordAsWords, CKDWORD, CKWORD


CKStateChunk::WriteFloat

Method CKStateChunk::WriteFloat

void CKStateChunk::WriteFloat(float data)

Writes a float value.

Parameters

Input argument data

Float data to be written.

See Also

ReadFloat


CKStateChunk::WriteGuid

Method CKStateChunk::WriteGuid

void CKStateChunk::WriteGuid(CKGUID data)

Writes a GUID.

Parameters

Input argument data

GUID that is to be written.

Remarks

Takes care of endian problems.

See Also

ReadGuid


CKStateChunk::WriteInt

Method CKStateChunk::WriteInt

void CKStateChunk::WriteInt(int data)

Writes an integer.

Parameters

Input argument data

Integer that is to be written.

Remarks

Takes care of endian problems.

See Also

ReadInt


CKStateChunk::WriteMatrix

Method CKStateChunk::WriteMatrix

void CKStateChunk::WriteMatrix(const VxMatrix& mat)

Writes a matrix.

Parameters

Input argument mat

Matrix to be written.

Remarks

Takes care of Endian problems.

See Also

ReadMatrix


CKStateChunk::WriteString

Method CKStateChunk::WriteString

void CKStateChunk::WriteString(const char* str)

Writes a string.

Parameters

Input argument str

String to be written.

Remarks

Writes the string including its null byte.

See Also

ReadString


CKStateChunk::WriteVector

Method CKStateChunk::WriteVector

void CKStateChunk::WriteVector(const VxVector& v)
void CKStateChunk::WriteVector(const VxVector* v)

Writes a vector.

Parameters

&v : Vector to write, passed by reference. *v : Vector to write, Pointer to vector is passed as argument.

Remarks

Takes care of Endian problems.

See Also

ReadVector


CKStateChunk::WriteWord

Method CKStateChunk::WriteWord

void CKStateChunk::WriteWord(CKWORD data)

Writes a CKWORD.

Parameters

Input argument data

word to be written

Remarks

takes care of endian problems.

See Also

ReadWord


CKStateChunk::ReadObject

Method CKStateChunk::ReadObject

CKObject* CKStateChunk::ReadObject(CKContext* context)

Returns an object of the given context from the chunk.

Parameters

Input argument context

Pointer to a Context.

Returns

Object that is present in the given context whose id is read.

Remarks

It reads an object of the context from the chunk. It can be use to read back IDs written with the WriteObjectID function or the WriteObjectIDSequence Returns NULL if the read id is not in the context given.

See Also

WriteObjectID


CKStateChunk::ReadObjectID

Method CKStateChunk::ReadObjectID

CK_ID CKStateChunk::ReadObjectID()

Reads an object ID from the chunk.

Returns

Object Id.

Remarks

It reads an object ID from the chunk. It can be use to read back IDs written with the WriteObjectID function or the WriteObjectIDSequence

See Also

ReadObject, WriteObjectID, WriteObjectIDSequence


CKStateChunk::StartObjectIDSequence

Method CKStateChunk::StartObjectIDSequence

void CKStateChunk::StartObjectIDSequence(int count)

Creates a new object ID sequence in the chunk.

Parameters

Input argument count

Number of Object IDs which are to be written.

Remarks

count has to be predecided before creating the sequence.

See Also

ReadObjectID, WriteObjectIDSequence, WriteObjectSequence


CKStateChunk::StartReadSequence

Method CKStateChunk::StartReadSequence

int CKStateChunk::StartReadSequence()

Returns the number of data written in a sequence..

Returns

Number of elements in the sequence.

Remarks

This function works with sequence of object IDs and sequence of sub chunks.

See Also

StartObjectIDSequence, StartSubChunkSequence


CKStateChunk::WriteObjectID

Method CKStateChunk::WriteObjectID

void CKStateChunk::WriteObjectID(CK_ID id)
void CKStateChunk::WriteObject(CKObject *obj)

Writes the given object ID to the chunk.

Parameters

Input argument id

Object Id to be written. obj : Pointer to an object to be written.

Remarks

It writes the given object ID to the chunk but some more information is written to the chunk to identify taht an object ID lies here. To write many object ids in a row, use WriteObjectIDSequence instead.

See Also

ReadObjectID,WriteObjectIDSequence


CKStateChunk::WriteObjectIDSequence

Method CKStateChunk::WriteObjectIDSequence

void CKStateChunk::WriteObjectIDSequence(CK_ID id)
void CKStateChunk::WriteObjectSequence(CKObject* obj)

Writes an object ID to the chunk

Parameters

Input argument id

Id of the object to be written. object: Pointer on the object to be written

Remarks

It writes only the given object id to chunk. You have to start an ObjectID sequence before using these functions. The object id is written even if it is 0, or a NULL pointer.

See Also

StartObjectIDSequence,ReadObjectIDSequence


CKStateChunk::StartSubChunkSequence

Method CKStateChunk::StartSubChunkSequence

void CKStateChunk::StartSubChunkSequence(int count)

Creates a new subchunk branch.

Parameters

Input argument count

Number of sub chunks required.

Remarks

Length of the Subchunk sequence is pre decided.

See Also

WriteSubChunkSequence, StartReadSequence


CKStateChunk::WriteSubChunk

Method CKStateChunk::WriteSubChunk

void CKStateChunk::WriteSubChunk(CKStateChunk *chunk)

Writes a subchunk into a chunk.

Parameters

Input argument chunk

Chunk from which data have to be written.

Remarks

Allows to compound a chunk with others. To write several chunks in a row, use the tandem StartSubChunkSequence / WriteSubChunkSequence instead.

See Also

WriteSubChunkSequence,ReadSubChunk


CKStateChunk::WriteSubChunkSequence

Method CKStateChunk::WriteSubChunkSequence

void CKStateChunk::WriteSubChunkSequence(CKStateChunk *chunk)

Writes a subchunk into a chunk.

Parameters

Input argument chunk

Chunk from which data have to be written.

Remarks

Allows to compound a chunk with others. The sequence must be started before using this function with StartSubChunkSequence.

See Also

StartSubChunkSequence,ReadSubChunk


CKStateChunk::ReadSubChunk

Method CKStateChunk::ReadSubChunk

enum CK_READSUBCHUNK_FLAGS {
CK_RSC_DEFAULT = 0,
CK_RSC_SKIP = 1,
CK_RSC_SCRATCH = 2,
}
CKStateChunk * CKStateChunk::ReadSubChunk(CK_READSUBCHUNK_FLAGS Flags)

Members

CK_RSC_DEFAULT | Default Behavior
CK_RSC_SCRATCH | Returned chunk will be allocated in a scratch pool (for temporary usages).
CK_RSC_SKIP | Just skip the sub chunk, returning NULL and advancing the read cursor.


CKStateObject

Class CKStateObject

Class managing a global state mechanism

CKObject
Show brief derivation trees

CKStateObject

CKObject
Show full derivation trees

CKStateObject

Remarks

A StateObject describes a global state variable that can be TRUE if EnterState is called or FALSE is ExitState is called. This variable is identified by a name and can be checked through IsStateActive. This class is mainly used by the corresponding parameter type CKPGUID_STATE.

The class id of CKStateObject is CKCID_STATE

Groups

Operations
Method EnterState | Activates a CKStateObject.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method IsStateActive | Returns the activity of a CKStateObject
Method LeaveState | Deactivates a CKStateObject.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)


CKStateObject::EnterState

Method CKStateObject::EnterState

void CKStateObject::EnterState()

Activates a CKStateObject.

Remarks

If the CKStateObject was already active, nothing happens.

See Also

IsStateActive,LeaveState


CKStateObject::IsStateActive

Method CKStateObject::IsStateActive

CKBOOL CKStateObject::IsStateActive()

Returns the activity of a CKStateObject

Returns

TRUE if the state is active, FALSE otherwise

See Also

EnterState,LeaveState


CKStateObject::LeaveState

Method CKStateObject::LeaveState

void CKStateObject::LeaveState()

Deactivates a CKStateObject.

Remarks

If the CKStateObject was already inactive, nothing happens.

See Also

IsStateActive,EnterState


CKSynchroObject

Class CKSynchroObject

Class managing a rendez-vous mechanism

CKObject
Show brief derivation trees

CKSynchroObject

CKObject
Show full derivation trees

CKSynchroObject

Remarks

Synchro Object are used in the Interface to create a Rendez-vous mechanism. Objects register themselves as arrived to a rendez-vous and ask for the permission to pass, this permission is granted when the specified number of object have arrived.

This class is mainly used by the corresponding parameter type CKPGUID_SYNCHRO.

The class id of CKSynchroObject is CKCID_SYNCHRO

Groups

Operations
Method CanIPassRendezVous | Registers an object as arrived to the rendez-vous and returns TRUE if everybody is arrived
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method GetRendezVousArrivedObject | Returns the object arrived at the given position
Method GetRendezVousNumberOfArrivedObjects | Returns the number of arrived objects at the rendez-vous so far.
Method GetRendezVousNumberOfWaiters | Returns the number of token waited for a RendezVous Object to be validated
Method Reset | Resets the rendez-vous
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Method SetRendezVousNumberOfWaiters | Sets the number of token waited for a RendezVous Object to be validated


CKSynchroObject::CanIPassRendezVous

Method CKSynchroObject::CanIPassRendezVous

CKBOOL CKSynchroObject::CanIPassRendezVous(CKBeObject *asker)

Registers an object as arrived to the rendez-vous and returns TRUE if everybody is arrived

Parameters

Input argument asker

A Pointer to a CKObject identifying the object asking for the Rendez-Vous.

Returns

TRUE if everybody is here, FALSE otherwise.

Remarks

The first time an object use this function, it registers itself as arrived to the rendez-vous , if everybody is here, it is granted acces otherwise further calls to the functions must be done until everybody have arrived to the rendez-vous

See Also

GetRendezVousNumberOfArrivedObjects,GetRendezVousArrivedObject,Reset


CKSynchroObject::GetRendezVousArrivedObject

Method CKSynchroObject::GetRendezVousArrivedObject

CKBeObject* CKSynchroObject::GetRendezVousArrivedObject(int pos)

Returns the object arrived at the given position

Parameters

position, in the order of arrival, of the object

Returns

the object at the given position

Remarks

the position starts to 0 and goes to GetRendezVousNumberOfArrivedObjects()-1.

See Also

GetRendezVousNumberOfArrivedObjects,CanIPassRendezVous


CKSynchroObject::GetRendezVousNumberOfArrivedObjects

Method CKSynchroObject::GetRendezVousNumberOfArrivedObjects

int CKSynchroObject::GetRendezVousNumberOfArrivedObjects()

Returns the number of arrived objects at the rendez-vous so far.

Returns

number of objects arrived.

See Also

GetRendezVousArrivedObject,CanIPassRendezVous


CKSynchroObject::GetRendezVousNumberOfWaiters

Method CKSynchroObject::GetRendezVousNumberOfWaiters

int CKSynchroObject::GetRendezVousNumberOfWaiters()

Returns the number of token waited for a RendezVous Object to be validated

Returns

A integer giving the current number of token needed to validate the Rendez-vous

See Also

SetRendezVousNumberOfWaiters


CKSynchroObject::Reset

Method CKSynchroObject::Reset

void CKSynchroObject::Reset()

Resets the rendez-vous

Remarks

All the objects already arrived are discarded.

See Also

CanIPassRendezVous


CKSynchroObject::SetRendezVousNumberOfWaiters

Method CKSynchroObject::SetRendezVousNumberOfWaiters

void CKSynchroObject::SetRendezVousNumberOfWaiters(int waiters)

Sets the number of token waited for a RendezVous Object to be validated

Parameters

Input argument waiters

The number of token needed to validate the Rendez-vous

See Also

GetRendezVousNumberOfWaiters


Container classes

CKObjects containers

Class CKObjectArray | Array of CKObject instances
Class XObjectArray | Container class for CKObject Id's.
Class XObjectPointerArray | Container class for CKObject pointers.
Class XSObjectArray | Container class for CKObject Id's
Class XSObjectPointerArray | Container class for CKObject pointers.

See Also

Miscellaneous Classes


CKObjectArray

Class CKObjectArray

Array of CKObject instances

Remarks

This class is provided for compatibilty reasons and should not be used except for methods that require it explicitely. Use XObjectArray or XObjectPointerArray instead.

Provides utilities for storing, retrieving, iterating arrays of instances of CKObject and derived classes. The CKObjectArray instance uses a pointer to walk along to object it stores. Retrieval, deletion and insertions are done relatively to this current object pointer. The CKObjectArray is basically implemented as a linked list of global IDs.

Objects can be retrieved by position, ID, pointer or name. To get to an object, use the corresponding method to move the current object pointer (PtrSeek, IDSeek, NameSeek, PositionSeek). Then get the object using GetData.

As object may be deleted at any time, some object stored in CKObjectArray instances may not be valid when they are retrieved with GetData. In this case, methods like GetData or Next return NULL even though there are more objects in the array. Thus, in order to iterate to the end of the list, you should use EndOfList to check if the end of the list is reached, instead of using Next.

Do not use constructions like:

array->Reset();
while(tmp = array->Next())
{
    [...use tmp ...]
}

But use:

for(array->Reset() ;!array->EndOfList(); array->Next())
{
    tmp = array->GetData();
    [.. check and use tmp ...]
}

The objects are stored linearly. So seek time speed is O(n), deletion and insertion speed are O(1).

CKObjectArray is not derived from CKObject,so it does not conform to the memory management scheme of CKObject. CKObjectArray must be created and deleted through the global functions CreateCKObjectArray and DeleteCKObjectArray

Groups

Operations
Method AddIfNotHere | Inserts the object at the end of the array, if it is not yet present
Method AddIfNotHereSorted |
Method Append | Adds all objects from another array to this one
Method Check | Checks the list for invalid (NULL) objects.
Method Clear | Removes all objects from the array
Method EndOfList | Returns TRUE if at the end of the array
Method GetCount | Returns the number of elements of the array
Method GetCurrentPos | Returns the current position in the array
Method GetData | Returns the current object
Method GetDataId | Returns the current object's ID
Method GetPosition | Returns the position of the object in the array
Method IDFind | Checks an object's presence by ID without changing the current position
Method IDSeek | Seeks an object in array by global ID
Method InsertAt | Inserts the object before the current position
Method InsertFront | Insert an element at the start of the array
Method InsertRear | Inserts the object at the end of the array
Method InsertSorted | Inserts an entity and sorts the array elements.
Method ListEmpty | Returns 1 if the array is empty
Method Next | Increments the current position
Method PositionFind | Checks an object's presence by position without changing the current position
Method PositionSeek | Move The current array position to Pos
Method Previous | Decrements the current position
Method PtrFind | Checks an object's presence by pointer without changing the current position
Method PtrSeek | Seeks an object in array by pointer
Method Remove | Removes an object from the array
Method RemoveAt | Removes the current object from the array
Method RemoveFront | Removes the first element in the array
Method RemoveRear | Removes the last object from the array
Method Reset | Set the current position to the start of the list
Method Seek | Seeks an object in array by position
Method SetData |
Method SetDataId |
Method SwapCurrentWithNext | Swap the current object with the next in the list.
Method SwapCurrentWithPrevious | Swap the current object with the previous in the list.
Type Definitions
Method Sort | Sorts the array elements.

See Also

CreateCKObjectArray, DeleteCKObjectArray


CKObjectArray::AddIfNotHere

Method CKObjectArray::AddIfNotHere

CKBOOL CKObjectArray::AddIfNotHere(CK_ID id)
CKBOOL CKObjectArray::AddIfNotHere(CKObject *obj)

Inserts the object at the end of the array, if it is not yet present

Parameters

Input argument id

The identifier of the object to insert

Returns

0 if the object was already present ,1 otherwise

Remarks

Chekc if the object is already present in the array. If not, inserts it at the end of the array, like InsertRear.

See Also

InsertFront, AddIfNotHere, InsertRear


CKObjectArray::AddIfNotHereSorted

Method CKObjectArray::AddIfNotHereSorted

CKBOOL CKObjectArray::AddIfNotHereSorted(CK_ID id,OBJECTARRAYCMPFCT CmpFct,CKContext* context)
CKBOOL CKObjectArray::AddIfNotHereSorted(CKObject *obj,OBJECTARRAYCMPFCT CmpFct,CKContext* context)


CKObjectArray::Append

Method CKObjectArray::Append

CKERROR CKObjectArray::Append(CKObjectArray *array)

Adds all objects from another array to this one

Parameters

Input argument array

the other array

Returns

CK_OK if successful, an error code otherwise

Remarks

Does an InsertRear on all the object in the otherArray, in the same order as in the other array.

See Also

InsertRear


CKObjectArray::Check

Method CKObjectArray::Check

CKBOOL CKObjectArray::Check(CKContext* context)

Checks the list for invalid (NULL) objects.

Parameters

Input argument context

A pointer to a CKContext.

Returns

TRUE if invalid objects were removed, FALSE otherwise.


CKObjectArray::Clear

Method CKObjectArray::Clear

void CKObjectArray::Clear()

Removes all objects from the array

Remarks

Removes all objects from the array.

See Also

RemoveFront


CKObjectArray::EndOfList

Method CKObjectArray::EndOfList

CKBOOL CKObjectArray::EndOfList()

Returns TRUE if at the end of the array

Returns

1 if at the end of the array

Remarks

Returns 1 if the current object pointer is at the end of the array. Useful for building iteration loops.

See Also

GetCount


CKObjectArray::GetCount

Method CKObjectArray::GetCount

int CKObjectArray::GetCount()

Returns the number of elements of the array

Returns

The number of elements of the array

See Also

GetCurrentPos, EndOfList


CKObjectArray::GetCurrentPos

Method CKObjectArray::GetCurrentPos

int CKObjectArray::GetCurrentPos()

Returns the current position in the array

Returns

The current position in the array

Remarks

Returns the position of the current object pointer in the array. -1 if undefined.

See Also

GetCount,PositionFind,PositionSeek


CKObjectArray::GetData

Method CKObjectArray::GetData

CKObject *CKObjectArray::GetData(CKContext* context)

Returns the current object

Returns

The current object

Remarks

Returns the current object, or NULL if no current object. The current object is the object pointed to by the current object pointer. Basically, you move the current object pointer along the array, and get to the underlying object with GetData. The current object is NULL if the array is empty or if the pointer is at the end of the array.

See Also

GetDataId, GetCount, GetCurrentPos, EndOfList


CKObjectArray::GetDataId

Method CKObjectArray::GetDataId

CK_ID CKObjectArray::GetDataId()

Returns the current object's ID

Returns

The current object's ID

Remarks

Returns the global ID of the current object.

See Also

GetData, GetCount, GetCurrentPos, EndOfList


CKObjectArray::GetPosition

Method CKObjectArray::GetPosition

int CKObjectArray::GetPosition(CKObject *o)
int CKObjectArray::GetPosition(CK_ID id)

Returns the position of the object in the array

Parameters

Input argument o | the object of which to find the position
Input argument id | CK_ID of the object to find the position

Returns

The position of the object in the array.

Remarks

If the object is found returns the object's position in the array. If not found the returned value is -1.

See Also

PtrSeek


CKObjectArray::IDFind

Method CKObjectArray::IDFind

CK_ID CKObjectArray::IDFind(CK_ID ckid)

Checks an object's presence by ID without changing the current position

Parameters

Input argument ckid

the global ID of the object to find

Returns

The pointer to the object or NULL.

Remarks

If the corresponding object is found, returns a pointer to it, but the current object pointer of the array is not changed.

See Also

NameFind, PtrFind, PositionFind


CKObjectArray::IDSeek

Method CKObjectArray::IDSeek

CKBOOL CKObjectArray::IDSeek(CK_ID id)

Seeks an object in array by global ID

Parameters

Input argument id

the global ID to seek

Returns

TRUE if the ID is present

Remarks

If the Object is present the new current position is the object else we are at the end of the list. If the object is in the list, you can get it with GetGata.

See Also

PtrSeek, NameSeek, PositionSeek, GetGata


CKObjectArray::InsertAt

Method CKObjectArray::InsertAt

void CKObjectArray::InsertAt(CK_ID id)
void CKObjectArray::InsertAt(CKObject *vxm)

Inserts the object before the current position

Parameters

Input argument id

The identifier of the object to insert

Remarks

This method insert the given object before the current position.

See Also

InsertFront, AddIfNotHere, InsertRear


CKObjectArray::InsertFront

Method CKObjectArray::InsertFront

void CKObjectArray::InsertFront(CKObject *obj)
void CKObjectArray::InsertFront(CK_ID id)

Insert an element at the start of the array

Parameters

Input argument obj | A pointer to the object to insert vxm : The object to insert
Input argument id | The identifier of the object to insert

Remarks

Inserts the object's ID as the first element of the array. The current object pointer is unchanged, that is it points to the same object as before the call to InsertFront. So the CurrentPosition is incremented by one.

See Also

InsertAt, AddIfNotHere, InsertRear


CKObjectArray::InsertRear

Method CKObjectArray::InsertRear

void CKObjectArray::InsertRear(CKObject *vxm)
void CKObjectArray::InsertRear(CK_ID id)

Inserts the object at the end of the array

Parameters

Input argument id

The identifier of the object to insert

Remarks

Inserts the object's ID at the end of the array. The current object pointer is unchanged.

See Also

InsertFront, AddIfNotHere, InsertAt


CKObjectArray::InsertSorted

Method CKObjectArray::InsertSorted

void CKObjectArray::InsertSorted(CKObject *o,OBJECTARRAYCMPFCT CmpFct,CKContext* context)
void CKObjectArray::InsertSorted(CK_ID id,OBJECTARRAYCMPFCT CmpFct,CKContext* context)

Inserts an entity and sorts the array elements.

Parameters

Input argument o | Object to be inserted
Input argument id | CK_ID of the object to be inserted
CmpFct | Sorting Function.
context | A pointer to a CKContext.

Remarks

x

Sorts the elements of array of objects after insertion.


CKObjectArray::ListEmpty

Method CKObjectArray::ListEmpty

CKBOOL CKObjectArray::ListEmpty()

Returns 1 if the array is empty

Returns

1 if the array is empty

Remarks

Returns 1 if the array is empty

See Also

GetCount


CKObjectArray::Next

Method CKObjectArray::Next

void CKObjectArray::Next()

Increments the current position

Returns

none

Remarks

Increments the current position

See Also

Previous, EndOfList


CKObjectArray::PositionFind

Method CKObjectArray::PositionFind

CK_ID CKObjectArray::PositionFind(int pos)

Checks an object's presence by position without changing the current position

Parameters

Input argument pos

the position of the object to find

Returns

The pointer to the object or NULL.

Remarks

If the corresponding object is found, returns a pointer to it, but the current object pointer of the array is not changed.

See Also

NameFind, IDFind, PtrFind


CKObjectArray::PositionSeek

Method CKObjectArray::PositionSeek

CKBOOL CKObjectArray::PositionSeek(int Pos)

Move The current array position to Pos

Parameters

Input argument Pos

the position to seek

Returns

TRUE if the position is valid

Remarks

If the position is valid, the new current position is the object else we are at the end of the list. If the object is in the list, you can get it with GetGata.

See Also

IDSeek, PtrSeek, NameSeek, GetGata


CKObjectArray::Previous

Method CKObjectArray::Previous

void CKObjectArray::Previous()

Decrements the current position

Returns

The object at the new position

Remarks

Decrements the current position and returns the object at the current position. If the pointer was aleeady at the start of the array or if the array is empty, returns NULL.

See Also

Next


CKObjectArray::PtrFind

Method CKObjectArray::PtrFind

CK_ID CKObjectArray::PtrFind(CKObject *obj)

Checks an object's presence by pointer without changing the current position

Parameters

Input argument obj

the pointer to the object to find

Returns

The pointer to the object or NULL.

Remarks

If the corresponding object is found, returns a pointer to it, but the current object pointer of the array is not changed.

See Also

NameFind, IDFind, PositionFind


CKObjectArray::PtrSeek

Method CKObjectArray::PtrSeek

CKBOOL CKObjectArray::PtrSeek(CKObject *o)

Seeks an object in array by pointer

Parameters

Input argument o

A pointer to the object to seek

Returns

TRUE if the object is present

Remarks

If the Object is present the new current position is the object else we are at the end of the list If the object is in the list, you can get it with GetGata.

See Also

IDSeek, NameSeek, PositionSeek, GetGata


CKObjectArray::Remove

Method CKObjectArray::Remove

CKBOOL CKObjectArray::Remove(CKObject *obj)
CKBOOL CKObjectArray::Remove(CK_ID id)

Removes an object from the array

Parameters

Input argument obj | a pointer to the object to remove
Input argument id | The CK_ID of the object to remove

Returns

1 if the object was part of the array

Remarks

Removes the given object from the array.

The current object pointer is set to the next object in the array. If the object was the last one, the pointer is set to the previous one. If there was only one element in the array, the pointer is set to NULL.

If the object is not part of the array, nothing happens and 0 is returned, otherwise 1 is returned.

See Also

RemoveRear, RemoveFront, RemoveAt


CKObjectArray::RemoveAt

Method CKObjectArray::RemoveAt

CK_ID CKObjectArray::RemoveAt()

Removes the current object from the array

Returns

The removed object

Remarks

Removes the current object from the array, and returns a pointer to it. The current object pointer is set to the next object in the array. If the object was the last one, the pointer is set to the previous one. If there was only one element in the array, the pointer is set to NULL.

If the array is empty, nothing happens and NULL is returned.

See Also

RemoveRear, RemoveFront, Remove


CKObjectArray::RemoveFront

Method CKObjectArray::RemoveFront

CK_ID CKObjectArray::RemoveFront()

Removes the first element in the array

Returns

the removed object

Remarks

Removes the first object in the array from the array, and returns the object.

If the array is empty, nothing happens and NULL is returned.

If the current object pointer was on the first element, it is set to the next element.

See Also

RemoveRear, RemoveAt


CKObjectArray::RemoveRear

Method CKObjectArray::RemoveRear

CK_ID CKObjectArray::RemoveRear()

Removes the last object from the array

Returns

The removed object

Remarks

Removes the last object from the array, and returns a pointer to it.

If the array is empty, nothing happens and NULL is returned.

If the current object pointer was on the last element, it is set to the previous element.

See Also

RemoveFront, RemoveAt


CKObjectArray::Reset

Method CKObjectArray::Reset

void CKObjectArray::Reset()

Set the current position to the start of the list

Remarks

After a call to the function, the current object pointer points to the first object in the array.

See Also

GetCurrentPos, EndOfList


CKObjectArray::Seek

Method CKObjectArray::Seek

CK_ID CKObjectArray::Seek(int Pos)

Seeks an object in array by position

Parameters

Input argument Pos

the position to seek

Returns

CKObject at Position Pos

Remarks

If the position is valid, the new current position is the object else we are at the end of the list.

See Also

IDSeek, PtrSeek, NameSeek, GetGata


CKObjectArray::SetData

Method CKObjectArray::SetData

CK_ID CKObjectArray::SetData(CKObject* o)


CKObjectArray::SetDataId

Method CKObjectArray::SetDataId

CK_ID CKObjectArray::SetDataId(CK_ID id)


CKObjectArray::SwapCurrentWithNext

Method CKObjectArray::SwapCurrentWithNext

void CKObjectArray::SwapCurrentWithNext()

Swap the current object with the next in the list.

See Also

SwapCurrentWithPrevious


CKObjectArray::SwapCurrentWithPrevious

Method CKObjectArray::SwapCurrentWithPrevious

void CKObjectArray::SwapCurrentWithPrevious()

Swap the current object with the previous in the list.

See Also

SwapCurrentWithNext


CKObjectArray::Sort

Method CKObjectArray::Sort

typedef int (*OBJECTARRAYCMPFCT)(CKObject *elem1, CKObject *elem2)
void CKObjectArray::Sort(OBJECTARRAYCMPFCT CmpFct,CKContext* context)

Sorts the array elements.

Parameters

Input argument CmpFct | Sorting Function.
Input argument context | A pointer to a CKContext.


XObjectArray

Class XObjectArray

Container class for CKObject Id's.

XArray<CK_ID>
Show brief derivation trees

XObjectArray

XArray<CK_ID>
Show full derivation trees

XObjectArray

Remarks

This class use the template container XArray to contain object CK_ID's. Exactly same as XSObjectArray class, but uses XArray (Pre-allocated items). Supports for Check, Load, Save, Add, Remove, Find functions in the Object CK_ID array.

Groups

Operations
Method AddIfNotHere | Adds given object's ID to the array if it is not already present..
Method Allocated | Returns the elements allocated.
Method At | Access to an array element.
Method Attach |
Method Back | Returns the last element of an array.
Method Begin | Returns an iterator on the first element.
Method BinaryFind | Dichotomic search : finds an element in an array that is sorted in increasing order.
Method BubbleSort | Sorts an array with a bubble sort.
Method Check | Checks the CK_ID's array to remove objects that do not exist anymore.
Method Clear | Removes all the elements from an array.
Method Compact | Ensures than the reserved size equals the real size..
Method Compress | Compress an array of e elements.
Method ConvertFromObjects | Converts an XObjectPointerArray into an XObjectArray.
Method ConvertToObjects | Converts an XObjectArray into an XObjectPointerArray.
Method Detach |
Method End | Returns an iterator after the last element.
Method Erase |
Method EraseAt |
Method Expand | Expands an array of e elements.
Method FastRemove |
Method FastRemoveAt |
Method Fill | Fills an array with a value.
Method Find | Finds an element.
Method FindID | Finds whether the given Object Id is in the Object Id Array.
Method FindObject | Checks if given object is in CK_ID's array.
Method Front | Returns the first element of an array.
Method GetMemoryOccupation | Returns the occupied size in memory in bytes
Method GetObject | Gets an object from CK_ID's array.
Method GetObjectID | Returns Object Id at given position in the Object Id Array.
Method GetPosition | Returns the position of an element.
Method Insert | Inserts an element before another one.
Method InsertSorted | dicchotomic sorted insertion (use the < operator)
Method IsEmpty | Returns whether the array is empty (it is faster to use IsEmpty than Size when testing for array size...)
Method IsHere | Tests for an element presence.
Method Memset | Fills an array with a BYTE value.
Method Move | Moves the element n before the element i.
Method PopBack | Removes the last element of an array.
Method PopFront | Removes the first element of an array.
Method PushBack | Inserts an element at the end of an array.
Method PushFront | Inserts an element at the start of an array.
Method RBegin | Returns an iterator on the last element.
Method Remove | Removes an element.
Method RemoveAt | Removes an element at a given position.
Method RemoveObject | Removes the given object id from CK_ID's array.
Method REnd | Returns an iterator before the first element.
Method Reserve | Reserves n elements for an array.
Method Resize | Resizes the array.
Method Size | Returns the elements number.
Method Sort | Sorts an array with a quick sort.
Method Swap | Swaps two items in array.

See Also

XSObjectPointerArray,XObjectArray,CKObjectArray


XObjectArray::AddIfNotHere

Method XObjectArray::AddIfNotHere

BOOL XObjectArray::AddIfNotHere(CK_ID id)
BOOL XObjectArray::AddIfNotHere(CKObject* obj)

Adds given object's ID to the array if it is not already present..

Parameters

Input argument id | CK_ID of the object to add.
Input argument obj | Pointer to Object.

Returns

TRUE if the object id is added to array, FALSE otherwise.

Remarks

Addition is done only if the given Object is not in the array.

See Also

FindObject, RemoveObject


XObjectArray::Check

Method XObjectArray::Check

BOOL XObjectArray::Check(CKContext *Context)

Checks the CK_ID's array to remove objects that do not exist anymore.

Parameters

Input argument Context

A Pointer to CKContext.

Returns

TRUE if the objects have been deleted, FALSE otherwise.

Remarks

If a CK_ID doesn't reference an object anymore, it is removed from the array. You have to check array just after a deletion because CK_IDs can be reused for other objects, when initial object was dynamic or deleted with the flag CK_DESTROY_FREEID.

See Also

XSObjectArray::Check


XObjectArray::ConvertFromObjects

Method XObjectArray::ConvertFromObjects

void XObjectArray::ConvertFromObjects(const XObjectPointerArray& array)

Converts an XObjectPointerArray into an XObjectArray.

Parameters

Input argument array

a reference to the XObjectPointerArray to read from.

Remarks

If NULL pointers are in the XObjectPointerArray, ids of 0 are added to the XObjectArray anyway.

See Also

ConvertFromObjects


XObjectArray::ConvertToObjects

Method XObjectArray::ConvertToObjects

inline void XObjectArray::ConvertToObjects(CKContext *Context,XObjectPointerArray& array) const

Converts an XObjectArray into an XObjectPointerArray.

Parameters

Input argument Context | A Pointer to CKContext.
Input argument array | a reference to the XObjectPointerArray to fill.

Remarks

Only valid objects are added to the XObjectPointerArray, so the arrays may not have the same size if the XObjectArray wasn't checked before the conversion.

See Also

ConvertFromObjects


XObjectArray::FindID

Method XObjectArray::FindID

BOOL XObjectArray::FindID(CK_ID id) const

Finds whether the given Object Id is in the Object Id Array.

Parameters

Input argument id

Id of the Object to find.

Returns

TRUE if given object Id is found in array, FALSE otherwise.

See Also

FindObject


XObjectArray::FindObject

Method XObjectArray::FindObject

BOOL XObjectArray::FindObject(CKObject* obj) const

Checks if given object is in CK_ID's array.

Parameters

Input argument obj

A pointer to Object.

Returns

TRUE if the object id is in object id array, FALSE otherwise.

See Also

AddIfNotHere, RemoveObject, FindID


XObjectArray::GetObject

Method XObjectArray::GetObject

CKObject* XObjectArray::GetObject(CKContext *Context,unsigned int i) const

Gets an object from CK_ID's array.

Parameters

Input argument Context | A pointer to Context
Input argument i | position from where object is to be extracted

Returns

Pointer to Object at the given position in the context.

See Also

GetObjectID


XObjectArray::GetObjectID

Method XObjectArray::GetObjectID

CK_ID XObjectArray::GetObjectID(unsigned int i) const

Returns Object Id at given position in the Object Id Array.

Parameters

Input argument i

Position at which object is to be obtained.

Returns

CK_ID of the object at given position in the array.

See Also

GetObject


XObjectArray::RemoveObject

Method XObjectArray::RemoveObject

BOOL XObjectArray::RemoveObject(CKObject* obj)

Removes the given object id from CK_ID's array.

Parameters

Input argument obj

A pointer to Object.

Returns

The position from where the Object id is removed.

See Also

FindObject, AddIfNotHere


XObjectPointerArray

Class XObjectPointerArray

Container class for CKObject pointers.

XArray<CKObject*>
Show brief derivation trees

XObjectPointerArray

XArray<CKObject*>
Show full derivation trees

XObjectPointerArray

Remarks

This class use the template container XArray to contain object pointers. Exactly same as XObjectArray class, but uses XArray (Pre-allocated items) for storing pointers, and not IDs (more efficient to retrieve the objects). Supports for Check, Load, Save, Add, Remove, Find functions in the CKObject Pointer array.

Groups

Operations
Method AddIfNotHere | Adds given object to object array only if it is not in array.
Method Allocated | Returns the elements allocated.
Method At | Access to an array element.
Method Attach |
Method Back | Returns the last element of an array.
Method Begin | Returns an iterator on the first element.
Method BinaryFind | Dichotomic search : finds an element in an array that is sorted in increasing order.
Method BubbleSort | Sorts an array with a bubble sort.
Method Check | Checks the CKObject*'s array to remove objects that don't exist anymore.
Method Clear | Removes all the elements from an array.
Method Compact | Ensures than the reserved size equals the real size..
Method Compress | Compress an array of e elements.
Method Detach |
Method End | Returns an iterator after the last element.
Method Erase |
Method EraseAt |
Method Expand | Expands an array of e elements.
Method FastRemove |
Method FastRemoveAt |
Method Fill | Fills an array with a value.
Method Find | Finds an element.
Method FindObject | Checks if given object is in object array.
Method Front | Returns the first element of an array.
Method GetMemoryOccupation | Returns the occupied size in memory in bytes
Method GetObject | Gets an object from object array.
Method GetObjectID | Gets the object id from object array at a given position.
Method GetPosition | Returns the position of an element.
Method Insert | Inserts an element before another one.
Method InsertSorted | dicchotomic sorted insertion (use the < operator)
Method IsEmpty | Returns whether the array is empty (it is faster to use IsEmpty than Size when testing for array size...)
Method IsHere | Tests for an element presence.
Method Memset | Fills an array with a BYTE value.
Method Move | Moves the element n before the element i.
Method PopBack | Removes the last element of an array.
Method PopFront | Removes the first element of an array.
Method PushBack | Inserts an element at the end of an array.
Method PushFront | Inserts an element at the start of an array.
Method RBegin | Returns an iterator on the last element.
Method Remove | Removes an element.
Method RemoveAt | Removes an element at a given position.
Method RemoveObject | Removes the given object from object array.
Method REnd | Returns an iterator before the first element.
Method Reserve | Reserves n elements for an array.
Method Resize | Resizes the array.
Method Size | Returns the elements number.
Method Sort | Sorts an array with a quick sort.
Method Swap | Swaps two items in array.

See Also

XSObjectPointerArray,XObjectArray,CKObjectArray


XObjectPointerArray::AddIfNotHere

Method XObjectPointerArray::AddIfNotHere

BOOL XObjectPointerArray::AddIfNotHere(CKObject* obj)

Adds given object to object array only if it is not in array.

Parameters

Input argument obj

Pointer to Object.

Returns

TRUE if the object id is added to array, FALSE otherwise.

Remarks

Addition is done only if the given Object is not in the array.

See Also

RemoveObject, FindObject


XObjectPointerArray::Check

Method XObjectPointerArray::Check

BOOL XObjectPointerArray::Check()

Checks the CKObject*'s array to remove objects that don't exist anymore.

Returns

TRUE if the objects have been deleted, FALSE otherwise.

Remarks

If a CKObject* is to be deleted (flagged), it is removed from the array. You have to check array after the objects have been flagged, but before they are actually deleted otherwise it will crashes (pointer pointing on nothing.)

See Also

XSObjectPointerArray::Check


XObjectPointerArray::FindObject

Method XObjectPointerArray::FindObject

BOOL XObjectPointerArray::FindObject(CKObject* obj) const

Checks if given object is in object array.

Parameters

Input argument obj

A pointer to Object.

Returns

TRUE if the object is in object array, FALSE otherwise.

See Also

RemoveObject, AddIfNotHere


XObjectPointerArray::GetObject

Method XObjectPointerArray::GetObject

CKObject* XObjectPointerArray::GetObject(unsigned int i) const

Gets an object from object array.

Parameters

Input argument i

Position from where object is to be extracted

Returns

Object at the given position in the array if present, NULL otherwise.

See Also

GetObjectID


XObjectPointerArray::GetObjectID

Method XObjectPointerArray::GetObjectID

CK_ID XObjectPointerArray::GetObjectID(unsigned int i) const

Gets the object id from object array at a given position.

Parameters

Input argument i

Position from where object id is to be extracted

Returns

Id of the object at the given position in the array.

See Also

GetObject


XObjectPointerArray::RemoveObject

Method XObjectPointerArray::RemoveObject

int XObjectPointerArray::RemoveObject(CKObject* obj)

Removes the given object from object array.

Parameters

Input argument obj

A pointer to Object.

Returns

The position from where the Object id is removed.

Remarks

The removal only shifts left the pointers after the element removed. No memory is freed.

See Also

FindObject, AddIfNotHere


XSObjectArray

Class XSObjectArray

Container class for CKObject Id's

XSArray<CK_ID>
Show brief derivation trees

XSObjectArray

XSArray<CK_ID>
Show full derivation trees

XSObjectArray

Remarks

This class use the template container XSArray to contain object CK_ID's. Therefore, the size occupied by the array is exactly the number of ids it contains (whereas XObjectArray that can have a reserved size greater than its number of IDs) Supports for Check, Load, Save, Add, Remove, Find functions in the XObjectArray.

Groups

Operations
Method AddIfNotHere | Adds given object's ID to the array only if it is not already present.
Method Check | Checks the CK_ID's array to remove objects that do not exist anymore.
Method ConvertFromObjects | Converts an XSArray<CKObject *> into an XSObjectArray.
Method ConvertToObjects | Converts an XSObjectArray into an XSArray<CKObject*>
Method FindID | Finds whether the given Object Id is in the Object Id Array.
Method FindObject | Checks if given object is in CK_ID's array.
Method GetObject | Gets an object from CK_ID's array.
Method GetObjectID | Gives Object Id at given position in the Object Id Array.
Method RemoveObject | Removes the given object id from CK_ID's array.

See Also

XSObjectPointerArray,XObjectArray,CKObjectArray, XSArray


XSObjectArray::AddIfNotHere

Method XSObjectArray::AddIfNotHere

BOOL XSObjectArray::AddIfNotHere(CK_ID id)
BOOL XSObjectArray::AddIfNotHere(CKObject* obj)

Adds given object's ID to the array only if it is not already present.

Parameters

Input argument id | CK_ID of the object to add.
Input argument obj | Pointer to Object.

Returns

TRUE if the object id is added to array, FALSE otherwise.

Remarks

Addition is done only if the given Object is not already in the array.

See Also

FindObject, RemoveObject


XSObjectArray::Check

Method XSObjectArray::Check

BOOL XSObjectArray::Check(CKContext *Context)

Checks the CK_ID's array to remove objects that do not exist anymore.

Parameters

Input argument Context

A Pointer to CKContext.

Returns

TRUE if the objects have been deleted, FALSE otherwise.

Remarks

If a CK_ID does not reference a valid object anymore, it is removed from the array. You have to check array just after a deletion because CK_IDs can be re-used for other objects, when initial object was dynamic or deleted with the flag CK_DESTROY_FREEID.

See Also

XObjectArray::Check


XSObjectArray::ConvertFromObjects

Method XSObjectArray::ConvertFromObjects

void XSObjectArray::ConvertFromObjects(const XSArray<CKObject *>& array)

Converts an XSArray<CKObject *> into an XSObjectArray.

Parameters

Input argument array

a reference to the XSArray<CKObject *> to read from.

Remarks

If NULL pointers are in the XSArray<CKObject *>, ids of 0 are added to the XSObjectArray anyway.

See Also

ConvertFromObjects


XSObjectArray::ConvertToObjects

Method XSObjectArray::ConvertToObjects

inline void XSObjectArray::ConvertToObjects(CKContext *Context,XSArray<CKObject *>&array) const

Converts an XSObjectArray into an XSArray<CKObject*>

Parameters

Input argument Context | A Pointer to CKContext.
Input argument array | A reference to the XSArray<CKObject*> to fill.

Remarks

Only valid objects are added to the XObjectPointerArray, so the arrays may not have the same size if the XObjectArray wasn't checked before the conversion.

See Also

ConvertFromObjects


XSObjectArray::FindID

Method XSObjectArray::FindID

BOOL XSObjectArray::FindID(CK_ID id) const

Finds whether the given Object Id is in the Object Id Array.

Parameters

Input argument id

Id of the Object to find.

Returns

TRUE if given object Id is found in array, FALSE otherwise.

See Also

FindObject


XSObjectArray::FindObject

Method XSObjectArray::FindObject

BOOL XSObjectArray::FindObject(CKObject* obj) const

Checks if given object is in CK_ID's array.

Parameters

Input argument obj

A pointer to Object.

Returns

TRUE if the object id is in object id array, FALSE otherwise.

See Also

AddIfNotHere, RemoveObject, FindID


XSObjectArray::GetObject

Method XSObjectArray::GetObject

CKObject* XSObjectArray::GetObject(CKContext *Context,unsigned int i) const

Gets an object from CK_ID's array.

Parameters

Input argument Context | A pointer to Context
Input argument i | position from where object is to be extracted

Returns

Pointer to Object at the given position in the context.

See Also

GetObjectID


XSObjectArray::GetObjectID

Method XSObjectArray::GetObjectID

CK_ID XSObjectArray::GetObjectID(unsigned int i) const

Gives Object Id at given position in the Object Id Array.

Parameters

Input argument i

Position at which object is to be obtained.

Returns

CK_ID of the object at given position in the array.

See Also

GetObject


XSObjectArray::RemoveObject

Method XSObjectArray::RemoveObject

BOOL XSObjectArray::RemoveObject(CKObject* obj)

Removes the given object id from CK_ID's array.

Parameters

Input argument obj

A pointer to Object.

Returns

The position from where the Object id is removed.

See Also

FindObject, AddIfNotHere


XSObjectPointerArray

Class XSObjectPointerArray

Container class for CKObject pointers.

XSArray<CKObject*>
Show brief derivation trees

XSObjectPointerArray

XSArray<CKObject*>
Show full derivation trees

XSObjectPointerArray

Remarks

This class use the template container XSArray to contain object pointers. Exactly same as XObjectPointerArray class, but uses XSArray for storing pointers, thus the allocated size of the array always exactly match what it contains, each insertion and removal generating an allocation and a deallocation. Supports for Check, Load, Save, Add, Remove, Find functions in the CKObject Pointer array.

Groups

Operations
Method AddIfNotHere | Adds given object to object array only if it is not in array.
Method Check | Checks the CKObject*'s array to remove objects that don't exist anymore.
Method FindObject | Checks if given object is in object array.
Method GetObject | Gets an object from object array.
Method GetObjectID | Gets the object id from object array at a given position.
Method RemoveObject | Removes the given object from object array.

See Also

XObjectPointerArray,XObjectArray,CKObjectArray


XSObjectPointerArray::AddIfNotHere

Method XSObjectPointerArray::AddIfNotHere

BOOL XSObjectPointerArray::AddIfNotHere(CKObject* obj)

Adds given object to object array only if it is not in array.

Parameters

Input argument obj

Pointer to Object.

Returns

TRUE if the object id is added to array, FALSE otherwise.

Remarks

Addition is done only if the given Object is not in the array.

See Also

RemoveObject, FindObject


XSObjectPointerArray::Check

Method XSObjectPointerArray::Check

BOOL XSObjectPointerArray::Check()

Checks the CKObject*'s array to remove objects that don't exist anymore.

Returns

TRUE if the objects have been deleted, FALSE otherwise.

Remarks

If a CKObject* is to be deleted (flagged), it is removed from the array. You have to check array after the objects have been flagged, but before they are actually deleted otherwise it will crashes (pointer pointing on nothing.)

See Also

XObjectPointerArray::Check


XSObjectPointerArray::FindObject

Method XSObjectPointerArray::FindObject

BOOL XSObjectPointerArray::FindObject(CKObject* obj) const

Checks if given object is in object array.

Parameters

Input argument obj

A pointer to Object.

Returns

TRUE if the object is in object array, FALSE otherwise.

See Also

RemoveObject, AddIfNotHere


XSObjectPointerArray::GetObject

Method XSObjectPointerArray::GetObject

CKObject* XSObjectPointerArray::GetObject(unsigned int i) const

Gets an object from object array.

Parameters

Input argument i

Position from where object is to be extracted

Returns

Object at the given position in the array if present, NULL otherwise.

See Also

GetObjectID


XSObjectPointerArray::GetObjectID

Method XSObjectPointerArray::GetObjectID

CK_ID XSObjectPointerArray::GetObjectID(unsigned int i) const

Gets the object id from object array at a given position.

Parameters

Input argument i

Position from where object id is to be extracted

Returns

Id of the object at the given position in the array.

See Also

GetObject


XSObjectPointerArray::RemoveObject

Method XSObjectPointerArray::RemoveObject

int XSObjectPointerArray::RemoveObject(CKObject* obj)

Removes the given object from object array.

Parameters

Input argument obj

A pointer to Object.

Returns

The position from where the Object id is removed.

Remarks

The removal actually delete and reallocate the whole array. Use XObjectPointerArray to avoid this.

See Also

AddIfNotHere, FindObject


Variables

Class CKParameterVariable

Base class for parameterized access of the variables registered in the variable manager.
Class CKVariableManager

This manager is used to expose some global (or unique) variables, like floats, integers or strings by replacing the native type (be it int, float or XString) with a more complex one, CKVariableManager::VariableInt, Float or String (VInt, VFloat or VString for short). This new type will works exactly as the old one, except that you have to “bind” the variable to a unique name, of the form “category/variablename” with the CKContext this variable refers to.

Once a variable is bound, external users of the class containing it can read and write (for non read-only) its value using the CKVariableManager and its unique name. The value can be read/write by its native type or by a string, in a way similar to the CKParameters.

Another way to access the variable is to create a CKParameterVariable registered to the same unique name. This parameter will then works as a normal CKParameterLocal except that it will address directly the real variable, without copying/synchronizing.

A variable has always a default value and you can ask it if it is currently different from it and you can also restore its default value, with the RestoreValue() function.

There exists variant of variables:

They can be Read-Only, meaning that one can access its value only for reading purpose. A variable of this type must returns TRUE when its virtual function IsReadOnly() is called. Implementation of the common type has been done in Read-Only version : they are VIntRO, VBoolRO, VFloatRO, VStringRO.

They can be Composition Depending: If a variable is Composition Depending, it means its value must be saved with the composition. If not, it is application dependent, and it can take its value from a config file for example, like the one an application can set to the CKVariableManager using the function SetApplicationFile(). A variable can be natively Composition Depending by overriding the IsCompositionDepending() virtual function and returning TRUE (This has be done for the base types : CVInt, CVBool, CVFloat, CVString) or it can be marked as composition depending for a specific case. This is done on any application depending variable, by calling the MarkAsCompositionDepending() function. Once a variable is marked, it is bound with the current composition but it will be automatically unmarked when the next clear all will occur.

Concerning the edition of the variable, the basic types are edited in a straightforward way, but one can create INT variables with a different type of edition, like an enumeration of a flag list. This can be done by overriding the GetRepresentation() virtual function and returning a string that can be of the form:

"enum:a=label1;b=label2;c=label3;..." list of possible value a,b,c, with optional names in parenthesis

"flag:a=label1;b=label2;c=label3;..." same as enum. but represented as a flag. For the flag you're entitled to ensure that the value are not crossing over themselves (like flag:box=1;sphere=2;cylinder=3)

The Bool variable has overrided it so that you can choose between FALSE and TRUE value in a combo box, although its only an int that can be 0 or 1.

One last thing you can do about variable is being notified when the variable is read or when it is written (only through the interface of the CKVariableManager) This is done by inheriting the variable type you want (VInt, CVFloat, VBoolrRO, etc..) and overriding the PreRead() and PostWrite() virtual functions. This allow you to calculate the real value of the variable before it is read for example, or force an action when some other variable has been changed.

See Also

Classes


CKParameterVariable

Class CKParameterVariable

Base class for parameterized access of the variables registered in the variable manager.

CKObject

CKParameter

CKParameterLocal
Show brief derivation trees

CKParameterVariable

CKObject

CKParameter

CKParameterLocal
Show full derivation trees

CKParameterVariable

Remarks

The class id of CKParameter is CKCID_PARAMETERVARIABLE.

Groups

Operations
Method Bind | Method to bind the parameter with a registered variable
Method CheckClass | Virtual added for Fixed Size parameter support
Method CheckClass | Virtual added for Fixed Size parameter support
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Value
Virtual Method Method CopyValue | Copies the content of a parameter to this parameter.
Method CopyValue | Copies the content of a parameter to this parameter.
Method GetDataSize | Gets the size of the data stored by the parameter.
Method GetReadDataPtr | Returns a pointer to the data.
Method GetStringValue | Gets the string representation of the parameter value.
Method GetValue | Gets the value of the parameter.
Virtual Method Method GetWriteDataPtr | Returns a pointer to the data.
Method GetWriteDataPtr | Returns a pointer to the data.
Virtual Method Method SetStringValue | Sets the value of the parameter using a string.
Method SetStringValue | Sets the value of the parameter using a string.
Virtual Method Method SetValue | Sets the value of the parameter.
Method SetValue | Sets the value of the parameter.

See Also

CKVariableManager, CKParameterIn


CKParameterVariable::Bind

Method CKParameterVariable::Bind

CKERROR CKParameterVariable::Bind(const char* iName)

Remarks

Method to bind the parameter with a registered variable


CKParameterVariable::CheckClass

Method CKParameterVariable::CheckClass

void
CKParameterVariable::CheckClass(CKParameterTypeDesc* iType)

Remarks

Virtual added for Fixed Size parameter support


CKParameterVariable::CopyValue

Method CKParameterVariable::CopyValue

CKERROR
CKParameterVariable::CopyValue(CKParameter *SourceParam,CKBOOL UpdateParam)

Copies the content of a parameter to this parameter.

Parameters

SourceParam | A pointer to a CKParameter to copy the value of.
UpdateParam | In the case of an output parameter of a parameter operation, TRUE if the operation should be evaluated before copying the value.

Returns

Value | Meaning
CK_OK | if successful
CKERR_INVALIDPARAMETERTYPE | if parameter types are incompatible

Remarks

This function checks the types of the source and destination parameters before copying the content. It also ensures to call the correct copy function according to the parameter type.

See Also

SetValue,GetValue


CKParameterVariable::GetReadDataPtr

Method CKParameterVariable::GetReadDataPtr

void* CKParameterVariable::GetReadDataPtr(CKBOOL update = TRUE)

Returns a pointer to the data.

Returns

A pointer to the storage buffer

Remarks

These methods give access to the data of the parameter by pointer. You should be cautious when you use these methods, especially you should call CKParameterOut::DataChanged if you have modified the data in order to propagate the modification down the destination chain when using a CKParameterOut. The GetValue method copies the content of the parameter buffer inside a user allocated buffer so it is fastest to use this method when accessing large parameters such as strings or buffer. GetDataSize returns the size in bytes of the returned buffer.

Reads the value of string parameter char* StringValue = (char *) StringParam->GetReadDataPtr();

Implementation Notes

Data pointer

See Also

Pre-Registred Parameter Types ,GetValue, GetWriteDataPtr,SetValue,GetDataSize


CKParameterVariable::GetStringValue

Method CKParameterVariable::GetStringValue

int
CKParameterVariable::GetStringValue(CKSTRING stringValue, CKBOOL update)

Gets the string representation of the parameter value.

Parameters

stringValue | CKSTRING to store Destination string.
update | In the case of an output parameter of a parameter operation, TRUE if the operation should be evaluated before copying the value.

Returns

The size of the needed buffer for the string.

Remarks

+If the given string is NULL, the method returns the number of bytes to allocate for the string.

See Also

SetStringValue


CKParameterVariable::GetValue

Method CKParameterVariable::GetValue

CKERROR
CKParameterVariable::GetValue(void *buf, CKBOOL update)

Gets the value of the parameter.

Parameters

buf

A pointer to a buffer where the value is to be copied.

Remarks

DO NOT USE SetValue() and GetValue() to copy from one parameter to another if you are not sure of the type of parameter you are copying instead use CopyValue. GetValue copies the content of the parameter buffer to buf, it can be more convenient to use GetReadDataPtr to access variable size parameter like string or buffers.

Gets the value of a CKObject parameter (CKPGUID_OBJECT) CK_ID ObjectID; CKObject* Object; ObjectParam->GetValue(&ObjectID); Object= CKContext->GetObject(ObjectID);

you can now directly use Object = ObjectParam->GetValueObject();

Gets the value of a integer parameter (CKPGUID_INT) int iValue; ObjectParam->GetValue(&iValue);

Gets the value of a float parameter (CKPGUID_FLOAT) float fValue; ObjectParam->GetValue(&fValue); //or fValue = *(float *)ObjectParam->GetReadDataPtr();

See Also

Pre-Registred Parameter Types,SetValue,GetDataSize, GetWriteDataPtr, CopyValue


CKParameterVariable::GetWriteDataPtr

Method CKParameterVariable::GetWriteDataPtr

void*
CKParameterVariable::GetWriteDataPtr()

Returns a pointer to the data.

Returns

A pointer to the storage buffer

Remarks

These methods give access to the data of the parameter by pointer. You should be cautious when you use these methods, especially you should call CKParameterOut::DataChanged if you have modified the data in order to propagate the modification down the destination chain when using a CKParameterOut. The GetValue method copies the content of the parameter buffer inside a user allocated buffer so it is fastest to use this method when accessing large parameters such as strings or buffer. GetDataSize returns the size in bytes of the returned buffer. The GetWriteDataPtr and GetReadDataPtr but should be used accordingly to the intent (reading or writing) in case this hint could be used by the engine.

Reads the value of string parameter char* StringValue = (char *) StringParam->GetReadDataPtr();

See Also

Pre-Registred Parameter Types ,GetValue, SetValue,GetReadDataPtr,GetDataSize


CKParameterVariable::SetStringValue

Method CKParameterVariable::SetStringValue

CKERROR CKParameterVariable::SetStringValue(CKSTRING Value)

Sets the value of the parameter using a string.

Returns

CK_OK if successful,an error code otherwise.

Remarks

Most parameter types know how to convert their data to and from a string. SetStringValue converts the given string into a data and changes the data. Propagates the changes down the destination chain is the parameter is a CKParameterOut.

Implementation Notes

Convertion from / to string

See Also

GetStringValue


CKParameterVariable::SetValue

Method CKParameterVariable::SetValue

CKERROR
CKParameterVariable::SetValue(const void *buf,int size)

Sets the value of the parameter.

Parameters

buf | A pointer to value to be set
size | Integer specifying the size of the value or 0 to use the default size of the parameter.

Returns

CK_OK if successful, error code otherwise.

Remarks

For variable size parameter the size must be given. This copies the given data into the data of the parameter. In the case of a CKParameterOut, it automatically propagates the modifications down the destinations chain, so the call to DataChanged is not needed. DO NOT USE SetValue() and GetValue() to copy from one parameter to another if you are not sure of the type of parameter you are copying instead use CopyValue.

Sets the value of a string parameter (CKPGUID_STRING) char string[] = “My value”; StringParam->SetValue(string,strlen(string)+1);

Sets the value of a CKObject parameter (CKPGUID_OBJECT) CK_ID ObjectID = CKOBJID(MyObject); ObjectParam->SetValue(&ObjectID);

Sets the value of a integer parameter (CKPGUID_INT) int iValue = 15; ObjectParam->SetValue(&iValue);

Sets the value of a float parameter (CKPGUID_FLOAT) float fValue = 15; ObjectParam->SetValue(&fValue);

See Also

Pre-Registred Parameter Types,GetValue,GetDataSize, GetWriteDataPtr, CopyValue


CKVariableManager

Class CKVariableManager

This manager is used to expose some global (or unique) variables, like floats, integers or strings by replacing the native type (be it int, float or XString) with a more complex one, CKVariableManager::VariableInt, Float or String (VInt, VFloat or VString for short). This new type will works exactly as the old one, except that you have to “bind” the variable to a unique name, of the form “category/variablename” with the CKContext this variable refers to.

Once a variable is bound, external users of the class containing it can read and write (for non read-only) its value using the CKVariableManager and its unique name. The value can be read/write by its native type or by a string, in a way similar to the CKParameters.

Another way to access the variable is to create a CKParameterVariable registered to the same unique name. This parameter will then works as a normal CKParameterLocal except that it will address directly the real variable, without copying/synchronizing.

A variable has always a default value and you can ask it if it is currently different from it and you can also restore its default value, with the RestoreValue() function.

There exists variant of variables:

They can be Read-Only, meaning that one can access its value only for reading purpose. A variable of this type must returns TRUE when its virtual function IsReadOnly() is called. Implementation of the common type has been done in Read-Only version : they are VIntRO, VBoolRO, VFloatRO, VStringRO.

They can be Composition Depending: If a variable is Composition Depending, it means its value must be saved with the composition. If not, it is application dependent, and it can take its value from a config file for example, like the one an application can set to the CKVariableManager using the function SetApplicationFile(). A variable can be natively Composition Depending by overriding the IsCompositionDepending() virtual function and returning TRUE (This has be done for the base types : CVInt, CVBool, CVFloat, CVString) or it can be marked as composition depending for a specific case. This is done on any application depending variable, by calling the MarkAsCompositionDepending() function. Once a variable is marked, it is bound with the current composition but it will be automatically unmarked when the next clear all will occur.

Concerning the edition of the variable, the basic types are edited in a straightforward way, but one can create INT variables with a different type of edition, like an enumeration of a flag list. This can be done by overriding the GetRepresentation() virtual function and returning a string that can be of the form:

"enum:a=label1;b=label2;c=label3;..." list of possible value a,b,c, with optional names in parenthesis

"flag:a=label1;b=label2;c=label3;..." same as enum. but represented as a flag. For the flag you're entitled to ensure that the value are not crossing over themselves (like flag:box=1;sphere=2;cylinder=3)

The Bool variable has overrided it so that you can choose between FALSE and TRUE value in a combo box, although its only an int that can be 0 or 1.

One last thing you can do about variable is being notified when the variable is read or when it is written (only through the interface of the CKVariableManager) This is done by inheriting the variable type you want (VInt, CVFloat, VBoolrRO, etc..) and overriding the PreRead() and PostWrite() virtual functions. This allow you to calculate the real value of the variable before it is read for example, or force an action when some other variable has been changed.

CKBaseManager
Show brief derivation trees

CKVariableManager

CKBaseManager
Show full derivation trees

CKVariableManager

Groups

Operations
Method Bind | Registers the variable to the CKVariableManager with an absolute name. If a variable with the same absolute name is already registered, does nothing but producing an output error in the console.
Method GetApplicationFile |
Method GetStringType |
Method GetVariable | Get a bound variable
Method GetVariableValue | Protected Get Value
Method RegisterVariable | Variable Registration
Method RegisterWatcher | Add a watcher
Method SetVariableValue | Protected Set Value
Method StartProfile | Starts profiling.
Method StopProfile | Stops profiling.
Method UnBind |
Method UnRegisterWatcher | Removes a watcher
Method WatcherPreRead | watcher retreival
Classes
Class Iterator | This is the class that allow iteration on all variables registered in the variable manager.
Type Definitions
Type Definition HashName2Var | types
Enumerated Type RestoreMode | Types
Variables
Method Export | Export variables value from a given file. You can specify a set of variables that must be written.
Method GetStringValue | Gets the value of a variable as a string.
Method GetValue | Gets the value of a variable.
Method GetVariableCount | Gets the count of registered variables.
Method GetVariableIterator | Gets an iterator on all registered variables.
Method Import | Import variables value from a given file. You can specify a set of variables that must be read.
Method MarkAsCompositionDepending | Sets a variable that is not composition depending as a depending one. This variable will be saved in composition, overriding its application
Method RestoreAll | Restores a defined set of variables to their default value.
Method RestoreValue | Restores a variable to its default value.
Method SetApplicationFile | Sets a config file for the application depending variables. These variables will be saved in this file at each clear all, and the values of the forced-composition variables will be restored according to this file too.
Method SetStringValue | Sets the value of a variable as a string.
Method SetValue | Sets the value of a variable.
Method SynchronizeApplicationFile | Synchronizes the application and the application file, either by writing the variables values to the file, or by reading them from the file. You can shynchronize all the variables or only a subset of them.
Class Variable | This class represent a bound variable, accessing by its name with the VariableManager. You can't instantiate Variable directly but either their simple derived classes for existing types VariableInt, VariableFloat or VariableString either one specific class you will derive from one of the preceding class, to override some of the virtual functions presenting its functionality.
Class Watcher | Variable modification watching class.


CKVariableManager::Bind

Method CKVariableManager::Bind

void CKVariableManager::Bind(const char* iName, int* iAddress, int iDefaultValue, XDWORD iFlags, const char* iDescription)
void
CKVariableManager::Bind(const char* iName, int* iAddress, int iDefaultValue, XDWORD iFlags, const char* iRepresentation, const char* iDescription)
void
CKVariableManager::Bind(const char* iName, float* iAddress, float iDefaultValue, XDWORD iFlags, const char* iDescription)
void
CKVariableManager::Bind(const char* iName, XString* iAddress, const XString& iDefaultValue, XDWORD iFlags, const char* iDescription)

Registers the variable to the CKVariableManager with an absolute name. If a variable with the same absolute name is already registered, does nothing but producing an output error in the console.

Parameters

iName | the absolute name of the variable, in the form “category/varname”
iDefaultValue | the default value (and initial value) of the variable
iDescription | the description of the variable meaning and functionnality. For no runtime overhead, you must give your description surrounded by the VARDESCRIPTION() macro.

See Also

CKVariableManager


CKVariableManager::GetApplicationFile

Method CKVariableManager::GetApplicationFile

const char*
CKVariableManager::GetApplicationFile()


CKVariableManager::GetStringType

Method CKVariableManager::GetStringType

const char*
CKVariableManager::GetStringType(const Variable* iVar)


CKVariableManager::GetVariable

Method CKVariableManager::GetVariable

Variable* CKVariableManager::GetVariable(const char* iName)

Remarks

Get a bound variable


CKVariableManager::GetVariableValue

Method CKVariableManager::GetVariableValue

XBOOL
CKVariableManager::GetVariableValue(const char* iName, Variable* iVariable, int* oValue)
XBOOL
CKVariableManager::GetVariableValue(const char* iName, Variable* iVariable, float* oValue)
XBOOL
CKVariableManager::GetVariableValue(const char* iName, Variable* iVariable, XString& oValue)

Remarks

Protected Get Value


CKVariableManager::RegisterVariable

Method CKVariableManager::RegisterVariable

void
CKVariableManager::RegisterVariable(Variable* iVar, const char* iName, XDWORD iFlags, const char* iDescription)

Remarks

Variable Registration


CKVariableManager::RegisterWatcher

Method CKVariableManager::RegisterWatcher

void CKVariableManager::RegisterWatcher(const char* iName, Watcher* iWatcher)

Remarks

Add a watcher


CKVariableManager::SetVariableValue

Method CKVariableManager::SetVariableValue

XBOOL
CKVariableManager::SetVariableValue(const char* iName, Variable* iVariable, int iValue)
XBOOL
CKVariableManager::SetVariableValue(const char* iName, Variable* iVariable, float iValue)
XBOOL
CKVariableManager::SetVariableValue(const char* iName, Variable* iVariable, const char* iValue)

Remarks

Protected Set Value


CKVariableManager::UnBind

Method CKVariableManager::UnBind

void
CKVariableManager::UnBind(const char* iName)


CKVariableManager::UnRegisterWatcher

Method CKVariableManager::UnRegisterWatcher

Watcher* CKVariableManager::UnRegisterWatcher(const char* iName)

Remarks

Removes a watcher


CKVariableManager::WatcherPreRead

Method CKVariableManager::WatcherPreRead

void
CKVariableManager::WatcherPreRead(const char* iName)

Remarks

watcher retreival


CKVariableManager::Iterator

Class CKVariableManager::Iterator

This is the class that allow iteration on all variables registered in the variable manager.

Groups

Operators
Method operator++ | iterates to the next variable.
Operations
Method End | tells if the iteration is over.
Method GetName | returns the unique name of the variable pointed by the iterator.
Method GetVariable | returns the variable pointed to by the iterator.


CKVariableManager::Iterator::operator++

Method CKVariableManager::Iterator::operator++

Iterator& CKVariableManager::Iterator::operator++(int)

iterates to the next variable.

Returns

The value of the current object before the operation was performed.

Remarks

Description: Postfix Increment Operator

This increments the current object.


CKVariableManager::Iterator::End

Method CKVariableManager::Iterator::End

XBOOL CKVariableManager::Iterator::End()

tells if the iteration is over.

Returns

TRUE if the iteration is at its end, FALSE otherwise.


CKVariableManager::Iterator::GetName

Method CKVariableManager::Iterator::GetName

const char* CKVariableManager::Iterator::GetName()

returns the unique name of the variable pointed by the iterator.

Returns

a constant string on the variable name


CKVariableManager::Iterator::GetVariable

Method CKVariableManager::Iterator::GetVariable

Variable* CKVariableManager::Iterator::GetVariable()

returns the variable pointed to by the iterator.

Returns

a pointer on a CKVariable.


CKVariableManager::HashName2Var

Type Definition CKVariableManager::HashName2Var

typedef XHashTable<Variable*,const char*> CKVariableManager::HashName2Var

Remarks

types


CKVariableManager::RestoreMode

Enumerated Type CKVariableManager::RestoreMode

enum RestoreMode {
ALL = 1,
COMPOSITION = 2,
NATIVECOMPOSITION = 3
}

Members

ALL
COMPOSITION
NATIVECOMPOSITION

Remarks

Types


CKVariableManager::Export

Method CKVariableManager::Export

XBOOL CKVariableManager::Export(const char* iFileName, const XArray<const char*>* iVariables,BOOL iAddToCurrentFile=FALSE)

Export variables value from a given file. You can specify a set of variables that must be written.

Parameters

Input argument iFileName | the absolute file name of the variable file.
Input argument iVariables | an array of variable names you want to be written. Specify NULL if you want all the variables in the file to be exported.

Returns

CK_OK if successfull

See Also

CKVariableManager, Import


CKVariableManager::GetStringValue

Method CKVariableManager::GetStringValue

XBOOL CKVariableManager::GetStringValue(const char* iName, XString& oValue)

Gets the value of a variable as a string.

Parameters

Input argument iName | the absolute name of the variable, in the form “category/varname”
Input argument oValue | string representation of the value of the variable

Returns

CK_OK if the variable was found

See Also

CKVariableManager


CKVariableManager::GetValue

Method CKVariableManager::GetValue

XBOOL CKVariableManager::GetValue(const char* iName, int* oValue)
XBOOL
CKVariableManager::GetValue(const char* iName, float* oValue)
XBOOL
CKVariableManager::GetValue(const char* iName, XString& oValue)

Gets the value of a variable.

Parameters

iName | the absolute name of the variable, in the form “category/varname”
oValue | address of data that will contain the variable value

Returns

TRUE if the variable was found

See Also

CKVariableManager


CKVariableManager::GetVariableCount

Method CKVariableManager::GetVariableCount

int CKVariableManager::GetVariableCount()

Gets the count of registered variables.

Returns

the number of variables

See Also

CKVariableManager


CKVariableManager::GetVariableIterator

Method CKVariableManager::GetVariableIterator

Iterator CKVariableManager::GetVariableIterator()

Gets an iterator on all registered variables.

Returns

a CKVariableManager::Iterator

Remarks

CKVariableManager::Iterator it = vm->GetVariableIterator();
for (;!it.End(); it++)
const char* name = it.GetName();

See Also

CKVariableManager


CKVariableManager::Import

Method CKVariableManager::Import

XBOOL CKVariableManager::Import(const char* iFileName, const XArray<const char*>* iVariables)

Import variables value from a given file. You can specify a set of variables that must be read.

Parameters

Input argument iFileName | the absolute file name of the variable file.
Input argument iVariables | an array of variable names you want to be read. Specify NULL if you want all the variables in the file to be imported.

Returns

CK_OK if successfull

See Also

CKVariableManager, Export


CKVariableManager::MarkAsCompositionDepending

Method CKVariableManager::MarkAsCompositionDepending

XBOOL CKVariableManager::MarkAsCompositionDepending(const char* iName, XBOOL iSaving)

Sets a variable that is not composition depending as a depending one. This variable will be saved in composition, overriding its application

Parameters

Input argument iName | the absolute name of the variable, in the form “category/varname”
Input argument iSaving | TRUE if the variable must be saved with composition, FALSE otherwise.

Returns

CK_OK if the variable were existing and application dependent

See Also

CKVariableManager


CKVariableManager::RestoreAll

Method CKVariableManager::RestoreAll

void CKVariableManager::RestoreAll(RestoreMode iMode = ALL)

Restores a defined set of variables to their default value.

Parameters

Input argument iMode

the set of variables that must be restored. This can be CKVariableManager::ALL : every variables CKVariableManager::COMPOSITION : every variables Composition Depending, including the ones marked as so. CKVariableManager::NATIVECOMPOSITION : only variables natively Composition Depending

Returns

CK_OK if the variable was found

See Also

CKVariableManager


CKVariableManager::RestoreValue

Method CKVariableManager::RestoreValue

XBOOL CKVariableManager::RestoreValue(const char* iName)

Restores a variable to its default value.

Parameters

Input argument iName

the absolute name of the variable, in the form “category/varname”

Returns

CK_OK if the variable was found

See Also

CKVariableManager


CKVariableManager::SetApplicationFile

Method CKVariableManager::SetApplicationFile

CKERROR CKVariableManager::SetApplicationFile(const char* iFileName)

Sets a config file for the application depending variables. These variables will be saved in this file at each clear all, and the values of the forced-composition variables will be restored according to this file too.

Parameters

iName : the absolute file name of the config file.

Returns

CK_OK if the variable was found

See Also

CKVariableManager


CKVariableManager::SetStringValue

Method CKVariableManager::SetStringValue

XBOOL CKVariableManager::SetStringValue(const char* iName, const char* iValue)

Sets the value of a variable as a string.

Parameters

Input argument iName | the absolute name of the variable, in the form “category/varname”
Input argument iValue | string representation of the value of the variable

Returns

CK_OK if the variable was found

See Also

CKVariableManager


CKVariableManager::SetValue

Method CKVariableManager::SetValue

XBOOL CKVariableManager::SetValue(const char* iName, int iValue)
XBOOL
CKVariableManager::SetValue(const char* iName, float iValue)
XBOOL
CKVariableManager::SetValue(const char* iName, const char* iValue)

Sets the value of a variable.

Parameters

iName

the absolute name of the variable, in the form “category/varname” oValue : new value of the variable

Returns

TRUE if the variable was found

See Also

CKVariableManager


CKVariableManager::SynchronizeApplicationFile

Method CKVariableManager::SynchronizeApplicationFile

CKERROR CKVariableManager::SynchronizeApplicationFile(CKBOOL iToFile,const XArray<const char*>* iVariables = NULL)

Synchronizes the application and the application file, either by writing the variables values to the file, or by reading them from the file. You can shynchronize all the variables or only a subset of them.

Parameters

Input argument iToFile | TRUE if the variables must be written to the file, FALSE if the variables must be read from the file.
Input argument iVariables | array of variable names to synchronize. NULL means all the variables.

Returns

CK_OK if the synchronization is ok.

See Also

CKVariableManager


CKVariableManager::Variable

Class CKVariableManager::Variable

This class represent a bound variable, accessing by its name with the VariableManager. You can't instantiate Variable directly but either their simple derived classes for existing types VariableInt, VariableFloat or VariableString either one specific class you will derive from one of the preceding class, to override some of the virtual functions presenting its functionality.

Subclasses

VariableFloat, VariableInt, and VariableString

Groups

Type Definitions
Enumerated Type Flags |
Enumerated Type Type | Types
Variables
Virtual Method Method GetDescription | Returns the description of the variable. Can be NULL.
Virtual Method Method GetFlags | This function gets the flags of the variable.
Virtual Method Method GetRepresentation | This function gives the representation (ie the input format) of a variable type.
Pure Virtual Method Method GetStringValue | Fills a string with the string representation of the variable.
Pure Virtual Method Method GetType | This function gives the type of the variable. It can be any type of the VariableType enum : Variable::INT, Variable::FLOAT or Variable::STRING.
Method IsCompositionDepending | This function tells if the variable must be saved with the current composition. Default is true.
Pure Virtual Method Method IsDifferentFromDefault | This function tells if the variable is different from its default value.
Method IsHidden | This function tells if the variable must be hidden in the interface of the application. Default is false.
Method IsNativeCompositionDepending | This function tells if the variable must be saved with the current composition. Default is true.
Method IsReadOnly | This function tells if the variable can be written from the VariableManager. Default is false.
Virtual Method Method ModifyFlags | This function modifies the flags of the variable.
Pure Virtual Method Method Restore | This function restore the variable to its default value.
Method SetDescription | This function sets the description of the variable.
Pure Virtual Method Method SetStringValue | sets a variable from its string representation of a value.
Destructors
Virtual Method Method ~Variable | Dtor

See Also

CKVariableManager


CKVariableManager::Variable::Flags

Enumerated Type CKVariableManager::Variable::Flags

enum Flags {
READONLY = 0x0001,
HIDDEN = 0x0002,
COMPOSITIONBOUND = 0x0004,
NATIVEONLY = 0x0008,
NATIVECOMPOSITIONBOUND = 0x000c,

}

Members

COMPOSITIONBOUND | Variable value will be saved when saving a composition (user decision in the interface)
HIDDEN | Variable will not be shown in the interface
NATIVECOMPOSITIONBOUND | Combination of COMPOSITIONBOUND & NATIVEONLY to indicate the value must be saved within a composition
NATIVEONLY | Variable value will be saved when saving a composition (variable creater decision in code)
READONLY | Variable can only be read , not written too.


CKVariableManager::Variable::Type

Enumerated Type CKVariableManager::Variable::Type

enum Type {
INT = 1,
FLOAT = 2,
STRING = 3
}

Members

FLOAT | A floating point value
INT | An Integer
STRING | A XString

Remarks

Types


CKVariableManager::Variable::GetDescription

Virtual Method Method CKVariableManager::Variable::GetDescription

virtual const char* CKVariableManager::Variable::GetDescription() const

Returns the description of the variable. Can be NULL.

See Also

CKVariableManager


CKVariableManager::Variable::GetFlags

Virtual Method Method CKVariableManager::Variable::GetFlags

virtual XDWORD CKVariableManager::Variable::GetFlags()

This function gets the flags of the variable.

See Also

CKVariableManager


CKVariableManager::Variable::GetRepresentation

Virtual Method Method CKVariableManager::Variable::GetRepresentation

virtual const char* CKVariableManager::Variable::GetRepresentation() const

This function gives the representation (ie the input format) of a variable type.

Remarks

By default this string is NULL, saying that the format is standard (an int is edited as an integer, float as a float, etc.), but you can give a complex format for your customized types. 3 different formats are supported:

“range:s=min;e=max;t=step” range from s to e, with an optional step of t (default is 1) and an optionnal description in parenthesis.

"enum:a=toto;b=titi;c=tutu;..." list of possible value a,b,c, with optional names in parenthesis

"flag:a=toto;b=titi;c=tutu;..." same as enum. but represented as a flag

See Also

CKVariableManager


CKVariableManager::Variable::GetStringValue

Pure Virtual Method Method CKVariableManager::Variable::GetStringValue

virtual void CKVariableManager::Variable::GetStringValue(XString& oValue) const

Fills a string with the string representation of the variable.

See Also

CKVariableManager


CKVariableManager::Variable::GetType

Pure Virtual Method Method CKVariableManager::Variable::GetType

virtual Type CKVariableManager::Variable::GetType() const

This function gives the type of the variable. It can be any type of the VariableType enum : Variable::INT, Variable::FLOAT or Variable::STRING.

See Also

CKVariableManager


CKVariableManager::Variable::IsCompositionDepending

Method CKVariableManager::Variable::IsCompositionDepending

XBOOL CKVariableManager::Variable::IsCompositionDepending() const

This function tells if the variable must be saved with the current composition. Default is true.

See Also

CKVariableManager


CKVariableManager::Variable::IsDifferentFromDefault

Pure Virtual Method Method CKVariableManager::Variable::IsDifferentFromDefault

virtual XBOOL CKVariableManager::Variable::IsDifferentFromDefault() const

This function tells if the variable is different from its default value.

See Also

CKVariableManager


CKVariableManager::Variable::IsHidden

Method CKVariableManager::Variable::IsHidden

XBOOL CKVariableManager::Variable::IsHidden() const

This function tells if the variable must be hidden in the interface of the application. Default is false.

See Also

CKVariableManager


CKVariableManager::Variable::IsNativeCompositionDepending

Method CKVariableManager::Variable::IsNativeCompositionDepending

XBOOL CKVariableManager::Variable::IsNativeCompositionDepending() const

This function tells if the variable must be saved with the current composition. Default is true.

See Also

CKVariableManager


CKVariableManager::Variable::IsReadOnly

Method CKVariableManager::Variable::IsReadOnly

XBOOL CKVariableManager::Variable::IsReadOnly() const

This function tells if the variable can be written from the VariableManager. Default is false.

See Also

CKVariableManager


CKVariableManager::Variable::ModifyFlags

Virtual Method Method CKVariableManager::Variable::ModifyFlags

virtual void CKVariableManager::Variable::ModifyFlags(XDWORD iAdd, XDWORD iRemove)

This function modifies the flags of the variable.

See Also

CKVariableManager


CKVariableManager::Variable::Restore

Pure Virtual Method Method CKVariableManager::Variable::Restore

virtual void CKVariableManager::Variable::Restore()

This function restore the variable to its default value.

See Also

CKVariableManager


CKVariableManager::Variable::SetDescription

Method CKVariableManager::Variable::SetDescription

void CKVariableManager::Variable::SetDescription(const char* iDescription)

This function sets the description of the variable.

See Also

CKVariableManager


CKVariableManager::Variable::SetStringValue

Pure Virtual Method Method CKVariableManager::Variable::SetStringValue

virtual void CKVariableManager::Variable::SetStringValue(const char* iValue)

sets a variable from its string representation of a value.

See Also

CKVariableManager


CKVariableManager::Variable::~Variable

Virtual Method Method CKVariableManager::Variable::~Variable

virtual CKVariableManager::Variable::~Variable()

Remarks

Dtor


CKVariableManager::Watcher

Class CKVariableManager::Watcher

Variable modification watching class.

Subclasses

CKVideoManager

Remarks

This clas is used to watch a variable and detect when it is written to or read from (by the use of the VariableManager only)

Groups

Variables
Virtual Method Method PostWrite | Called after a variable is written by manager.
Virtual Method Method PreRead | Called before a variable is read by manager.
Destructors
Virtual Method Method ~Watcher | Description: Destroys the object This destroys all the subordinate objects for this object.

See Also

CKVariableManager


CKVariableManager::Watcher::PostWrite

Virtual Method Method CKVariableManager::Watcher::PostWrite

virtual void CKVariableManager::Watcher::PostWrite(const char* iName)

Called after a variable is written by manager.

Remarks

This function is called when a variable is modified by the interface of the CKVariableManager, to let the owner of the variable be notified and react accordingly. To use this functionality, you'll have to derive a new class for your specific variable and implement what has to be done in the update function.

See Also

CKVariableManager, PreRead


CKVariableManager::Watcher::PreRead

Virtual Method Method CKVariableManager::Watcher::PreRead

virtual void CKVariableManager::Watcher::PreRead(const char* iName)

Called before a variable is read by manager.

Remarks

This function is called when a variable is read by the interface of the CKVariableManager, to let the owner of the variable be notified and react accordingly. To use this functionality, you'll have to derive a new class for your specific variable and implement what has to be done in the update function.

See Also

CKVariableManager, PostWrite


CKVariableManager::Watcher::~Watcher

Virtual Method Method CKVariableManager::Watcher::~Watcher

virtual CKVariableManager::Watcher::~Watcher()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


Video Engine

Class CKVideo | Base Class for Video management
Structure CKVideoInputFormatDesc | Describes a supported format for a video live source
Class CKVideoManager | Video Plugin Manager.

See Also

Classes


CKVideo

CKObject

CKSceneObject

CKBeObject
Show full derivation trees

CKVideo

Remarks

CKVideo provides only common method for all video types.

Groups

Data Members | Operations | Callbacks | General | General Options | Infos | Input Options | Output Options | Sound Options

Data Members
Member Variable m_VideoManager | Current Video Manager
Operations
Virtual Method Method CaptureImage | Capture the current video image in the given texture.
Method GetCKContext | Returns a pointer to the owner CKContext
Method GetClassID | Returns the Class Identifier for this object
Method GetID | Returns the Identifier for this object
Method GetMemoryOccupation | Returns the size taken by this object and its data in memory.
Virtual Method Method Load | Load the video with the current settings.
Virtual Method Method Pause | Pause the video.
Virtual Method Method Play | Play the video.
Virtual Method Method Seek | Seek a video file.
Method SetAppDataVSL | Fix Nicolas Conil: This function is the VSL binded version of CKObject::SetAppData above created at version=0x11042007 (cf. binding in Behaviors/VSLManager/VSL_ManagerBind_CK2.cpp)
Virtual Method Method SetLastError | Set the last video error.
Virtual Method Method SetSaveOptions | Set the video saving options
Virtual Method Method Stop | Stop the video.
Virtual Method Method Unload | Unload a video.
Callbacks
Virtual Method Method AddEventCallBack | Add / Remove a callback on a given event
General
Virtual Method Method GetErrorDescrition | Get video information
Virtual Method Method GetLastError | Get the last video error.
Virtual Method Method ResetLastError | Reset the last video error to CK_OK.
General Options
Virtual Method Method GetAuthorFlags | Get the current video state.
Virtual Method Method GetLimitTimes | Get the video starting time
Virtual Method Method GetLoop | Get the video 'Loop' option value
Virtual Method Method GetRuntimeFlags | Get the current video options.
Virtual Method Method GetSaveOptions | Get video saving options
Virtual Method Method GetSpeed | Get the video 'Loop' option value
Virtual Method Method GetVideoPriority | Get the loading thread priority
Virtual Method Method IsAsynchronous | Is the video loading asynchronous
Virtual Method Method SetAsynchronous | Set if the video should be loaded asynchronously
Virtual Method Method SetLimitTimes | Set the video new seeking time for next restart
Virtual Method Method SetLoop | Set the video 'Loop' option value
Virtual Method Method SetSpeed | Change the speed of the speed.
Virtual Method Method SetVideoPriority | Set the loading thread priority
Infos
Virtual Method Method GetPlayingFrame | Get the current video frame.
Virtual Method Method GetPlayingTime | Get the current video time.
Virtual Method Method GetState | Get the current video state.
Virtual Method Method GetVideoInfo | Get video information
Input Options
Virtual Method Method GetAudioInputID | Get current input ID for the video
Virtual Method Method GetFileName | Get the video File name.
Virtual Method Method GetFilePath | Get the video file full path.
Virtual Method Method GetType | Get Video Type: File, Live or Streamed
Virtual Method Method GetUrl | Get the video url path.
Virtual Method Method GetVideoInputID | Get current input ID for the video
Virtual Method Method SetAudioInputID | Set current input ID for the video
Virtual Method Method SetFileName | Set the video File name.
Virtual Method Method SetType | Set the video Type: File, Live or Streamed
Virtual Method Method SetUrl | Set the video url path.
Virtual Method Method SetVideoInputID | Set current input ID for the video
Output Options
Virtual Method Method GetDestination | Get the video destination rect
Virtual Method Method GetDisplayMode | Get the current display mode.
Virtual Method Method GetFillTexture | Get the video 'Fill Textrure' option.
Virtual Method Method GetTexture | Get the current target texture
Virtual Method Method GetTextureOptions | Get the current target texture
Virtual Method Method SetDestination | Set the video destination rect
Virtual Method Method SetDisplayMode | Set the video display mode: screen or texture
Virtual Method Method SetFillTexture | Set the video 'Fill Texture' option
Virtual Method Method SetTexture | Set the target texture.
Virtual Method Method SetTextureOptions | Set the texture options
Sound Options
Virtual Method Method EnableAudio | Should we play the video sound ?
Virtual Method Method GetBalance | Get the sound balance.
Virtual Method Method GetVolume | Get the sound volume.
Virtual Method Method IsAudioEnabled | Is the video sound played ?
Virtual Method Method SetBalance | Set the sound balance
Virtual Method Method SetVolume | Set the sound volume

See Also

CKVideoManager


CKVideo::m_VideoManager

Member Variable CKVideo::m_VideoManager

CKVideoManager* CKVideo::m_VideoManager

Remarks

Current Video Manager


CKVideo::CaptureImage

Virtual Method Method CKVideo::CaptureImage

virtual CKERROR CKVideo::CaptureImage(CKTexture* iTarget)

Capture the current video image in the given texture.

Parameters

iVideo: video to get image from, iTexture: texture where to save the captures image

Returns

CK_OK if success, Any video error otherwise.

Remarks

This method should not change the target texture format, if needed, we must warn the user by documenting it or returning a value saying so.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::Load

Virtual Method Method CKVideo::Load

virtual CKERROR CKVideo::Load()

Load the video with the current settings.

Returns

CK_OK if success, Any video error otherwise.

Remarks

The video must be loaded.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::Pause

Virtual Method Method CKVideo::Pause

virtual CKERROR CKVideo::Pause()

Pause the video.

Returns

CK_OK if success, Any video error otherwise.

Remarks

The video must be loaded.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::Play

Virtual Method Method CKVideo::Play

virtual CKERROR CKVideo::Play()

Play the video.

Returns

CK_OK if success, Any video error otherwise.

Remarks

If the video is not loaded, it loads it. As it may take some time, it is advised to load video before to play.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::Seek

Virtual Method Method CKVideo::Seek

virtual CKERROR CKVideo::Seek(float iValue, CKBOOL iHomogeneous=FALSE)

Seek a video file.

Parameters

Input argument iValue | Position where to seek
Input argument iHomogeneous | are we seeking with an homogenous value (between 0 and 1) or with a time in ms.

Returns

CK_OK if success, Any video error otherwise.

Remarks

The video must be loaded. Once rewinded, the video is paused

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::SetLastError

Virtual Method Method CKVideo::SetLastError

virtual void CKVideo::SetLastError(int iError)

Set the last video error.

Parameters

iError

video error to set as last.

See Also

CKVideoManager, CKVideo, ResetLastError, GetLastError, GetErrorDescripion


CKVideo::SetSaveOptions

Virtual Method Method CKVideo::SetSaveOptions

virtual CKERROR CKVideo::SetSaveOptions(CK_VIDEO_SAVEOPTION iOption)

Set the video saving options

Parameters

Input argument iOption

saving option to set

See Also

CKVideoManager, CKVideo


CKVideo::Stop

Virtual Method Method CKVideo::Stop

virtual CKERROR CKVideo::Stop()

Stop the video.

Returns

CK_OK if success, Any video error otherwise.

Remarks

The video must be loaded.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::Unload

Virtual Method Method CKVideo::Unload

virtual CKERROR CKVideo::Unload(CKBOOL iForceSync=FALSE)

Unload a video.

Parameters

Input argument iForceSync

when this parameter is true, we force a synchronous unloading whatever syncrhonous parameter is set on the video.

Returns

CK_OK if success, Any video error otherwise.

Remarks

The video must be loaded.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::AddEventCallBack

Virtual Method Method CKVideo::AddEventCallBack

virtual CKBOOL CKVideo::AddEventCallBack(CK_VIDEO_EVENT iEvent, CK_VIDEOEVENTCALLBACK iFunction, void *iArgument)
virtual CKBOOL CKVideo::RemoveEventCallBack(CK_VIDEO_EVENT iEvent, CK_VIDEOEVENTCALLBACK iFunction)

Add / Remove a callback on a given event

Returns

The requested info

Remarks

The new image callbacks are only supported when playing the video on a texture, not on the screen.

See Also

CKVideoManager, CKVideo, CKVideoLive, CKVideo


CKVideo::GetErrorDescrition

Virtual Method Method CKVideo::GetErrorDescrition

virtual XString CKVideo::GetErrorDescrition(int iError)

Get video information

Returns

The requested info

Remarks

The video need to be loaded to get these informations This method is thread safe. Never access the variable directly.

See Also

CKVideoManager, CKVideo, GetLastError, GetErrorDescripion


CKVideo::GetLastError

Virtual Method Method CKVideo::GetLastError

virtual int CKVideo::GetLastError()

Get the last video error.

Returns

last video error.

See Also

CKVideoManager, CKVideo, ResetLastError, SetLastError, GetErrorDescripion


CKVideo::ResetLastError

Virtual Method Method CKVideo::ResetLastError

virtual void CKVideo::ResetLastError()

Reset the last video error to CK_OK.

See Also

CKVideoManager, CKVideo, GetLastError, SetLastError, GetErrorDescripion


CKVideo::GetAuthorFlags

Virtual Method Method CKVideo::GetAuthorFlags

virtual DWORD CKVideo::GetAuthorFlags()

Get the current video state.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetState


CKVideo::GetLimitTimes

Virtual Method Method CKVideo::GetLimitTimes

virtual void CKVideo::GetLimitTimes(float* oStartTime, float* oStopTime)

Get the video starting time

Parameters

Output argument oStartTime | variable receiving the start time. May be NULL.
Output argument oStopTime | variable receiving the stop time. May be NULL.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetLoop


CKVideo::GetLoop

Virtual Method Method CKVideo::GetLoop

virtual CKBOOL CKVideo::GetLoop()

Get the video 'Loop' option value

Returns

iLoop: should the video loop ?

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetLoop


CKVideo::GetRuntimeFlags

Virtual Method Method CKVideo::GetRuntimeFlags

virtual DWORD CKVideo::GetRuntimeFlags()

Get the current video options.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetState


CKVideo::GetSaveOptions

Virtual Method Method CKVideo::GetSaveOptions

virtual CK_VIDEO_SAVEOPTION CKVideo::GetSaveOptions()

Get video saving options

See Also

CKVideoManager, CKVideo


CKVideo::GetSpeed

Virtual Method Method CKVideo::GetSpeed

virtual float CKVideo::GetSpeed()

Get the video 'Loop' option value

Returns

The video speed

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetLoop


CKVideo::GetVideoPriority

Virtual Method Method CKVideo::GetVideoPriority

virtual VXTHREAD_PRIORITY CKVideo::GetVideoPriority()

Get the loading thread priority

Returns

The requested info

Remarks

The video need to be loaded to get these informations This method is thread safe. Never access the variable directly.

See Also

CKVideoManager, CKVideo, CKVideoLive, CKVideo


CKVideo::IsAsynchronous

Virtual Method Method CKVideo::IsAsynchronous

virtual CKBOOL CKVideo::IsAsynchronous()

Is the video loading asynchronous

Remarks

Return TRUE is loading is asynchronous, FALSE otherwise This method is thread safe. Never access the variable directly.

See Also

CKVideo::LoadAsynchronously


CKVideo::SetAsynchronous

Virtual Method Method CKVideo::SetAsynchronous

virtual CKERROR CKVideo::SetAsynchronous(CKBOOL iAsynch)

Set if the video should be loaded asynchronously

Parameters

Input argument iAsynch

load asynchronously if TRUE, synchronously if FALSE

Remarks

The video must be unloaded (state = invalid). This method is thread safe. Never access the variable directly.

See Also

CKVideo::IsLoadingAsynchronous


CKVideo::SetLimitTimes

Virtual Method Method CKVideo::SetLimitTimes

virtual CKERROR CKVideo::SetLimitTimes(float iStartTime, float iStopTime)

Set the video new seeking time for next restart

Remarks

When value is <0, no change is done to the value This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetLoop


CKVideo::SetLoop

Virtual Method Method CKVideo::SetLoop

virtual CKERROR CKVideo::SetLoop(CKBOOL iLoop)

Set the video 'Loop' option value

Parameters

Input argument iLoop

should the video loop ?

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetLoop


CKVideo::SetSpeed

Virtual Method Method CKVideo::SetSpeed

virtual CKERROR CKVideo::SetSpeed(float iSpeed)

Change the speed of the speed.

Parameters

Input argument iSpeed

speed to set.

Returns

CK_OK if success, Any video error otherwise.

Remarks

Speed cannot be changed on every video. It depends on the codec it uses. Check the video capabilities to know if you can modify the speed. The video must be loaded. This method is thread safe. Never access the variable directly.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::SetVideoPriority

Virtual Method Method CKVideo::SetVideoPriority

virtual void CKVideo::SetVideoPriority(VXTHREAD_PRIORITY iPriority)

Set the loading thread priority

Returns

The requested info

Remarks

The video need to be loaded to get these informations This method is thread safe. Never access the variable directly.

See Also

CKVideoManager, CKVideo, CKVideoLive, CKVideo


CKVideo::GetPlayingFrame

Virtual Method Method CKVideo::GetPlayingFrame

virtual int CKVideo::GetPlayingFrame()

Get the current video frame.

Returns

-1 if current frame is not available. >=0 otherwise.

Remarks

This method is thread safe.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::GetPlayingTime

Virtual Method Method CKVideo::GetPlayingTime

virtual float CKVideo::GetPlayingTime(CKBOOL iHomogeneous=FALSE)

Get the current video time.

Parameters

Input argument iHomogeneous

are we geting an homogenous value (between 0 and 1) or a time in ms.

Returns

-1 if current time is not available. >=0 otherwise.

Remarks

This method is thread safe.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::GetState

Virtual Method Method CKVideo::GetState

virtual CK_VIDEO_STATE CKVideo::GetState()

Get the current video state.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetState


CKVideo::GetVideoInfo

Virtual Method Method CKVideo::GetVideoInfo

virtual const CKVideoInfo* CKVideo::GetVideoInfo()

Get video information

Returns

The requested info

Remarks

The video need to be loaded to get these informations This method is thread safe. Never access the variable directly.

See Also

CKVideoManager, CKVideo, CKVideoLive, CKVideo


CKVideo::GetAudioInputID

Virtual Method Method CKVideo::GetAudioInputID

virtual int CKVideo::GetAudioInputID()

Get current input ID for the video

Returns

ID of the live source used.

Remarks

For video live only The possible live source ID are given by the video manager This method has no effect when the video is loaded.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::GetFileName

Virtual Method Method CKVideo::GetFileName

virtual XString CKVideo::GetFileName()

Get the video File name.

Parameters

Current file name. Path is not in the result.

Remarks

For video file type only This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetFilePath, CKVideo::SetFileName


CKVideo::GetFilePath

Virtual Method Method CKVideo::GetFilePath

virtual XString CKVideo::GetFilePath()

Get the video file full path.

Remarks

For video file type only This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetFilePath, CKVideo::SetFileName


CKVideo::GetType

Virtual Method Method CKVideo::GetType

virtual CK_VIDEO_TYPE CKVideo::GetType()

Get Video Type: File, Live or Streamed

See Also

CKVideoManager, CKVideo


CKVideo::GetUrl

Virtual Method Method CKVideo::GetUrl

virtual XString CKVideo::GetUrl()

Get the video url path.

Remarks

For video stream only This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetFilePath, CKVideo::SetFileName


CKVideo::GetVideoInputID

Virtual Method Method CKVideo::GetVideoInputID

virtual int CKVideo::GetVideoInputID()

Get current input ID for the video

Returns

ID of the live source used.

Remarks

For video live only The possible live source ID are given by the video manager This method has no effect when the video is loaded.

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::SetAudioInputID

Virtual Method Method CKVideo::SetAudioInputID

virtual CKERROR CKVideo::SetAudioInputID(int iInputID)

Set current input ID for the video

Parameters

Input argument iInputID

ID of the live source to use.

Returns

Value | Meaning
CK_OK | if success,
CKERR_INVALIDFILE | if the file is invalid

Remarks

For video live only The possible live source ID are given by the video manager The video must be unloaded (state = invalid).

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::SetFileName

Virtual Method Method CKVideo::SetFileName

virtual CKERROR CKVideo::SetFileName(XString& iFileName)

Set the video File name.

Parameters

Input argument iFileName

file name (absolute or relative).

Returns

CK_OK if success, Any video error otherwise.

Remarks

For video file type only The system tries to locate the file in the bitmap searche directories. It has to exist, otherwise, we return CKERR_INVALIDFILE. The video must be unloaded (state = invalid). This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetFileName


CKVideo::SetType

Virtual Method Method CKVideo::SetType

virtual CKERROR CKVideo::SetType(CK_VIDEO_TYPE iType)

Set the video Type: File, Live or Streamed

Parameters

Input argument iType

video type

Remarks

The video must be unloaded (state = invalid).

See Also

CKVideoManager, CKVideo


CKVideo::SetUrl

Virtual Method Method CKVideo::SetUrl

virtual CKERROR CKVideo::SetUrl(XString& iUrl)

Set the video url path.

Parameters

Input argument iUrl

url to the video (http or mms protocol).

Returns

CK_OK if success, Any video error otherwise.

Remarks

For video stream only The video must be unloaded (state = invalid). This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetFileName


CKVideo::SetVideoInputID

Virtual Method Method CKVideo::SetVideoInputID

virtual CKERROR CKVideo::SetVideoInputID(int iInputID)

Set current input ID for the video

Parameters

Input argument iInputID

ID of the live source to use.

Returns

Value | Meaning
CK_OK | if success,
CKERR_INVALIDFILE | if the file is invalid

Remarks

For video live only The possible live source ID are given by the video manager The video must be unloaded (state = invalid).

See Also

CKVideoManager::CreateSource, CKVideoManager::HasSource, CKVideo


CKVideo::GetDestination

Virtual Method Method CKVideo::GetDestination

virtual VxRect CKVideo::GetDestination()

Get the video destination rect

Returns

Desctination rect.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetDestination


CKVideo::GetDisplayMode

Virtual Method Method CKVideo::GetDisplayMode

virtual CK_VIDEO_DISPLAY CKVideo::GetDisplayMode()

Get the current display mode.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetState


CKVideo::GetFillTexture

Virtual Method Method CKVideo::GetFillTexture

virtual CKBOOL CKVideo::GetFillTexture()

Get the video 'Fill Textrure' option.

Returns

Destination rect.

Remarks

When the video must fill the texture, it is resized each frame to fit the texture video memory size. This may be useful, but is less less efficient. This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetFillTexture


CKVideo::GetTexture

Virtual Method Method CKVideo::GetTexture

virtual CKTexture* CKVideo::GetTexture()

Get the current target texture

Remarks

Return NULL if current display mode is screen This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetState


CKVideo::GetTextureOptions

Virtual Method Method CKVideo::GetTextureOptions

virtual void CKVideo::GetTextureOptions(CKBOOL &oAllowFormatChange, CKBOOL &oAllowConditionalTexture)

Get the current target texture

Remarks

Return NULL if current display mode is screen This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetState


CKVideo::SetDestination

Virtual Method Method CKVideo::SetDestination

virtual CKERROR CKVideo::SetDestination(VxRect& iDestination)

Set the video destination rect

Parameters

Input argument iDestination

destination rect,

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetDestination


CKVideo::SetDisplayMode

Virtual Method Method CKVideo::SetDisplayMode

virtual CKERROR CKVideo::SetDisplayMode(CK_VIDEO_DISPLAY iMode)

Set the video display mode: screen or texture

Parameters

Input argument iMode

display mode

Remarks

The video must be unloaded (state = invalid). This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetLoop


CKVideo::SetFillTexture

Virtual Method Method CKVideo::SetFillTexture

virtual CKERROR CKVideo::SetFillTexture(CKBOOL iFill)

Set the video 'Fill Texture' option

Parameters

Input argument iFill

option value

Remarks

When the video must fill the texture, it is resized each frame to fit the texture video memory size. This may be usefull, but is less less efficient. This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetFillTexture


CKVideo::SetTexture

Virtual Method Method CKVideo::SetTexture

virtual CKERROR CKVideo::SetTexture(CKTexture* iTarget)

Set the target texture.

Parameters

iMode: display mode

Remarks

Has no effect if current display mode is screen The video must be unloaded (state = invalid). This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetLoop


CKVideo::SetTextureOptions

Virtual Method Method CKVideo::SetTextureOptions

virtual CKERROR CKVideo::SetTextureOptions(CKBOOL iAllowFormatChange, CKBOOL iAllowConditionalTexture)

Set the texture options

Parameters

Input argument iAllowConditionalTexture

do we allow the system to create conditional non pow2 textures for this video ?

Remarks

Has no effect if current display mode is screen The video must be unloaded (state = invalid). This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetLoop


CKVideo::EnableAudio

Virtual Method Method CKVideo::EnableAudio

virtual CKERROR CKVideo::EnableAudio(CKBOOL iEnable)

Should we play the video sound ?

Parameters

Input argument iEnable

TRUE to play sound, FALSE not to.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetVolume, CKVideo::SetBalance, CKVideo::GetBalance


CKVideo::GetBalance

Virtual Method Method CKVideo::GetBalance

virtual float CKVideo::GetBalance()

Get the sound balance.

Returns

Sound Balance between -1 and 1.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetBalance, CKVideo::SetVolume, CKVideo::GetVolume


CKVideo::GetVolume

Virtual Method Method CKVideo::GetVolume

virtual float CKVideo::GetVolume()

Get the sound volume.

Returns

Sound Volume between 0 and 1.

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetVolume, CKVideo::SetBalance, CKVideo::GetBalance


CKVideo::IsAudioEnabled

Virtual Method Method CKVideo::IsAudioEnabled

virtual CKBOOL CKVideo::IsAudioEnabled()

Is the video sound played ?

Returns

TRUE if sound is player, FALSE otherwise

Remarks

If the video has no sound channed, the method will return FALSE This method is thread safe. Never access the variable directly.

See Also

CKVideo::SetVolume, CKVideo::SetBalance, CKVideo::GetBalance


CKVideo::SetBalance

Virtual Method Method CKVideo::SetBalance

virtual CKERROR CKVideo::SetBalance(float iBalance)

Set the sound balance

Parameters

Input argument iBalance

value between -1 (left) and 1 (right)

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetBalance, CKVideo::SetVolume, CKVideo::GetVolume


CKVideo::SetVolume

Virtual Method Method CKVideo::SetVolume

virtual CKERROR CKVideo::SetVolume(float iVolume)

Set the sound volume

Parameters

Input argument iVolume

percentage value between 0 and 1

Remarks

This method is thread safe. Never access the variable directly.

See Also

CKVideo::GetVolume, CKVideo::SetBalance, CKVideo::GetBalance


CKVideoInputFormatDesc

Structure CKVideoInputFormatDesc

struct CKVideoInputFormatDesc
{
XString m_Format;
Vx2DVector m_Size;
Vx2DVector m_Frequency;
}

Describes a supported format for a video live source

Members

m_Format | Readable name for the format (RGB32, YUY2... etc...)
m_Frequency | Minimum and Maximum possible FPS
m_Size | Size of the input stream image

See Also

CKVideoManager, CKVideo


CKVideoManager

Class CKVideoManager

Video Plugin Manager.

CKBaseManager

CKVariableManager::Watcher
Show brief derivation trees

CKVideoManager

CKBaseManager

CKVariableManager::Watcher
Show full derivation trees

CKVideoManager

Remarks

The video manager is implemented by an external plugin. The currently used instance of this class may be retrieved through the CKContext::GetVideoManager() method

Groups

General
Virtual Method Method CreateVideo | Create a new CKVideo.
Static Object Method GetGUID | Get the video capabilities of the current video manager
Options
Virtual Method Method GetFrameRateForScreenMode | Get the current process rate limitation in the screen mode.
Virtual Method Method GetSaveOptions | Get the video global save options
Virtual Method Method SetFrameRateForScreenMode | Set a process rate limitation in the screen mode.
Virtual Method Method SetSaveOptions | Set the video global save options
Plugin Management
Virtual Method Method GetActivePlugin | Get the currently selected video plugin
Virtual Method Method GetVideoPlugin | Get a video plugin. Give 0 for best plugin.
Virtual Method Method GetVideoPluginByGuid | Get a video plugin from its GUID
Virtual Method Method GetVideoPluginByName | Get a video plugin from its name
Virtual Method Method RegisterVideoPlugin | Register a new video implementation Plugin
Virtual Method Method UnregisterVideoPlugin | Unregister a video implementation plugin
Video Management
Virtual Method Method GetVideo | Get the number of registered videos
Virtual Method Method GetVideoCount | Get the number of registered videos
Virtual Method Method RegisterVideo | Register a new video object
Virtual Method Method UnloadAllVideos | Unload all videos' sources and/or preview
Virtual Method Method UnregisterVideo | Unregister a video object

See Also

CKContext::GetVideoManager,CKVideo


CKVideoManager::CreateVideo

Virtual Method Method CKVideoManager::CreateVideo

virtual CKVideo* CKVideoManager::CreateVideo(CKSTRING iName, CK_OBJECTCREATION_OPTIONS iOptions)

Create a new CKVideo.

Returns

The requested info

Remarks

This method is implemented for VSL Binding.

See Also

CKVideoManager, CKVideo


CKVideoManager::GetGUID

Static Object Method CKVideoManager::GetGUID

static CKGUID CKVideoManager::GetGUID()

Get the video capabilities of the current video manager

Returns

video caps

See Also

CKVideoManager,CK_VIDEOMANAGER_CAPS


CKVideoManager::GetFrameRateForScreenMode

Virtual Method Method CKVideoManager::GetFrameRateForScreenMode

virtual float CKVideoManager::GetFrameRateForScreenMode()

Get the current process rate limitation in the screen mode.

Returns

Rate Limitation. A <=0 value means that no behavior rate limitation is set in screen mode.

See Also

CKVideoPlugin


CKVideoManager::GetSaveOptions

Virtual Method Method CKVideoManager::GetSaveOptions

virtual CK_VIDEO_SAVEOPTION CKVideoManager::GetSaveOptions()

Get the video global save options

Returns

saving options

See Also

CKVideoPlugin


CKVideoManager::SetFrameRateForScreenMode

Virtual Method Method CKVideoManager::SetFrameRateForScreenMode

virtual void CKVideoManager::SetFrameRateForScreenMode(float iFPS)

Set a process rate limitation in the screen mode.

Parameters

Input argument iFPS

rate limitation. When this value is <=0, no limitation is set.

See Also

CKVideoPlugin


CKVideoManager::SetSaveOptions

Virtual Method Method CKVideoManager::SetSaveOptions

virtual void CKVideoManager::SetSaveOptions(CK_VIDEO_SAVEOPTION iOptions)

Set the video global save options

Returns

saving options

See Also

CKVideoPlugin


CKVideoManager::GetActivePlugin

Virtual Method Method CKVideoManager::GetActivePlugin

virtual CKVideoPlugin* CKVideoManager::GetActivePlugin()

Get the currently selected video plugin

Returns

A video plugin

See Also

CKVideoPlugin


CKVideoManager::GetVideoPlugin

Virtual Method Method CKVideoManager::GetVideoPlugin

virtual CKVideoPlugin* CKVideoManager::GetVideoPlugin(int iIndex=0)

Get a video plugin. Give 0 for best plugin.

Returns

A video plugin

Remarks

If several are available, returns the first one.

See Also

CKVideoPlugin


CKVideoManager::GetVideoPluginByGuid

Virtual Method Method CKVideoManager::GetVideoPluginByGuid

virtual CKVideoPlugin* CKVideoManager::GetVideoPluginByGuid(CKGUID iGuid)

Get a video plugin from its GUID

Returns

a video plugin

See Also

CKVideoPlugin


CKVideoManager::GetVideoPluginByName

Virtual Method Method CKVideoManager::GetVideoPluginByName

virtual CKVideoPlugin* CKVideoManager::GetVideoPluginByName(XString& iName)

Get a video plugin from its name

Returns

A video plugin

Remarks

If several are available, returns the first one.

See Also

CKVideoPlugin


CKVideoManager::RegisterVideoPlugin

Virtual Method Method CKVideoManager::RegisterVideoPlugin

virtual CKERROR CKVideoManager::RegisterVideoPlugin(CKVideoPlugin* iPlugin)

Register a new video implementation Plugin

Parameters

Input argument iPlugin

plugin implementing the video

See Also

CKVideoPlugin


CKVideoManager::UnregisterVideoPlugin

Virtual Method Method CKVideoManager::UnregisterVideoPlugin

virtual CKERROR CKVideoManager::UnregisterVideoPlugin(CKVideoPlugin* iPlugin)

Unregister a video implementation plugin

Parameters

Input argument iPlugin

plugin implementing the video

See Also

CKVideoPlugin


CKVideoManager::GetVideo

Virtual Method Method CKVideoManager::GetVideo

virtual CKVideo* CKVideoManager::GetVideo(int iIndex)

Get the number of registered videos

Parameters

Input argument iIndex

Video to retrieve

See Also

CKVideo::CKVideo


CKVideoManager::GetVideoCount

Virtual Method Method CKVideoManager::GetVideoCount

virtual int CKVideoManager::GetVideoCount()

Get the number of registered videos

See Also

CKVideo::CKVideo


CKVideoManager::RegisterVideo

Virtual Method Method CKVideoManager::RegisterVideo

virtual CKERROR CKVideoManager::RegisterVideo(CKVideo* iVideo)

Register a new video object

Parameters

Input argument iVideo

video object to register

Remarks

Called at CKVideo creation

See Also

CKVideo::CKVideo


CKVideoManager::UnloadAllVideos

Virtual Method Method CKVideoManager::UnloadAllVideos

virtual void CKVideoManager::UnloadAllVideos(CKBOOL iSource, CKBOOL iPreview, CKBOOL iForceSync=FALSE)

Unload all videos' sources and/or preview

Parameters

Input argument iSource | Should we unload the sources
Input argument iPreview | Should we unload the previews
Input argument iForceSync | when this parameter is true, we force a synchronous unloading whatever synchronous parameter is set on the video.

See Also

CKVideoPlugin


CKVideoManager::UnregisterVideo

Virtual Method Method CKVideoManager::UnregisterVideo

virtual CKERROR CKVideoManager::UnregisterVideo(CKVideo* iVideo)

Unregister a video object

Parameters

Input argument iVideo

video object to register

Remarks

Called at CKVideo destruction

See Also

CKVideo::~CKVideo


VxBigFile

Class VxBigFile

Remarks

A VxBigFile is used to store several files together in a single file. Files stored in a big file can be accessed as normal files with the Find method which fills a VxSubFile class with the appropriate data to read the sub file content.

Groups

Operations
Method Append | Append a memory buffer or a file inside the big file.
Method Find | Find and return a sub-file.
Method GetIndex |
Method GetName | Return the filename of an opened bigfile
Method GetOrderedChunks |
Method LoadIndex | Loads an index file that contains the order in which the file should be stored inside the big file
Method Open | Opens an existing BigFile
Method Remove | Remove a sub-file.
Method Save | Creates a BigFile containing all the files appended.
Method SaveIndex | Saves an index file that contains the order in which the file are stored inside the big file
Classes
Class Chunk | File buffers as stored inside the big file
Class ProgressionCallback | A Callback class that can be implemented to handle the progression of VxBigFile::Save operation.
Type Definitions
Type Definition ChunkTable |


VxBigFile::Append

Method VxBigFile::Append

XBOOL VxBigFile::Append(const char* iReference, const char* iFileName, XBOOL iPersistent = TRUE, XBOOL iReplace = TRUE)
XBOOL
VxBigFile::Append(const char* iReference, const void* iBuffer, XDWORD iSize)

Remarks

Append a memory buffer or a file inside the big file.


VxBigFile::Find

Method VxBigFile::Find

XBOOL VxBigFile::Find(const char* iFileName, VxSubFile* oSubFile = NULL)

Remarks

Find and return a sub-file.


VxBigFile::GetIndex

Method VxBigFile::GetIndex

const ChunkTable& VxBigFile::GetIndex() const


VxBigFile::GetName

Method VxBigFile::GetName

const XString& VxBigFile::GetName() const

Remarks

Return the filename of an opened bigfile


VxBigFile::GetOrderedChunks

Method VxBigFile::GetOrderedChunks

const XArray<Chunk*>& VxBigFile::GetOrderedChunks() const


VxBigFile::LoadIndex

Method VxBigFile::LoadIndex

XBOOL VxBigFile::LoadIndex(const char* iFileName)

Remarks

Loads an index file that contains the order in which the file should be stored inside the big file


VxBigFile::Open

Method VxBigFile::Open

XBOOL VxBigFile::Open(const char* iFileName, XBOOL iKeepOrder = TRUE)

Remarks

Opens an existing BigFile


VxBigFile::Remove

Method VxBigFile::Remove

XBOOL VxBigFile::Remove(const char* iFileName)

Remarks

Remove a sub-file.


VxBigFile::Save

Method VxBigFile::Save

XBOOL VxBigFile::Save(const char* iFileName = NULL, ProgressionCallback* iCallback = NULL)

Remarks

Creates a BigFile containing all the files appended.


VxBigFile::SaveIndex

Method VxBigFile::SaveIndex

void VxBigFile::SaveIndex(const char* iFileName, XBOOL iDetails = FALSE)

Remarks

Saves an index file that contains the order in which the file are stored inside the big file


VxBigFile::Chunk

Class VxBigFile::Chunk

Remarks

File buffers as stored inside the big file

Groups

Data Members
Member Variable buffersize | if buffersize is <= 0, the buffer contains a file path, not yet loaded
Member Variable offset | offset inside the bigfile


VxBigFile::Chunk::buffersize

Member Variable VxBigFile::Chunk::buffersize

int VxBigFile::Chunk::buffersize

Remarks

if buffersize is <= 0, the buffer contains a file path, not yet loaded


VxBigFile::Chunk::offset

Member Variable VxBigFile::Chunk::offset

XDWORD VxBigFile::Chunk::offset

Remarks

offset inside the bigfile


VxBigFile::ProgressionCallback

Class VxBigFile::ProgressionCallback

Remarks

A Callback class that can be implemented to handle the progression of VxBigFile::Save operation.

Groups

Operations
Pure Virtual Method Method Progress

Progression value from 0 to 100


VxBigFile::ProgressionCallback::Progress

Pure Virtual Method Method VxBigFile::ProgressionCallback::Progress

virtual void VxBigFile::ProgressionCallback::Progress(const int iProgression)

Remarks

Progression value from 0 to 100


VxBigFile::ChunkTable

Type Definition VxBigFile::ChunkTable

typedef XHashTable<Chunk, const char*> VxBigFile::ChunkTable


VxConsoleListener

Class VxConsoleListener

A Listener which display informations into a console.

VxLogListener
Show brief derivation trees

VxConsoleListener

VxLogListener
Show full derivation trees

VxConsoleListener

Remarks

The log while be displayed like this: [MODULE] [LEVEL] [TIME] [FILE:LINE] : LOG. [TIME] is displayed if timeformat!=NODATE. [FILE:LINE] is displayed if flags&FILEINFO

Only one console can be created per executable. So you must not create more than one VxConsoleListener. It means you must not register many console listener with different name. But you can register many console listener with the name but with different module. See VxLog::RegisterListener.

Groups

Data Members
Static Object Member Variable m_Guid | The Guid of the console listener.
Operations
Method AddModule | Add a module in the listener.
Method GetDateAsString | Convert the current date to a string.
Method GetFlags | Get flags of the listener.
Method GetGuid | Returns the Guid of the Listener.
Method GetLevel | Get the level of a listener.
Method GetName | Get the name of the listener.
Method GetTimeFormatValue | Get timeformat of the listener.
Method IsModule | Test if a module is already registered in the listener
Static Object Method ListenerFactory |
Method Print | Display a log in the debuger.
Method SetFlags | Set flags of the listener.
Method SetLevel | Set the level of a listener.
Method SetSize | Sets the number of rows (iWidth) and lines (iHeight) the console can display.
Method SetTimeFormat | Set timeformat of the listener.
Destructors
Method ~VxConsoleListener | Destructor. The console is released.

See Also

VxLogListener.


VxConsoleListener::m_Guid

Static Object Member Variable VxConsoleListener::m_Guid

static const XGUID VxConsoleListener::m_Guid

The Guid of the console listener.

See Also

VxLog::RegisterListenerFactory, VxLog::RegisterListener.


VxConsoleListener::GetGuid

Method VxConsoleListener::GetGuid

const XGUID& VxConsoleListener::GetGuid() const

Returns the Guid of the Listener.


VxConsoleListener::ListenerFactory

Static Object Method VxConsoleListener::ListenerFactory

VxLogListener*
VxConsoleListener::ListenerFactory(const char* iName)


VxConsoleListener::Print

Method VxConsoleListener::Print

void VxConsoleListener::Print(int iModule,VxLog::Level iLevel,int iLine,const char* iFile,const char* iLog)

Display a log in the debuger.

Parameters

iModule | the module which want to log the information.
iLevel | the level of the informations to be displayed.
iLine | the line the log occured.
iFile | the file the log occured
iLog | a string representing the informations to be displayed.

Remarks

Function you must overload.

Implementation Notes

The log while be displayed like this: [MODULE] [LEVEL] [TIME] [FILE:LINE] : LOG. [TIME] is displayed if flags&TIMEINFO [FILE:LINE] is displayed if flags&FILEINFO. There is a cariage return after the log.

See Also

VxLog.


VxConsoleListener::SetSize

Method VxConsoleListener::SetSize

XBOOL VxConsoleListener::SetSize(int iWidth,int iHeight)

Sets the number of rows (iWidth) and lines (iHeight) the console can display.


VxConsoleListener::~VxConsoleListener

Method VxConsoleListener::~VxConsoleListener

VxConsoleListener::~VxConsoleListener()

Destructor. The console is released.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxFileListener

Class VxFileListener

A Listener which display informations into a file.

VxLogListener
Show brief derivation trees

VxFileListener

VxLogListener
Show full derivation trees

VxFileListener

Remarks

The name of the is: directory + name + “.” + ext or directory + name + [yy mm dd] + “.” + ext

Depending of the flags of the listener.

The log while be displayed like this: [MODULE] [LEVEL] [TIME] [FILE:LINE] : LOG. [TIME] is displayed if timeformat!=NODATE. [FILE:LINE] is displayed if flags&FILEINFO.

Groups

Data Members
Static Object Member Variable m_Guid | The Guid of the file listener.
Operations
Method AddModule | Add a module in the listener.
Method GetDateAsString | Convert the current date to a string.
Method GetDirectory | Returns the directory of the file. Default is the directory of the executable.
Method GetExt | Returns the extension of the file. Default is “log”.
Method GetFlags | Get flags of the listener.
Method GetGuid | Returns the Guid of the Listener.
Method GetLevel | Get the level of a listener.
Method GetName | Get the name of the listener.
Method GetTimeFormatValue | Get timeformat of the listener.
Method IsModule | Test if a module is already registered in the listener
Static Object Method ListenerFactory |
Method Print | Display a log in a file.
Method SetDirectory | Set the directory of the file.
Method SetExt | Set the extension of the file.
Method SetFlags | Set flags of the listener.
Method SetLevel | Set the level of a listener.
Method SetTimeFormat | Set timeformat of the listener.
Destructors
Method ~VxFileListener | Destructor. The file is closed.

See Also

VxLogListener. SetFlags, SetExt, VxLog::RegisterListener


VxFileListener::m_Guid

Static Object Member Variable VxFileListener::m_Guid

static const XGUID VxFileListener::m_Guid

The Guid of the file listener.

See Also

VxLog::RegisterListenerFactory, VxLog::RegisterListener.


VxFileListener::GetDirectory

Method VxFileListener::GetDirectory

const char* VxFileListener::GetDirectory() const

Returns the directory of the file. Default is the directory of the executable.

See Also

SetDirectory.


VxFileListener::GetExt

Method VxFileListener::GetExt

const char* VxFileListener::GetExt() const

Returns the extension of the file. Default is “log”.

See Also

SetExt.


VxFileListener::GetGuid

Method VxFileListener::GetGuid

const XGUID& VxFileListener::GetGuid() const

Returns the Guid of the Listener.


VxFileListener::ListenerFactory

Static Object Method VxFileListener::ListenerFactory

VxLogListener*
VxFileListener::ListenerFactory(const char* iName)


VxFileListener::Print

Method VxFileListener::Print

void VxFileListener::Print(int iModule,VxLog::Level iLevel,int iLine,const char* iFile,const char* iLog)

Display a log in a file.

Parameters

iModule | the module which want to log the information.
iLevel | the level of the informations to be displayed.
iLine | the line the log occured.
iFile | the file the log occured
iLog | a string representing the informations to be displayed.

Remarks

Function you must overload.

Implementation Notes

The log while be displayed like this: [MODULE] [LEVEL] [TIME] [FILE:LINE] : LOG. [TIME] is displayed if timeformat!=NODATE. [FILE:LINE] is displayed if flags&FILEINFO. There is a cariage return after the log.

See Also

VxLog.


VxFileListener::SetDirectory

Method VxFileListener::SetDirectory

void VxFileListener::SetDirectory(const char* iDir)

Set the directory of the file.

See Also

GetDirectory.


VxFileListener::SetExt

Method VxFileListener::SetExt

void VxFileListener::SetExt(const char* iExt)

Set the extension of the file.

See Also

GetExt.


VxFileListener::~VxFileListener

Method VxFileListener::~VxFileListener

VxFileListener::~VxFileListener()

Destructor. The file is closed.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxLog

Class VxLog

Utility class for logging information.

Groups

Operations
Static Object Method GetLevelDesc | Get the string associated to a level.
Method GetListener | Returns a listener with its name.
Static Object Method GetLog | Return the unique instance of the log.
Method GetModule | Get the name of a module.
Method IsModule | Test if a module is already registered.
Method Print | Print informations (without cariage return).
Method PrintMT | Print informations (without cariage return). This method is thread safe.
Method RegisterListener | Register a listener.
Method RegisterListenerFactory | Register a new listener factory.
Method RegisterModule | Register a new module.
Method SetInformation | Set information about a log which will be print with Print.
Method SetInformationMT | Set information about a log which will be print with PrintMT.
Method UnregisterListener |
Type Definitions
Enumerated Type Level | Level of a log.
Type Definition ListenerFactory | Listener factory.
Destructors
Method ~VxLog | Destructor.

See Also

VxLogListener


VxLog::GetLevelDesc

Static Object Method VxLog::GetLevelDesc

static const char* VxLog::GetLevelDesc(Level iLevel)

Get the string associated to a level.

Parameters

Input argument iLevel

level to be converted.

Remarks

The strings are : “DEBUG”,"TRACE","ERROR","WARNING","INFO".

See Also

VxLog::Level.


VxLog::GetListener

Method VxLog::GetListener

VxLogListener* VxLog::GetListener(const char* iName)
const VxLogListener* VxLog::GetListener(const char* iName) const

Returns a listener with its name.

Returns

A constant pointer to the listener or NULL if no listener is registered with this name.


VxLog::GetLog

Static Object Method VxLog::GetLog

static VxLog& VxLog::GetLog()

Return the unique instance of the log.


VxLog::GetModule

Method VxLog::GetModule

const char* VxLog::GetModule(int iModule) const

Get the name of a module.

Parameters

Input argument iModule

identifier of the module returned by RegisterModule.

Returns

the name of the module or NULL.

See Also

RegisterModule


VxLog::IsModule

Method VxLog::IsModule

int VxLog::IsModule(const char* iName) const

Test if a module is already registered.

Parameters

Input argument iName

name of the module you are looking for.

Returns

identifier of the module or -1 if the module is not registered.

See Also

RegisterModule


VxLog::Print

Method VxLog::Print

void VxLog::Print(const char* iFormat,...)

Print informations (without cariage return).

Parameters

Input argument iFormat

same arguments as a printf.

Remarks

All registered logger will be called if their modules and levels are compatible with module and level.

See Also

SetInformation, RegisterListener,VxLogListener::IsModule,VxLogListener::GetLevel.


VxLog::PrintMT

Method VxLog::PrintMT

void VxLog::PrintMT(const char* iFormat,...)

Print informations (without cariage return). This method is thread safe.

Parameters

Input argument iFormat

same arguments as a printf.

Remarks

All registered logger will be called if their modules and levels are compatible with module and level. SetInformationMT should be called just before calling PrintMT.

See Also

SetInformationMT, RegisterListener,VxLogListener::IsModule,VxLogListener::GetLevel.


VxLog::RegisterListener

Method VxLog::RegisterListener

VxLogListener* VxLog::RegisterListener(const XGUID& iGuid,const char* iName,int iModule)

Register a listener.

Parameters

Input argument iGuid | guid of the listener.
Input argument iName | name of the listener. This name must be unique even for listener with a different guid.
Input argument iModule | module to add to the listener.

Returns

A pointer to the listener or NULL if the function failed.

Remarks

The name of the listener must be unique even for different guid.

If a listener is already registered with the same name the function check if guids are equal (see VxLogListener::GetGuid). If guids are different the function return NULL. Else iModule is added to the listener (see VxLogListener::AddModule) and the pointer to the listener is returned.

If no listener is registered with this name, a new listener is created and iModule is added to this listener. Then the pointer of the new listener is returned.

After calling RegisterListener it is adviced to call VxLogListener::SetLevel on the listener.

See Also

RegisterListenerFactory, VxLogListener::AddModule, VxLogListener::GetGuid, VxLogListener::AddModule, VxLogListener::SetLevel


VxLog::RegisterListenerFactory

Method VxLog::RegisterListenerFactory

BOOL VxLog::RegisterListenerFactory(const XGUID& iGuid,ListenerFactory iFactory)

Register a new listener factory.

Parameters

Input argument iGuid | guid of the listener.
Input argument iFactory | factory to create the listener.

Returns

Return FALSE if a factory with the same guid has already been registered.

Remarks

Listener factories are used to create a listener (if necessary) by RegisterListener.

See Also

RegisterListener.


VxLog::RegisterModule

Method VxLog::RegisterModule

int VxLog::RegisterModule(const char* iName)

Register a new module.

Parameters

Input argument iName

name of the module you are looking for.

Returns

the identifier of the new module or -1 if the name of module is invalide.


VxLog::SetInformation

Method VxLog::SetInformation

VxLog& VxLog::SetInformation(int iModule,Level iLevel,int iLine,const char* iFile)

Set information about a log which will be print with Print.

Parameters

Input argument iModule | module used to log.
Input argument iLevel | level of the log.
Input argument iLine | line in the file where the log is placed.
Input argument iFile | file where the log is placed.

Remarks

This function must be called before Print.

See Also

Print.


VxLog::SetInformationMT

Method VxLog::SetInformationMT

VxLog& VxLog::SetInformationMT(int iModule,Level iLevel,int iLine,const char* iFile)

Set information about a log which will be print with PrintMT.

Parameters

Input argument iModule | module used to log.
Input argument iLevel | level of the log.
Input argument iLine | line in the file where the log is placed.
Input argument iFile | file where the log is placed.

Remarks

This function must be called before PrintMT.

See Also

PrintMT.


VxLog::UnregisterListener

Method VxLog::UnregisterListener

BOOL
VxLog::UnregisterListener(const char* iName)


VxLog::Level

Enumerated Type VxLog::Level

enum Level
{
VLDEBUG = 0x00000001,
VLTRACE = 0x00000002,
VLERROR = 0x00000004,
VLWARNING = 0x00000008,
VLINFO = 0x00000010,
VLALL = 0x0000001F,
}

Level of a log.

Members

VLALL
VLDEBUG
VLERROR
VLINFO
VLTRACE
VLWARNING

Remarks

Used when calling VxLog::Print to defines the level of a log. Level is also used when a Listener is build. A Listener should defines which levels it wants to log.

See Also

VxLog::Print, VxLogListener::SetLevel, VxLogListener::GetLevel


VxLog::ListenerFactory

Type Definition VxLog::ListenerFactory

typedef VxLogListener* (*VxLog::ListenerFactory)(const char* iName)

Listener factory.


VxLog::~VxLog

Method VxLog::~VxLog

VxLog::~VxLog()

Destructor.

Remarks

Listener are destroyed.


VxOutputDebugListener

Class VxOutputDebugListener

A Listener which display informations into the debug output of your debbuger.

VxLogListener
Show brief derivation trees

VxOutputDebugListener

VxLogListener
Show full derivation trees

VxOutputDebugListener

Groups

Data Members
Static Object Member Variable m_Guid | The Guid of the outputdebug listener.
Operations
Method AddModule | Add a module in the listener.
Method GetDateAsString | Convert the current date to a string.
Method GetFlags | Get flags of the listener.
Method GetGuid | Returns the Guid of the Listener.
Method GetLevel | Get the level of a listener.
Method GetName | Get the name of the listener.
Method GetTimeFormatValue | Get timeformat of the listener.
Method IsModule | Test if a module is already registered in the listener
Static Object Method ListenerFactory |
Method Print | Display a log in the debuger.
Method SetFlags | Set flags of the listener.
Method SetLevel | Set the level of a listener.
Method SetTimeFormat | Set timeformat of the listener.

See Also

VxLogListener.


VxOutputDebugListener::m_Guid

Static Object Member Variable VxOutputDebugListener::m_Guid

static const XGUID VxOutputDebugListener::m_Guid

The Guid of the outputdebug listener.

See Also

VxLog::RegisterListenerFactory, VxLog::RegisterListener.


VxOutputDebugListener::GetGuid

Method VxOutputDebugListener::GetGuid

const XGUID& VxOutputDebugListener::GetGuid() const

Returns the Guid of the Listener.


VxOutputDebugListener::ListenerFactory

Static Object Method VxOutputDebugListener::ListenerFactory

VxLogListener*
VxOutputDebugListener::ListenerFactory(const char* iName)


VxOutputDebugListener::Print

Method VxOutputDebugListener::Print

void VxOutputDebugListener::Print(int iModule,VxLog::Level iLevel,int iLine,const char* iFile,const char* iLog)

Display a log in the debuger.

Parameters

iModule | the module which want to log the information.
iLevel | the level of the informations to be displayed.
iLine | the line the log occured.
iFile | the file the log occured
iLog | a string representing the informations to be displayed.

Remarks

Function you must overload.

Implementation Notes

The log while be displayed like this: [MODULE] [LEVEL] [TIME] [FILE:LINE] : LOG. [TIME] is displayed if flags&TIMEINFO [FILE:LINE] is displayed if flags&FILEINFO. There is a cariage return after the log.

See Also

VxLog.


VxRDTSCProfiler

Class VxRDTSCProfiler

Groups

Constructors
Method VxRDTSCProfiler | Starts profiling
Operations
Method Current | Returns the current time elapsed (in milliseconds)
Method CurrentCycleCount | Returns the number of cycles elapsed...
Method Reset | Restarts the timer
Method Split | Returns the current time elapsed (in milliseconds)


VxRDTSCProfiler::VxRDTSCProfiler

Method VxRDTSCProfiler::VxRDTSCProfiler

VxRDTSCProfiler::VxRDTSCProfiler()
VxRDTSCProfiler::VxRDTSCProfiler(BOOL iReset)

Starts profiling

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxRDTSCProfiler::Current

Method VxRDTSCProfiler::Current

float VxRDTSCProfiler::Current()

Returns the current time elapsed (in milliseconds)


VxRDTSCProfiler::CurrentCycleCount

Method VxRDTSCProfiler::CurrentCycleCount

int VxRDTSCProfiler::CurrentCycleCount()

Returns the number of cycles elapsed...


VxRDTSCProfiler::Reset

Method VxRDTSCProfiler::Reset

void VxRDTSCProfiler::Reset()

Restarts the timer


VxRDTSCProfiler::Split

Method VxRDTSCProfiler::Split

float VxRDTSCProfiler::Split()

Returns the current time elapsed (in milliseconds)


VxStream

Class VxStream

Base class for file IO.

Subclasses

VxFile, and VxSubFile

Remarks

The VxFile and VxSubFile both derives from this base class. It defines the base method to read/write data to a stream

Groups

Operations
Virtual Method Method Copy | Copy given amount of data from the source stream to the stream. A size of 0 means copy the whole stream.
Pure Virtual Method Method IsValid | Returns TRUE if the stream is still valid.
Pure Virtual Method Method Position | Returns the current cursor position.
Pure Virtual Method Method Read | Reads given amount of data from the stream to the buffer.
Pure Virtual Method Method Seek | Seeks to a given position into the stream, starting from a given origin mode.
Pure Virtual Method Method Size | Returns the stream size in bytes.
Pure Virtual Method Method Write | Writes given amount of data from the buffer to the stream.
Type Definitions
Enumerated Type SeekMode | Starting position and direction of a seek.


VxStream::Copy

Virtual Method Method VxStream::Copy

virtual XDWORD VxStream::Copy(VxStream& iStream, XDWORD iSize = 0)

Copy given amount of data from the source stream to the stream. A size of 0 means copy the whole stream.

Returns

The number of bytes actually written


VxStream::IsValid

Pure Virtual Method Method VxStream::IsValid

virtual XBOOL VxStream::IsValid()

Returns TRUE if the stream is still valid.


VxStream::Position

Pure Virtual Method Method VxStream::Position

virtual XDWORD VxStream::Position()

Returns the current cursor position.


VxStream::Read

Pure Virtual Method Method VxStream::Read

virtual XDWORD VxStream::Read(void* oBuffer, XDWORD iSize)

Reads given amount of data from the stream to the buffer.

Returns

The number of bytes actually read


VxStream::Seek

Pure Virtual Method Method VxStream::Seek

virtual XBOOL VxStream::Seek(int iOffset, SeekMode iOrigin)

Seeks to a given position into the stream, starting from a given origin mode.


VxStream::Size

Pure Virtual Method Method VxStream::Size

virtual XDWORD VxStream::Size()

Returns the stream size in bytes.


VxStream::Write

Pure Virtual Method Method VxStream::Write

virtual XDWORD VxStream::Write(const void* iBuffer, XDWORD iSize)

Writes given amount of data from the buffer to the stream.

Returns

The number of bytes actually written


VxStream::SeekMode

Enumerated Type VxStream::SeekMode

enum SeekMode {
START,
END,
CURRENT
}

Starting position and direction of a seek.

Members

CURRENT | From current cursor position (See VxStream::Position())
END | From end of strem
START | From start of stream

See Also

VxStream::Seek


VxSubFile

Class VxSubFile

VxStream
Show brief derivation trees

VxSubFile

VxStream
Show full derivation trees

VxSubFile

Remarks

The VxSubFile is a special implementation of the VxStream It gives access to a file stored inside a big file (concatenation of several files in a single,bigger file).

Groups

Constructors
Method VxSubFile | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Virtual Method Method Copy | Copy given amount of data from the source stream to the stream. A size of 0 means copy the whole stream.
Method IsValid | Returns TRUE if the stream is still valid.
Method Position | Returns the current cursor position.
Method Read | Reads given amount of data from the stream to the buffer.
Method Seek | Seeks to a given position into the stream, starting from a given origin mode.
Method Set | set SubFile
Method Size | Returns the stream size in bytes.
Method Write | Writes given amount of data from the buffer to the stream.

See Also

VxBigFile


VxSubFile::VxSubFile

Method VxSubFile::VxSubFile

VxSubFile::VxSubFile()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxSubFile::IsValid

Method VxSubFile::IsValid

XBOOL
VxSubFile::IsValid()

Returns TRUE if the stream is still valid.


VxSubFile::Position

Method VxSubFile::Position

XDWORD
VxSubFile::Position()

Returns the current cursor position.

Remarks

Virtual overridings


VxSubFile::Read

Method VxSubFile::Read

XDWORD
VxSubFile::Read(void* oBuffer, XDWORD iSize)

Reads given amount of data from the stream to the buffer.

Returns

The number of bytes actually read


VxSubFile::Seek

Method VxSubFile::Seek

XBOOL
VxSubFile::Seek(int iOffset, SeekMode iOrigin)

Seeks to a given position into the stream, starting from a given origin mode.


VxSubFile::Set

Method VxSubFile::Set

void
VxSubFile::Set(VxFile* iBigFile, XDWORD iOffset, XDWORD iSize)

Remarks

set SubFile


VxSubFile::Size

Method VxSubFile::Size

XDWORD
VxSubFile::Size()

Returns the stream size in bytes.


VxSubFile::Write

Method VxSubFile::Write

XDWORD
VxSubFile::Write(const void* iBuffer, XDWORD iSize)

Writes given amount of data from the buffer to the stream.

Returns

The number of bytes actually written


XMatrix

Class XMatrix

Remarks

Template class Describing a 2D Matrix of variable width and height.

Groups

Constructors
Method XMatrix | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operators
Method operator() | Access to an element of the matrix
Operations
Method Clear | Free the memory taken by the matrix.
Method Create | Creation of the matrix (automatically calls Clear)
Method GetHeight | Returns the height of the matrix (Number of rows)
Method GetWidth | Returns the width of the matrix (Number of columns)
Method Size | Returns the memory taken by the matrix in bytes
Destructors
Method ~XMatrix | Description: Destroys the object This destroys all the subordinate objects for this object.


XMatrix::XMatrix

Method XMatrix::XMatrix

XMatrix::XMatrix(int iWidth = 0, int iHeight = 0)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XMatrix::operator()

Method XMatrix::operator()

const T& XMatrix::operator() (const int iX, const int iY) const
T& XMatrix::operator()(const int iX, const int iY)

Remarks

Access to an element of the matrix


XMatrix::Clear

Method XMatrix::Clear

void XMatrix::Clear()

Remarks

Free the memory taken by the matrix.


XMatrix::Create

Method XMatrix::Create

void XMatrix::Create(int iWidth, int iHeight)

Remarks

Creation of the matrix (automatically calls Clear)


XMatrix::GetHeight

Method XMatrix::GetHeight

int XMatrix::GetHeight() const

Remarks

Returns the height of the matrix (Number of rows)


XMatrix::GetWidth

Method XMatrix::GetWidth

int XMatrix::GetWidth() const

Remarks

Returns the width of the matrix (Number of columns)


XMatrix::Size

Method XMatrix::Size

int XMatrix::Size() const

Remarks

Returns the memory taken by the matrix in bytes


XMatrix::~XMatrix

Method XMatrix::~XMatrix

XMatrix::~XMatrix(void)

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XPriority

Class XPriority

Groups

Operators
Method operator()


XPriority::operator()

Method XPriority::operator()

int XPriority::operator()(const T& iT) const


CKBlendShapeSet::m_InitialVerts

Member Variable CKBlendShapeSet::m_InitialVerts

XClassArray<CKBlendShapeInitialVertex> CKBlendShapeSet::m_InitialVerts


CKBlendShapeSet::m_LogicalBlendShapeNames

Member Variable CKBlendShapeSet::m_LogicalBlendShapeNames

XClassArray<XString> CKBlendShapeSet::m_LogicalBlendShapeNames


CKBlendShapeSet::m_PhysicalBlendShapes

Member Variable CKBlendShapeSet::m_PhysicalBlendShapes

XClassArray<CKBlendShape> CKBlendShapeSet::m_PhysicalBlendShapes


CKBlendShapeSet::Clear

Method CKBlendShapeSet::Clear

void CKBlendShapeSet::Clear()


CKBlendShapeVertexDelta::m_Index

Member Variable CKBlendShapeVertexDelta::m_Index

int CKBlendShapeVertexDelta::m_Index


CKBlendShapeVertexDelta::m_NormalDelta

Member Variable CKBlendShapeVertexDelta::m_NormalDelta

VxVector CKBlendShapeVertexDelta::m_NormalDelta


CKBlendShapeVertexDelta::m_PosDelta

Member Variable CKBlendShapeVertexDelta::m_PosDelta

VxVector CKBlendShapeVertexDelta::m_PosDelta


CKBlendShapeVertexDelta::Scale

Method CKBlendShapeVertexDelta::Scale

void CKBlendShapeVertexDelta::Scale(float factor)


OverridenMaterial

Class OverridenMaterial

Remarks

PRIVATE USE : class OverridenMaterial

An overriden material

Groups

Data Members
Member Variable m_Material | The actual material to be used for rendering. This also give the batching slot.
Member Variable m_MaterialShader | The shader to use and its user params for that specific material
Member Variable m_ShaderMeaningMaterial | For shaders : the material accessed by shader “meanings” to get infos such as diffuse color, texture, alpha test infos... Usually this will be the same than m_Material, except when we want to override a standard material with a shader and still have access to the original material infos. Example of use : through CK_OVERRIDE_TECHNIQUE to be able to draw alpha tested objects in a float “z-buffer” through a shader, while taking alpha test in account for materials with no shaders.
Member Variable m_ShaderTechniqueIndex | the technique to use with the shader
Constructors
Method OverridenMaterial | build from a simple material, with no override
Comparison Operators
Method operator== | Description: Equality Operator


OverridenMaterial::m_Material

Member Variable OverridenMaterial::m_Material

CKMaterial* OverridenMaterial::m_Material

Remarks

The actual material to be used for rendering. This also give the batching slot.


OverridenMaterial::m_MaterialShader

Member Variable OverridenMaterial::m_MaterialShader

CKMaterialShader* OverridenMaterial::m_MaterialShader

Remarks

The shader to use and its user params for that specific material


OverridenMaterial::m_ShaderMeaningMaterial

Member Variable OverridenMaterial::m_ShaderMeaningMaterial

CKMaterial* OverridenMaterial::m_ShaderMeaningMaterial

Remarks

For shaders : the material accessed by shader “meanings” to get infos such as diffuse color, texture, alpha test infos... Usually this will be the same than m_Material, except when we want to override a standard material with a shader and still have access to the original material infos. Example of use : through CK_OVERRIDE_TECHNIQUE to be able to draw alpha tested objects in a float “z-buffer” through a shader, while taking alpha test in account for materials with no shaders.


OverridenMaterial::m_ShaderTechniqueIndex

Member Variable OverridenMaterial::m_ShaderTechniqueIndex

int OverridenMaterial::m_ShaderTechniqueIndex

Remarks

the technique to use with the shader


OverridenMaterial::OverridenMaterial

Method OverridenMaterial::OverridenMaterial

OverridenMaterial::OverridenMaterial()
explicit OverridenMaterial::OverridenMaterial(CKMaterial* mat)

Remarks

build from a simple material, with no override


OverridenMaterial::operator==

Method OverridenMaterial::operator==

bool OverridenMaterial::operator==(const OverridenMaterial& rhs) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


Global Functions

List of SDK global functions

Initializations | Engine Initialization functions
Class Hierarchy | Class hierarchy functions The following functions are used to determine hierarchical relationship between classes in CK.
CKObjects | CKObjects related functions
Miscellaneous functions | Miscellaneous functions
Behavior declarations | Behavior prototypes and declaration functions
Bitmaps | Bitmap utilities functions
Compression | Compression/CRC Functions
Endianness | Little Endian - Big Endian conversion functions
String functions |

See Also

Virtools SDK Reference


Initializations

Engine Initialization functions

External Function CKCloseContext | Closes a CKContext.
External Function CKCreateContext | Creates a new CK Context.
External Function CKGetStartPath | Returns the path from which the library has been started
External Function CKGetVersion | Returns the Current Version of CK Engine
External Function CKShutdown | Shuts down Virtools Engine.

See Also

Global Functions


CKCloseContext

External Function CKCloseContext

CKERROR CKCloseContext(CKContext* context)

Closes a CKContext.

Parameters

Context: A pointer to the CKContext to be closed.

Returns

CK_OK if successful or an error code otherwise.

Remarks

This function must be called when finished with a given context to free . you should call CKContext::ClearAll before closing the context.

See Also

CKStartUp,CKContext::Process, CKCloseContext,CK_CONFIG_FLAGS


CKCreateContext

External Function CKCreateContext

CKERROR CKCreateContext(CKContext** oContext,WIN_HANDLE iWin, const char* iConfigFile)

Creates a new CK Context.

Parameters

Input argument oContext | Address of a pointer to the CKContext that will be created.
Input argument iWin | a Handle (HWND) to the main window of the application using CK
Input argument iConfigFile | Filename of a config file, with variables that will be imported (see CKVariableManager).

Returns

CK_OK if successful or an error code otherwise.

Remarks

This function must be called at the start of the application using CK. If no render engine is found this function exits the program.

See Also

CKStartUp,CKContext::Process, CKCloseContext,CK_CONFIG_FLAGS


CKGetStartPath

External Function CKGetStartPath

CKSTRING CKGetStartPath()

Returns the path from which the library has been started

Returns

A string containing the starting path.


CKGetVersion

External Function CKGetVersion

CKDWORD CKGetVersion()

Returns the Current Version of CK Engine

Returns

A CKDWORD with CKVersion (eg. 0x20072000)

Remarks

The version is a dword containing the date of build of CK engine in the following format: 0xDDMMYYYY


CKShutdown

External Function CKShutdown

CKERROR CKShutdown()

Shuts down Virtools Engine.

Returns

Returns CK_OK if successful or an error code otherwise.

Remarks

Shuts down Virtools Engine. When developping a standalone application this function must be called before exiting the appliaction to free any allocated memory.

See Also

Creating a Standalone Application,CKStartUp,CKCreateContext


Class Hierarchy

Class hierarchy functions The following functions are used to determine hierarchical relationship between classes in CK.

External Function CKClassIDToCppClassName | Converts a Class Identifier to the corresponding cpp class name
External Function CKClassIDToString | Converts a Class Identifier to a String
External Function CKGetClassCount | Returns the number of registred classes (derived from CKObject)
External Function CKGetCommonParent | Returns the Class Identifier parent two classes.
External Function CKGetParentClassID | Returns the class identifier of the parent class of an object
External Function CKIsChildClassOf | Returns whether two clases are derivated.
External Function CKStringToClassID | Converts a Class Name to a class identifier

See Also

Global Functions


CKClassIDToCppClassName

External Function CKClassIDToCppClassName

CKSTRING CKClassIDToCppClassName(CK_CLASSID cid)

Converts a Class Identifier to the corresponding cpp class name

Parameters

Input argument cid

Class Identifier.

Returns

A string identifying the cpp class or empty string if invalid

See Also

CKIsChildClassOf,CKGetParentClassID,CKStringToClassID


CKClassIDToString

External Function CKClassIDToString

CKSTRING CKClassIDToString(CK_CLASSID cid)

Converts a Class Identifier to a String

Parameters

Input argument cid

Class Identifier.

Returns

A string identifying the class or “Invalid Class Identifier” if the given Class ID was invalid.

See Also

CKIsChildClassOf,CKGetParentClassID,CKStringToClassID


CKGetClassCount

External Function CKGetClassCount

int CKGetClassCount()

Returns the number of registred classes (derived from CKObject)

Returns

Number of registred class.

See Also

CKClassIDToString,CKIsChildClassOf


CKGetCommonParent

External Function CKGetCommonParent

CK_CLASSID CKGetCommonParent(CK_CLASSID cid1,CK_CLASSID cid2)

Returns the Class Identifier parent two classes.

Parameters

Input argument cid1 | Class Identifier of the first class.
Input argument cid2 | Class Identifier of the second class.

Returns

The Class Identifier of the common parent class.

See Also

CKIsChildClassOf,CKGetParentClassID


CKGetParentClassID

External Function CKGetParentClassID

CK_CLASSID CKGetParentClassID(CK_CLASSID child_cid)
CK_CLASSID CKGetParentClassID(CKObject *child)

Returns the class identifier of the parent class of an object

Parameters

Input argument child_cid | Class Identifier of the child class.
Input argument child | Object.

Returns

Class Identifier of the parent class.

See Also

CKGetCommonParent,CKIsChildClassOf


CKIsChildClassOf

External Function CKIsChildClassOf

CKBOOL CKIsChildClassOf(CK_CLASSID child_cid,
CK_CLASSID parent_cid
)
CKBOOL CKIsChildClassOf(CKObject *childobj,
CK_CLASSID parent_cid
)

Returns whether two clases are derivated.

Parameters

Input argument child_cid | Class Identifier of the child class.
Input argument childobj | Child Object.
parent_cid | Class Identifier of the parent class.

Returns

TRUE is child_cid is a derivated class of parent_cid.

See Also

CKGetCommonParent,CKGetParentClassID


CKStringToClassID

External Function CKStringToClassID

CK_CLASSID CKStringToClassID(CKSTRING classname)

Converts a Class Name to a class identifier

Parameters

Input argument classname

Class Name.

Returns

A Class ID of 0 is given if an invalid name is given.

See Also

CKIsChildClassOf,CKGetParentClassID,CKClassIDToString


CKObjects

CKObjects related functions

External Function CKSaveObjectState

Save a snapthost of the object state.

See Also

Global Functions


CKSaveObjectState

External Function CKSaveObjectState

CKStateChunk* CKSaveObjectState(CKObject* obj,CKDWORD Flags)
CKERROR CKReadObjectState(CKObject* obj,CKStateChunk* chunk)

Save a snapthost of the object state.

Parameters

Input argument obj | A pointer to the CKObject
Input argument Flags | Not Used, set at 0xFFFFFFFF

Returns

A pointer to a CKStateChunk containing the object snapshot.

Remarks

+This method saves(loads) all data of an object into(from) a CKStateChunk. +The returned chunk can be used to set as the object initial condition in a scene (see CKScene::SetObjectInitialValue) +At the exception of the character which snapshot also contains the snapshot of its bodyparts (position/orientation) saving a snapshot of an object does not save its dependencies snapshot. For example the initial condition of a CK3dEntity contains its position,orientation and the current mesh it uses but not the position of vertices of this mesh.

See Also

CKStateChunk,CKScene::SetObjectInitialValue


Miscellaneous functions

Miscellaneous functions

External Function CKCopyDefaultClassDependencies | Copy Default dependencies according to mode (copy,delete,save,etc...)
External Function CKDeletePointer | Delete Operator
External Function CKErrorToString | Returns a string containing the error message for a specific error code.
External Function CKGetDefaultClassDependencies | Returns default dependencies according to mode (copy,delete,save,etc...)
External Function CKGetPluginManager | Returns a pointer to the CKPluginManager.
External Function CreateCKObjectArray | Creates an instance of CKObjectArray
External Function CreateCKStateChunk | Creates an instance of CKStateChunk
External Function DeleteCKObjectArray | Deletes an instance of CKObjectArray.
External Function DeleteCKStateChunk | Deletes an instance of CKStateChunk

See Also

Global Functions


CKCopyDefaultClassDependencies

External Function CKCopyDefaultClassDependencies

void CKCopyDefaultClassDependencies(CKDependencies& d,CK_DEPENDENCIES_OPMODE mode)

Copy Default dependencies according to mode (copy,delete,save,etc...)

See Also

CKGetDefaultClassDependencies


CKDeletePointer

External Function CKDeletePointer

void CKDeletePointer(void* mem)

Delete Operator

Remarks

Due to compilation options, some plugins can have different new/delete operators which are not compatible and could cause crashes. Every memory pointer created by CK should be destroyed with the CKDeletePointer ( except for Strings : CKStrdelete must be used instead ) and not by a call to the delete operator to avoid this.


CKErrorToString

External Function CKErrorToString

CKSTRING CKErrorToString(CKERROR err)

Returns a string containing the error message for a specific error code.

Parameters

Input argument err

An error code which description string should be returned.

Returns

A string containing the description of the error.

See Also

CKClassIDToString,Error Codes


CKGetDefaultClassDependencies

External Function CKGetDefaultClassDependencies

CKDependencies* CKGetDefaultClassDependencies(CK_DEPENDENCIES_OPMODE mode)

Returns default dependencies according to mode (copy,delete,save,etc...)

See Also

CKGetDefaultClassDependencies


CKGetPluginManager

External Function CKGetPluginManager

CKPluginManager *CKGetPluginManager()

Returns a pointer to the CKPluginManager.

Returns

A pointer to the unique instance of the CKPluginManager

Remarks

There is only one Plugin manager instance shared by all CKContext created inside a process.


CreateCKObjectArray

External Function CreateCKObjectArray

CKObjectArray* CreateCKObjectArray()

Creates an instance of CKObjectArray

Returns

The newly allocated CKObjectArray instance.

Remarks

CKObjectArray must be created using this function. Do not use new operator.

See Also

DeleteCKObjectArray,CKObjectArray


CreateCKStateChunk

External Function CreateCKStateChunk

CKStateChunk* CreateCKStateChunk(CK_CLASSID id,CKFile* file)
CKStateChunk* CreateCKStateChunk(CKStateChunk *chunk)

Creates an instance of CKStateChunk

Parameters

Input argument id | Class ID identifying the content of this chunk
Input argument chunk | the chunk to copy the content

Returns

A pointer to the newly created CKStateChunk

See Also

CKSaveObjectState,DeleteCKStateChunk


DeleteCKObjectArray

External Function DeleteCKObjectArray

void DeleteCKObjectArray(CKObjectArray * obj)

Deletes an instance of CKObjectArray.

Remarks

This function must be called in order to free the memory allocated. Do not use the delete operator. This function does not delete the objects contained inside the array.

See Also

CreateCKObjectArray,CKObjectArray


DeleteCKStateChunk

External Function DeleteCKStateChunk

void DeleteCKStateChunk(CKStateChunk* chnk)

Deletes an instance of CKStateChunk

Parameters

Input argument chnk

the chunk to delete

Remarks

Deletes an instance of CKStateChunk that has been created by the CreateCKStateChunk or CKSaveObjectState methods.

See Also

CKSaveObjectState,CreateCKStateChunk


Behavior declarations

Behavior prototypes and declaration functions

External Function CKGetObjectDeclarationFromGuid | Returns the prototype declaration given a GUID
External Function CKGetPrototypeDeclaration | Returns the prototype declaration at the given index
External Function CKGetPrototypeDeclarationCount | Returns the number of registered prototypes declaration
External Function CKGetPrototypeFromGuid | Retrieves a CKBehaviorPrototype from its CKGUID
External Function CreateCKBehaviorPrototype | Creates an instance of CKBehaviorPrototype
External Function CreateCKObjectDeclaration | Creates an instance of CKObjectDeclaration

See Also

Global Functions


CKGetObjectDeclarationFromGuid

External Function CKGetObjectDeclarationFromGuid

CKObjectDeclaration *CKGetObjectDeclarationFromGuid(CKGUID guid)

Returns the prototype declaration given a GUID

Remarks

Once CK is started and the plugins have been parsed (CKPluginManager::ParsePlugins) this function can be used to iterate though all registred behavior prototypes.

See Also

Declaration of the Building Block,CKGetPrototypeDeclarationCount,CKGetPrototypeDeclaration


CKGetPrototypeDeclaration

External Function CKGetPrototypeDeclaration

CKObjectDeclaration *CKGetPrototypeDeclaration(int n)

Returns the prototype declaration at the given index

Returns

The n th behavior prototype declaration.

Remarks

Once CK is started and the plugins have been parsed (CKPluginManager::ParsePlugins) this function can be used to iterate though all registred behavior prototypes. A prototype declaration can also be retrieve from its GUID using CKGetObjectDeclarationFromGuid

See Also

Declaration of the Building Block,CKGetPrototypeDeclarationCount,CKGetObjectDeclarationFromGuid


CKGetPrototypeDeclarationCount

External Function CKGetPrototypeDeclarationCount

int CKGetPrototypeDeclarationCount()

Returns the number of registered prototypes declaration

Returns

The number of behavior prototype declarations.

See Also

Declaration of the Building Block,CKGetObjectDeclarationFromGuid


CKGetPrototypeFromGuid

External Function CKGetPrototypeFromGuid

CKBehaviorPrototype *CKGetPrototypeFromGuid(CKGUID guid)

Retrieves a CKBehaviorPrototype from its CKGUID

Parameters

Input argument guid

Identifier of the protoype to be returned.

Returns

A pointer to the CKBehaviorPrototype with the given GUID.

Remarks

If a behavior prototype instance with the given does not yet exist this function creates it and returns the instance.

See Also

CreateCKBehaviorPrototype,CKGetObjectDeclarationFromGuid,Declaration of the Building Block


CreateCKBehaviorPrototype

External Function CreateCKBehaviorPrototype

CKBehaviorPrototype* CreateCKBehaviorPrototype(CKSTRING Name)

Creates an instance of CKBehaviorPrototype

Returns

A pointer to the newly created object

Remarks

Creates a new empty instance of the CKBehaviorPrototype class.

See Also

CreateCKObjectDeclaration,Behavior Prototype Creation


CreateCKObjectDeclaration

External Function CreateCKObjectDeclaration

CKObjectDeclaration* CreateCKObjectDeclaration(CKSTRING Name)

Creates an instance of CKObjectDeclaration

Returns

A pointer to the newly created object

Remarks

Creates a new empty instance of the CKObjectDeclaration class.

See Also

CreateCKBehaviorPrototype,Declaration of the Building Block


Bitmaps

Bitmap utilities functions

External Function CKCopyBitmapProperties | Copy a CKBitmapProperties structure
External Function CKLoadBitmap | Loads a bitmap from a file
External Function CKSaveBitmap | Saves a bitmap to a file

See Also

Global Functions


CKCopyBitmapProperties

External Function CKCopyBitmapProperties

CKBitmapProperties* CKCopyBitmapProperties(CKBitmapProperties* bp)

Copy a CKBitmapProperties structure

Returns

A pointer to a copy of bp.

Remarks

+The CKBitmapProperties is a base class that most readers override to add their specific options. To get a copy of a CKBitmapProperties pointer you must use this function. +To delete the returned pointer use CKDeletePointer or CKDeleteBitmapProperties

See Also

CKDeletePointer


CKLoadBitmap

External Function CKLoadBitmap

BITMAP_HANDLE CKLoadBitmap(CKSTRING filename)

Loads a bitmap from a file

Parameters

Input argument filename

Name of the file to load.

Returns

A BITMAP_HANDLE to the loaded image or NULL if failed.

Remarks

This method is kept for compatibility but you should rather consider using CKBitmapData class to load images. filename must contain a supported extension (ex .bmp, .tga,etc..) The returned BITMAP_HANDLE is equivalent to a HBITMAP on Win32 it can then be converted to a VxImageDescEx using VxConvertBitmap To delete the loaded image use VxDeleteBitmap.

See Also

CKSaveBitmap,VxImageDescEx,VxConvertBitmap,VxDeleteBitmap


CKSaveBitmap

External Function CKSaveBitmap

CKBOOL CKSaveBitmap(CKSTRING filename,BITMAP_HANDLE bm)
CKBOOL CKSaveBitmap(CKSTRING filename,VxImageDescEx& desc)

Saves a bitmap to a file

Parameters

Input argument filename | Name of the file to create.
Input argument desc | A VxImageDescEx structure containing the bitmap description

Returns

TRUE if successful.

Remarks

filename must contain a supported extension (ex .bmp, .tga,etc..)

See Also

CKLoadBitmap,VxImageDescEx


Compression

Compression/CRC Functions

External Function CKComputeDataCRC | Computes a CRC for a buffer
External Function CKPackData | Compress a buffer
External Function CKUnPackData | Decompress a buffer

See Also

Global Functions


CKComputeDataCRC

External Function CKComputeDataCRC

CKDWORD CKComputeDataCRC(char *data,int size,DWORD PreviousCRC)

Computes a CRC for a buffer

Parameters

Input argument data | a pointer to the buffer to create a CRC for.
Input argument size | size of the source buffer.
Input argument PreviousCRC | the first time a CRC is computed this value should be 0 , but it can be use to compute a single CRC for a several buffers by using the currently computed CRC for previous buffers in this value.

Returns

CRC of the buffer.

Remarks

CRC can be used to ensure that a file has been correctly saved or compressed.

See Also

CKPackData,CKComputeDataCRC


CKPackData

External Function CKPackData

char* CKPackData(char* Data,int size,int& NewSize,int CompressionLevel)

Compress a buffer

Parameters

Input argument Data | a pointer to the buffer to compress.
Input argument size | size of the source buffer.
Input argument NewSize | A reference that will be filled with the size of the compressed buffer.
Input argument CompressionLevel | 0-9

Returns

A pointer to the compressed buffer.

Remarks

The level of compression used can be set through CKSetCompressionLevel.

See Also

CKUnPackData,CKComputeDataCRC,CKSetCompressionLevel


CKUnPackData

External Function CKUnPackData

char* CKUnPackData(int DestSize,char* SrcBuffer,int SrcSize)

Decompress a buffer

Parameters

Input argument DestSize | Expected size a of the decompressed buffer.
Input argument SrcBuffer | Compressed buffer.
Input argument SrcSize | Size of the compressed buffer.

Returns

A pointer to the decompressed buffer or NULL if there was an error.

See Also

CKUnPackData,CKComputeDataCRC,CKSetCompressionLevel


Endianness

Little Endian - Big Endian conversion functions

External Function CKConvertEndian16 | Convert a CKWORD value from little endian to big endian
External Function CKConvertEndian32 | Convert a CKDWORD value from little endian to big endian
External Function CKConvertEndianArray16 | Convert an array of CKWORD values from little endian to big endian
External Function CKConvertEndianArray32 | Convert an array of CKDWORD values from little endian to big endian

See Also

Global Functions


CKConvertEndian16

External Function CKConvertEndian16

CKWORD CKConvertEndian16(CKWORD w)

Convert a CKWORD value from little endian to big endian

Remarks

+This method is only implemented on macintosh

See Also

CKConvertEndianArray32,CKConvertEndianArray16,CKConvertEndian32


CKConvertEndian32

External Function CKConvertEndian32

CKDWORD CKConvertEndian32(CKDWORD dw)

Convert a CKDWORD value from little endian to big endian

Remarks

This method is only implemented on macintosh and returns the same value on PCs.

See Also

CKConvertEndianArray32,CKConvertEndianArray16,CKConvertEndian16


CKConvertEndianArray16

External Function CKConvertEndianArray16

void CKConvertEndianArray16(void* buf,int DwordCount)

Convert an array of CKWORD values from little endian to big endian

Remarks

+This method is only implemented on macintosh

See Also

CKConvertEndianArray32,CKConvertEndian32,CKConvertEndian16


CKConvertEndianArray32

External Function CKConvertEndianArray32

void CKConvertEndianArray32(void* buf,int DwordCount)

Convert an array of CKDWORD values from little endian to big endian

Remarks

+This method is only implemented on macintosh

See Also

CKConvertEndianArray16,CKConvertEndian32,CKConvertEndian16


String functions

See Also

Global Functions


Enumerations

List of enumeration definitions

Enumerated Type ChannelType | Size of texture coordinates created on a mesh channel
Enumerated Type CK_2DENTITY_FLAGS | 2DEntity Flags
Enumerated Type CK_3DENTITY_FLAGS | 3dEntity Flags
Enumerated Type CK_ANIMATION_FLAGS | Flags settings for animations
Enumerated Type CK_ANIMATION_TRANSITION_MODE | Transition mode between animations
Enumerated Type CK_ARRAYTYPE | Enum defining the format of a Data Array element.
Enumerated Type CK_ATTRIBUT_FLAGS | Attribute Flags
Enumerated Type CK_BEHAVIOR_CALLBACKMASK | Mask for the messages the callback function of a behavior should be aware of.
Enumerated Type CK_BEHAVIOR_FLAGS | Flags settings for behaviors.
Enumerated Type CK_BEHAVIOR_RETURN | Return value for the behavior execution function.
Enumerated Type CK_BEHAVIOR_TYPE | Behavior Type.
Enumerated Type CK_BINARYOPERATOR | Available operations between colums of a DataArray
Type Definition CK_BITMAP_SAVEOPTIONS | Specify the way textures or sprites will be saved
Enumerated Type CK_BITMAP_SYSTEMCACHING | Specify the way textures or sprites are stored in system memory
Enumerated Type CK_BITMAPREADER_ERROR | Bitmap Reader Error Values.
Enumerated Type CK_BONES_REFERENTIAL | Type of bone matrices send to the skinning shader
Enumerated Type CK_COMPOPERATOR | Available comparisons between colums of a DataArray
Enumerated Type CK_CONFIG_FLAGS | Flags specifying start options for Virtools
Enumerated Type CK_DATAREADER_FLAGS | Readers loading/saving capabilities.
Enumerated Type CK_DEPENDENCIES_FLAGS | Dependencies options
Enumerated Type CK_DEPENDENCIES_OPMODE | Specify the mode of operation of a CKDependenciesContext.
Enumerated Type CK_DESTROY_FLAGS | Objects destruction Flags
Enumerated Type CK_FILE_WRITEMODE | Specify the way files are saved to disk (compression)
Enumerated Type CK_FLOORGEOMETRY | Geometric precision for floor-intersection tests.
Enumerated Type CK_FLOORNEAREST | Enum defining the floors found when retrieving the floors around a position
Enumerated Type CK_FOCUSLOST_BEHAVIOR | web player's behavior when it losts focus (used by webplayer)
Enumerated Type CK_FRAMERATE_LIMITS | Time limits settings
Enumerated Type CK_GEOMETRICPRECISION | Geometric precision for collision tests
Enumerated Type CK_GRIDORIENTATION | Enum defining the orientation of a Grid
Enumerated Type CK_IMPACTINFO | Flags defining which informations should be returned from a collision.
Enumerated Type CK_LOAD_FLAGS | Load Options.
Enumerated Type CK_MOUSEBUTTON | Mouse Buttons Constants
Enumerated Type CK_MOVIEREADER_ERROR | Movie Reader Error Values.
Enumerated Type CK_OBJECT_FLAGS | CKObject Flags
Enumerated Type CK_OBJECTANIMATION_FLAGS | Special settings for object animations.
Enumerated Type CK_OBJECTCREATION_OPTIONS | Specify the way an object is created through CKCreateObject.
Enumerated Type CK_PARAMETERTYPE_FLAGS | Flags settings for new parameter types
Enumerated Type CK_PATCH_FLAGS | Type of a patch (Triangle or Quad).
Enumerated Type CK_PATHMANAGER_CATEGORY | Enumeration of pre-registred path categories
Enumerated Type CK_PLUGIN_TYPE | Type identifier for a Virtools plugin.
Enumerated Type CK_RAYINTERSECTION | Options for the RayIntersection
Enumerated Type CK_RENDER_FLAGS | Render options
Enumerated Type CK_SCENEOBJECT_FLAGS | Flags describing state of an object in a scene.
Enumerated Type CK_SCENEOBJECTACTIVITY_FLAGS | Flags overriding activity flags of objects and scripts in a scene.
Enumerated Type CK_SCENEOBJECTRESET_FLAGS | Flags overriding reset flag of objects and scripts in a scene.
Enumerated Type CK_SECONDARYANIMATION_FLAGS | Flags settings for secondary animations
Enumerated Type CK_SOUND_SAVEOPTIONS | Specify the way sounds will be saved
Enumerated Type CK_SOUNDMANAGER_CAPS |
Enumerated Type CK_SOUNDREADER_ERROR |
Enumerated Type CK_TEXTURE_SAVEOPTIONS | Specify the way textures or sprites will be saved
Enumerated Type CK_VIDEO_AUTHOR_FLAGS | Current video flags.
Enumerated Type CK_VIDEO_DISPLAY | On what support do we display the video ?
Enumerated Type CK_VIDEO_ERRORS | Video possible errors
Enumerated Type CK_VIDEO_EVENT | Events that happens on a video
Enumerated Type CK_VIDEO_MANAGERSAVEOPTION | Possible saving options for a video from the video manager.
Enumerated Type CK_VIDEO_RUNTIME_FLAGS | Video runtime flags. following flags.
Enumerated Type CK_VIDEO_SAVEOPTION | Possible saving options
Enumerated Type CK_VIDEO_STATE | Current Video State
Enumerated Type CK_VIDEO_TYPE | Supported Video Types
Enumerated Type CK_WAVESOUND_LOCKMODE | Enums specifying lock mode
Enumerated Type CK_WAVESOUND_STATE | Flags specifying current state of a sound
Enumerated Type CK_WAVESOUND_TYPE | Enums specifying the type of a sound
Enumerated Type CKANIMATION_CONTROLLER | List of availables animations controllers
Enumerated Type CKGRID_LAYER_FORMAT | Enum defining the format of a Grid Layer
Enumerated Type CKMANAGER_FUNCTIONS | Mask for Base Manager overridable functions.
Enumerated Type CKSPRITETEXT_ALIGNMENT | Sprite Text Alignment
Render Engine Enumerations | Render Engine related enumeration definitions

See Also

Virtools SDK Reference


ChannelType

Enumerated Type ChannelType

enum ChannelType {
CHANNELTYPE_MATERIAL = 0,
CHANNELTYPE_FLOAT1 = 1,
CHANNELTYPE_FLOAT2 = 2,
CHANNELTYPE_FLOAT3 = 3,
CHANNELTYPE_FLOAT4 = 4,

CHANNELTYPE_COUNT
}

Size of texture coordinates created on a mesh channel

Members

CHANNELTYPE_COUNT |
CHANNELTYPE_FLOAT1 | Extended Channel will contain 1 float (u) texture coordinates
CHANNELTYPE_FLOAT2 | Extended Channel will contain 2 float (u,v) texture coordinates
CHANNELTYPE_FLOAT3 | Extended Channel will contain 3 float (u,v,s) texture coordinates
CHANNELTYPE_FLOAT4 | Extended Channel will contain 4 float (u,v,s,t) texture coordinates
CHANNELTYPE_MATERIAL | Standard material channel (rendered using blend modes)


CK_2DENTITY_FLAGS

Enumerated Type CK_2DENTITY_FLAGS

enum CK_2DENTITY_FLAGS {
CK_2DENTITY_RESERVED3= 0x00000001,
CK_2DENTITY_POSITIONCHANGED= 0x00000002,
CK_2DENTITY_SIZECHANGED= 0x00000004,
CK_2DENTITY_USESIZE= 0x00000008,
CK_2DENTITY_VIRTOOLS= 0x00000010,
CK_2DENTITY_USESRCRECT= 0x00000020,
CK_2DENTITY_BACKGROUND= 0x00000040,
CK_2DENTITY_NOTPICKABLE= 0x00000080,
CK_2DENTITY_RATIOOFFSET= 0x00000100,
CK_2DENTITY_USEHOMOGENEOUSCOORD= 0x00000200,
CK_2DENTITY_CLIPTOCAMERAVIEW= 0x00000400,
CK_2DENTITY_UPDATEHOMOGENEOUSCOORD=0x00000800,
CK_2DENTITY_CLIPTOPARENT= 0x00001000,
CK_2DENTITY_RESERVED0 = 0x00010000,
CK_2DENTITY_RESERVED1 = 0x00020000,
CK_2DENTITY_RESERVED2 = 0x00040000,
CK_2DENTITY_STICKLEFT = 0x00080000,
CK_2DENTITY_STICKRIGHT = 0x00100000,
CK_2DENTITY_STICKTOP = 0x00200000,
CK_2DENTITY_STICKBOTTOM = 0x00400000
}

2DEntity Flags

Members

CK_2DENTITY_BACKGROUND | Force entity to be rendered before 3d objects (CK2dEntity::SetBackground)
CK_2DENTITY_CLIPTOCAMERAVIEW | Clip to camera view rather than to the screen (CK2dEntity::EnableClipToCamera)
CK_2DENTITY_CLIPTOPARENT | Clip to Parent (CK2dEntity::SetClipToParent)
CK_2DENTITY_NOTPICKABLE | This entity can not be picked through CKRenderContext::Pick (CK2dEntity::SetPickable)
CK_2DENTITY_POSITIONCHANGED | Position changed since last frame (used internally)
CK_2DENTITY_RATIOOFFSET | The position is relative to top-right screen or either to top-right camera surface (CK2dEntity::EnableRatioOffset)
CK_2DENTITY_SIZECHANGED | Size changed since last frame (used internally)
CK_2DENTITY_STICKBOTTOM | stick bottom to the parent
CK_2DENTITY_STICKLEFT | stick left to the parent
CK_2DENTITY_STICKRIGHT | stick right to the parent
CK_2DENTITY_STICKTOP | stick top to the parent
CK_2DENTITY_UPDATEHOMOGENEOUSCOORD | Need to update homogeneous coordinates (used internally)
CK_2DENTITY_USEHOMOGENEOUSCOORD | Use homogeneous coordinates (0..1) insted of pixel coordinates (CK2dEntity::SetHomogeneousCoordinates)
CK_2DENTITY_USESIZE | Force entity to use given size
CK_2DENTITY_USESRCRECT | Force entity to use given rect when blitting to screen (CK2dEntity::UseSourceRect)
CK_2DENTITY_VIRTOOLS | Entity created and used by the interface

Remarks

Flags specify how an entity should be drawn to screen.

See Also

CK2dEntity, CK2dEntity::SetFlags


CK_3DENTITY_FLAGS

Enumerated Type CK_3DENTITY_FLAGS

enum CK_3DENTITY_FLAGS {
CK_3DENTITY_DUMMY = 0x00000001,
CK_3DENTITY_FRAME = 0x00000002,
CK_3DENTITY_RESERVED0 = 0x00000020,
CK_3DENTITY_TARGETLIGHT = 0x00000100,
CK_3DENTITY_TARGETCAMERA = 0x00000200,
CK_3DENTITY_IGNOREANIMATION = 0x00000400,
CK_3DENTITY_HIERARCHICALOBSTACLE= 0x00000800,
CK_3DENTITY_UPDATELASTFRAME = 0x00001000,
CK_3DENTITY_CAMERAIGNOREASPECT = 0x00002000,
CK_3DENTITY_DISABLESKINPROCESS = 0x00004000,
CK_3DENTITY_ENABLESKINOFFSET = 0x00008000,
CK_3DENTITY_PLACEVALID = 0x00010000,
CK_3DENTITY_PARENTVALID = 0x00020000,
CK_3DENTITY_IKJOINTVALID = 0x00030000,
CK_3DENTITY_DEPRECATEDIK = 0x00040000,
CK_3DENTITY_PORTAL = 0x00080000,
CK_3DENTITY_ZORDERVALID = 0x00100000,

CK_3DENTITY_HWSKINING = 0x40000000,
CK_3DENTITY_CHARACTERDOPROCESS = 0x80000000,
}

3dEntity Flags

Members

CK_3DENTITY_CAMERAIGNOREASPECT | Ignore aspect ratio setting for cameras
CK_3DENTITY_CHARACTERDOPROCESS | Special flag for Characters : Automatic process of animation
CK_3DENTITY_DEPRECATEDIK | secret Obsolete Flag
CK_3DENTITY_DISABLESKINPROCESS | Force skin processing to be disabled
CK_3DENTITY_DUMMY | Entity is a dummy used to represent a position
CK_3DENTITY_ENABLESKINOFFSET | If not set the skin stay attached to the bones the vertices are linked to, otherwise the skin can be freely rotated,translated or scaled according to its owner entity matrix.
CK_3DENTITY_FRAME | Entity is a frame used to represent an orientation
CK_3DENTITY_HIERARCHICALOBSTACLE | Used by the Collision Manager
CK_3DENTITY_HWSKINING | Special flag for Skins : Use a shader for skinning
CK_3DENTITY_IGNOREANIMATION | Animation using this entity can't modify it
CK_3DENTITY_IKJOINTVALID |
CK_3DENTITY_PARENTVALID | Used internally when saving
CK_3DENTITY_PLACEVALID | Used internally when saving
CK_3DENTITY_PORTAL | The 3dEntity is a portal
CK_3DENTITY_RESERVED0 | Obsolete Flag
CK_3DENTITY_TARGETCAMERA | Entity is a target of a camera
CK_3DENTITY_TARGETLIGHT | Entity is a target of a light
CK_3DENTITY_UPDATELASTFRAME | Store the last world matrix for this Entity after each render
CK_3DENTITY_ZORDERVALID | The 3dEntity has a non-zero ZOrder

Remarks

Flags give user and engine more information about the 3dEntity.

See Also

CK3dEntity::SetFlags,CK3dEntity::GetFlags,


CK_ANIMATION_FLAGS

Enumerated Type CK_ANIMATION_FLAGS

enum CK_ANIMATION_FLAGS {
CKANIMATION_LINKTOFRAMERATE = 0x00000001,
CKANIMATION_CANBEBREAK = 0x00000004,
CKANIMATION_ALLOWTURN = 0x00000008,
CKANIMATION_ALIGNORIENTATION= 0x00000010,
CKANIMATION_SECONDARYWARPER = 0x00000020,
CKANIMATION_SUBANIMSSORTED = 0x00000040,
CKANIMATION_HANDLELOD = 0x00000080,

CKANIMATION_TRANSITION_FROMNOW = 0000000100,
CKANIMATION_TRANSITION_FROMWARPFROMCURRENT = 0x00000200,

CKANIMATION_TRANSITION_TOSTART = 0x00000800,

CKANIMATION_TRANSITION_WARPTOSTART = 0x00001000,
CKANIMATION_TRANSITION_WARPTOBEST = 0x00002000,
CKANIMATION_TRANSITION_WARPTOSAMEPOS = 0x00010000,
CKANIMATION_TRANSITION_WARPTOPOS = 0x00040000,

CKANIMATION_TRANSITION_USEVELOCITY = 0x00004000,
CKANIMATION_TRANSITION_LOOPIFEQUAL = 0x00008000,

CKANIMATION_TRANSITION_WARPSTART = 0x00001200,
CKANIMATION_TRANSITION_WARPBEST = 0x00002200,
CKANIMATION_TRANSITION_WARPSAMEPOS = 0x0001FB00,
CKANIMATION_TRANSITION_WARPPOS = 0x0004FB00,

CKANIMATION_TRANSITION_ALL = 0x0001FF00,

CKANIMATION_SECONDARY_ONESHOT = 0x00040000,
CKANIMATION_SECONDARY_LOOP = 0x00080000,
CKANIMATION_SECONDARY_LASTFRAME = 0x00200000,
CKANIMATION_SECONDARY_LOOPNTIMES = 0x00400000,
CKANIMATION_SECONDARY_DOWARP = 0x00800000,

CKANIMATION_SECONDARY_ALL = 0x00EC0000,

CKANIMATION_TRANSITION_PRESET = 0x01000000,
CKANIMATION_SECONDARY_PRESET = 0x02000000,

}

Flags settings for animations

Members

CKANIMATION_ALIGNORIENTATION | Character will take animation orienation (CKAnimation::SetCharacterOrientation)
CKANIMATION_ALLOWTURN | Character can be rotated while this animation is playing (used internally)
CKANIMATION_CANBEBREAK | If not set, once started an animation will be played until its end (CKAnimation::SetCanBeInterrupt)
CKANIMATION_HANDLELOD | When setting this flags, calling SetStep on a character the engine only animates the character root if it was not rendered last frame.
CKANIMATION_LINKTOFRAMERATE | Interpolation is done accordind to real time (CKAnimation::LinkToFrameRate)
CKANIMATION_SECONDARY_ALL | Creates A transition when starting or stopping a animation
CKANIMATION_SECONDARY_DOWARP | Creates A transition when starting or stopping a animation
CKANIMATION_SECONDARY_LASTFRAME | Animation will stay on last frame
CKANIMATION_SECONDARY_LOOP | Animation will be played continously
CKANIMATION_SECONDARY_LOOPNTIMES | Animation will be played continously for N loop (specified in PlaySecondaryAnimation)
CKANIMATION_SECONDARY_ONESHOT | Animation will be played once
CKANIMATION_SECONDARY_PRESET | Set by the Exporter or user to indicate to ignore flags specified in CKCharacter::PlaySecondaryAnimation ( They should be set trough CKAnimation::SetSecondaryAnimationMode )
CKANIMATION_SECONDARYWARPER | This animation is used to made a transition for secondary animations (used internally)
CKANIMATION_SUBANIMSSORTED | For keyed animations this flag is set when all the sub-objects animations have been sorted accorded to their importance (contribution) in the whole animation (used internally)
CKANIMATION_TRANSITION_ALL |
CKANIMATION_TRANSITION_FROMNOW | Play new animation right now without any transition
CKANIMATION_TRANSITION_FROMWARPFROMCURRENT | Warp to next anim from current position
CKANIMATION_TRANSITION_LOOPIFEQUAL | if current and next animation are the same act as a loop
CKANIMATION_TRANSITION_PRESET | Set by the Exporter or user to indicate to ignore flags specified in CKCharacter::SetNextActiveAnimation ( They should be set trough CKAnimation::SetTransitionMode )
CKANIMATION_TRANSITION_TOSTART | Start next animation from the start
CKANIMATION_TRANSITION_USEVELOCITY | use current animation and next animation velocities to extrapolate a velocity for the root bodypart
CKANIMATION_TRANSITION_WARPBEST | (CK_TRANSITION_FROMWARPFROMCURRENT|CK_TRANSITION_WARPTOBEST)
CKANIMATION_TRANSITION_WARPPOS | (CK_TRANSITION_FROMWARPFROMCURRENT|CK_TRANSITION_WARPTOOS)
CKANIMATION_TRANSITION_WARPSAMEPOS | (CK_TRANSITION_FROMWARPFROMCURRENT|CK_TRANSITION_WARPTOSAMEPOS)
CKANIMATION_TRANSITION_WARPSTART | (CK_TRANSITION_FROMWARPFROMCURRENT|CK_TRANSITION_WARPTOSTART)
CKANIMATION_TRANSITION_WARPTOBEST | warp to the best suited position in the next animation
CKANIMATION_TRANSITION_WARPTOPOS | warp to the given position of next animation
CKANIMATION_TRANSITION_WARPTOSAMEPOS | warp to the same current position in the source animation to the destination animation
CKANIMATION_TRANSITION_WARPTOSTART | warp to the start of next animation

Remarks

These flags specify play options for the animations.

See Also

CKAnimation, CKAnimation::SetFlags


CK_ANIMATION_TRANSITION_MODE

Enumerated Type CK_ANIMATION_TRANSITION_MODE

enum CK_ANIMATION_TRANSITION_MODE {
CK_TRANSITION_FROMNOW =0x00000001,
CK_TRANSITION_FROMWARPFROMCURRENT =0x00000002,

CK_TRANSITION_TOSTART =0x00000008,

CK_TRANSITION_WARPTOSTART =0x00000010,
CK_TRANSITION_WARPTOBEST =0x00000020,
CK_TRANSITION_WARPTOSAMEPOS =0x00000100,
CK_TRANSITION_WARPTOPOS =0x00000400,

CK_TRANSITION_USEVELOCITY =0x00000040,
CK_TRANSITION_LOOPIFEQUAL =0x00000080,

CK_TRANSITION_FROMANIMATION =0x00000200,

CK_TRANSITION_WARPSTART =0x00000012,
CK_TRANSITION_WARPBEST =0x00000022,
CK_TRANSITION_WARPSAMEPOS =0x00000102,
CK_TRANSITION_WARPPOS =0x00000402,
CK_TRANSITION_WARPMASK =0x00000132

}
#define CK_TRANSITION_BREAK (CK_TRANSITION_FROMNOW)
#define CK_TRANSITION_LOOP (CK_TRANSITION_TOSTART)

Transition mode between animations

Members

CK_TRANSITION_FROMANIMATION | Use transition mode stored in the animation (See CKAnimation::SetTransitionMode)
CK_TRANSITION_FROMNOW | play new animation right now without any transition
CK_TRANSITION_FROMWARPFROMCURRENT | Warp to next anim from current position
CK_TRANSITION_LOOPIFEQUAL | if current and next animation are the same act as a loop
CK_TRANSITION_TOSTART | start next animation from the start
CK_TRANSITION_USEVELOCITY | use current animation and next animation velocities to extrapolate a velocity for the root bodypart
CK_TRANSITION_WARPBEST | (CK_TRANSITION_FROMWARPFROMCURRENT|CK_TRANSITION_WARPTOBEST)
CK_TRANSITION_WARPMASK |
CK_TRANSITION_WARPPOS | (CK_TRANSITION_FROMWARPFROMCURRENT|CK_TRANSITION_WARPTOPOS)
CK_TRANSITION_WARPSAMEPOS | (CK_TRANSITION_FROMWARPFROMCURRENT|CK_TRANSITION_WARPTOSAMEPOS)
CK_TRANSITION_WARPSTART | (CK_TRANSITION_FROMWARPFROMCURRENT|CK_TRANSITION_WARPTOSTART)
CK_TRANSITION_WARPTOBEST | warp to the best suited position in the next animation
CK_TRANSITION_WARPTOPOS | warp to a given position in the destination animation
CK_TRANSITION_WARPTOSAMEPOS | warp to the same current position in the source animation to the destination animation
CK_TRANSITION_WARPTOSTART | warp to the start of next animation

Remarks

Constants identifying way transition should occur when changing current animation in a character.

See Also

CKCharacter::SetNextActiveAnimation,CKKeyedAnimation::CreateTransition


CK_ARRAYTYPE

Enumerated Type CK_ARRAYTYPE

enum CK_ARRAYTYPE{
CKARRAYTYPE_INT = 1,
CKARRAYTYPE_FLOAT = 2,
CKARRAYTYPE_STRING = 3,
CKARRAYTYPE_OBJECT = 4,
CKARRAYTYPE_PARAMETER = 5
}

Enum defining the format of a Data Array element.

Members

CKARRAYTYPE_FLOAT | a float
CKARRAYTYPE_INT | an integer
CKARRAYTYPE_OBJECT | a CKObject ID (CK_ID)
CKARRAYTYPE_PARAMETER | a CKParameter ID
CKARRAYTYPE_STRING | a pointer to a string

Remarks

In a data array each column can contain data of the given type.

See Also

CKDataArray::InsertColumn, CKDataArray::GetColumnType


CK_ATTRIBUT_FLAGS

Enumerated Type CK_ATTRIBUT_FLAGS

enum CK_ATTRIBUT_FLAGS {
CK_ATTRIBUT_CAN_MODIFY = 0x00000001,
CK_ATTRIBUT_CAN_DELETE = 0x00000002,
CK_ATTRIBUT_HIDDEN = 0x00000004,
CK_ATTRIBUT_DONOTSAVE = 0x00000008,
CK_ATTRIBUT_USER = 0x00000010,
CK_ATTRIBUT_SYSTEM = 0x00000020,
CK_ATTRIBUT_DONOTCOPY = 0x00000040,
CK_ATTRIBUT_TOSAVE = 0x00000080,
}

Attribute Flags

Members

CK_ATTRIBUT_CAN_DELETE | This Attribute type may be deleted
CK_ATTRIBUT_CAN_MODIFY | This Attribute type may be renamed
CK_ATTRIBUT_DONOTCOPY | This Attribute type will not be copied when the object that holds it is copied
CK_ATTRIBUT_DONOTSAVE | This Attribute type will not be saved
CK_ATTRIBUT_HIDDEN | This Attribute type will not appear in the Virtools Interface
CK_ATTRIBUT_SYSTEM | This Attribute type was created by the system (Behavior Dll,Manager,etc...)
CK_ATTRIBUT_TOSAVE | Temporary flag set in CKFile::EndSave(). This parameter type is to be saved in the SaveData callback of managers. Used in Attribute Manager (used attributes)
CK_ATTRIBUT_USER | This Attribute type was created by a user (in the Dev interface for example)

Remarks

When created a new attribute type with CKAttributeManager::RegisterNewAttributeType , it can be given special properties that will control its behavior in the Dev interface and other special features such as the ability for an attribute to be copied or saved along with the object it belongs to.

See Also

CKAttributeManager::RegisterNewAttributeType,CKAttributeManager::GetAttributeFlags


CK_BEHAVIOR_CALLBACKMASK

Enumerated Type CK_BEHAVIOR_CALLBACKMASK

enum CK_BEHAVIOR_CALLBACKMASK {
CKCB_BEHAVIORPRESAVE =0x00000001,
CKCB_BEHAVIORDELETE =0x00000002,
CKCB_BEHAVIORATTACH =0x00000004,
CKCB_BEHAVIORDETACH =0x00000008,
CKCB_BEHAVIORPAUSE =0x00000010,
CKCB_BEHAVIORRESUME =0x00000020,
CKCB_BEHAVIORCREATE =0x00000040,
CKCB_BEHAVIORRESET =0x00001000,
CKCB_BEHAVIORPOSTSAVE =0x00000100,
CKCB_BEHAVIORLOAD =0x00000200,
CKCB_BEHAVIOREDITED =0x00000400,
CKCB_BEHAVIORSETTINGSEDITED =0x00000800,
CKCB_BEHAVIORREADSTATE =0x00001000,
CKCB_BEHAVIORNEWSCENE =0x00002000,
CKCB_BEHAVIORACTIVATESCRIPT =0x00004000,
CKCB_BEHAVIORDEACTIVATESCRIPT=0x00008000,
CKCB_BEHAVIORRESETINBREAKPOINT=0x00010000,
CKCB_BEHAVIORRENAME =0x00020000,

CKCB_BEHAVIORBASE =0x0000000E,
CKCB_BEHAVIORSAVELOAD =0x00000301,
CKCB_BEHAVIORPPR =0x00000130,
CKCB_BEHAVIOREDITIONS =0x00000C00,
CKCB_BEHAVIORALL =0xFFFFFFFF,
}

Mask for the messages the callback function of a behavior should be aware of.

Members

CKCB_BEHAVIORACTIVATESCRIPT | Callback will be called for CKM_BEHAVIORACTIVATESCRIPT messages
CKCB_BEHAVIORALL | All flags
CKCB_BEHAVIORATTACH | Callback will be called for CKM_BEHAVIORATTACH messages
CKCB_BEHAVIORBASE | Base flags :attach /detach /delete
CKCB_BEHAVIORCREATE | Callback will be called for CKM_BEHAVIORCREATE messages
CKCB_BEHAVIORDEACTIVATESCRIPT | Callback will be called for CKM_BEHAVIORDEACTIVATESCRIPT messages
CKCB_BEHAVIORDELETE | Callback will be called for CKM_BEHAVIORDELETE messages
CKCB_BEHAVIORDETACH | Callback will be called for CKM_BEHAVIORDETACH messages
CKCB_BEHAVIOREDITED | Callback will be called for CKM_BEHAVIOREDITED messages
CKCB_BEHAVIOREDITIONS | Base flags for editions of settings or parameters
CKCB_BEHAVIORLOAD | Callback will be called for CKM_BEHAVIORLOAD messages
CKCB_BEHAVIORNEWSCENE | Callback will be called for CKM_BEHAVIORNEWSCENE messages
CKCB_BEHAVIORPAUSE | Callback will be called for CKM_BEHAVIORPAUSE messages
CKCB_BEHAVIORPOSTSAVE | Callback will be called for CKM_BEHAVIORPOSTSAVE messages
CKCB_BEHAVIORPPR | Base flags for play/pause/reset
CKCB_BEHAVIORPRESAVE | Callback will be called for CKM_BEHAVIORPRESAVE messages
CKCB_BEHAVIORREADSTATE | Callback will be called for CKM_BEHAVIORREADSTATE messages
CKCB_BEHAVIORRENAME | Callback will be called for CKM_BEHAVIORRENAME messages
CKCB_BEHAVIORRESET | Callback will be called for CKM_BEHAVIORRESET messages
CKCB_BEHAVIORRESETINBREAKPOINT | Callback will be called for CKM_BEHAVIORRESETINBREAKPOINT messages
CKCB_BEHAVIORRESUME | Callback will be called for CKM_BEHAVIORRESUME messages
CKCB_BEHAVIORSAVELOAD | Base flags for load and save
CKCB_BEHAVIORSETTINGSEDITED | Callback will be called for CKM_BEHAVIORSETTINGSEDITED messages

Remarks

+The callback function of a behavior may ignore some messages using this mask. +Don't forget to set the mask for the behavior callback function if you use one since it can improve performance not to receive useless messages.

See Also

CKBehaviorPrototype::SetBehaviorCallbackFct,Behavior Prototype Creation


CK_BEHAVIOR_FLAGS

Enumerated Type CK_BEHAVIOR_FLAGS

enum CK_BEHAVIOR_FLAGS {
CKBEHAVIOR_NONE =0x00000000,
CKBEHAVIOR_ACTIVE =0x00000001,
CKBEHAVIOR_SCRIPT =0x00000002,
CKBEHAVIOR_RESERVED1 =0x00000004,
CKBEHAVIOR_USEFUNCTION =0x00000008,
CKBEHAVIOR_RESERVED2 =0x00000010,
CKBEHAVIOR_CUSTOMSETTINGSEDITDIALOG =0x00000020,
CKBEHAVIOR_WAITSFORMESSAGE =0x00000040,
CKBEHAVIOR_VARIABLEINPUTS =0x00000080,
CKBEHAVIOR_VARIABLEOUTPUTS =0x00000100,
CKBEHAVIOR_VARIABLEPARAMETERINPUTS =0x00000200,
CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS =0x00000400,
CKBEHAVIOR_TOPMOST =0x00004000,
CKBEHAVIOR_BUILDINGBLOCK =0x00008000,
CKBEHAVIOR_MESSAGESENDER =0x00010000,
CKBEHAVIOR_MESSAGERECEIVER =0x00020000,
CKBEHAVIOR_TARGETABLE =0x00040000,
CKBEHAVIOR_CUSTOMEDITDIALOG =0x00080000,
CKBEHAVIOR_RESERVED0 =0x00100000,
CKBEHAVIOR_EXECUTEDLASTFRAME =0x00200000,
CKBEHAVIOR_DEACTIVATENEXTFRAME =0x00400000,
CKBEHAVIOR_RESETNEXTFRAME =0x00800000,
CKBEHAVIOR_INTERNALLYCREATEDINPUTS =0x01000000,
CKBEHAVIOR_INTERNALLYCREATEDOUTPUTS =0x02000000,
CKBEHAVIOR_INTERNALLYCREATEDINPUTPARAMS =0x04000000,
CKBEHAVIOR_INTERNALLYCREATEDOUTPUTPARAMS=0x08000000,
CKBEHAVIOR_INTERNALLYCREATEDLOCALPARAMS =0x40000000,
CKBEHAVIOR_ACTIVATENEXTFRAME =0x10000000,
CKBEHAVIOR_LOCKED =0x20000000,
CKBEHAVIOR_LAUNCHEDONCE =0x80000000,
}

Flags settings for behaviors.

Members

CKBEHAVIOR_ACTIVATENEXTFRAME | Behavior will be activated next frame
CKBEHAVIOR_ACTIVE | This behavior is active
CKBEHAVIOR_BUILDINGBLOCK | This Behavior is a building block. Automatically set by the engine when coming from a DLL.
CKBEHAVIOR_CUSTOMEDITDIALOG | This Behavior have a custom Dialog Box for parameters edition .
CKBEHAVIOR_CUSTOMSETTINGSEDITDIALOG | Behavior has a custom Dialog Box for settings edition .
CKBEHAVIOR_DEACTIVATENEXTFRAME | Behavior will be deactivated next frame
CKBEHAVIOR_EXECUTEDLASTFRAME | This behavior has been executed during last process. (Available only in profile mode )
CKBEHAVIOR_INTERNALLYCREATEDINPUTPARAMS | Behavior execution may create/delete input parameters or change their type
CKBEHAVIOR_INTERNALLYCREATEDINPUTS | Behavior execution may create/delete inputs
CKBEHAVIOR_INTERNALLYCREATEDLOCALPARAMS | Behavior execution may create/delete local parameters or change their type
CKBEHAVIOR_INTERNALLYCREATEDOUTPUTPARAMS | Behavior execution may create/delete output parameters or change their type
CKBEHAVIOR_INTERNALLYCREATEDOUTPUTS | Behavior execution may create/delete outputs
CKBEHAVIOR_LAUNCHEDONCE | Behavior has not yet been launched...
CKBEHAVIOR_LOCKED | Behavior is locked for utilisation in Virtools
CKBEHAVIOR_MESSAGERECEIVER | Behavior may check messages during its execution.
CKBEHAVIOR_MESSAGESENDER | Behavior may send messages during its execution.
CKBEHAVIOR_NONE | Reserved for future use
CKBEHAVIOR_RESERVED0 | Reserved for internal use.
CKBEHAVIOR_RESERVED1 | Reserved for internal use.
CKBEHAVIOR_RESERVED2 | Reserved for internal use.
CKBEHAVIOR_RESETNEXTFRAME | Behavior will be reseted next frame
CKBEHAVIOR_SCRIPT | This behavior is a script
CKBEHAVIOR_TARGETABLE | Behavior may be owned by a different object that the one to which its execution will apply.
CKBEHAVIOR_TOPMOST | No other Behavior includes this one
CKBEHAVIOR_USEFUNCTION | Behavior uses a function and not a graph
CKBEHAVIOR_VARIABLEINPUTS | Behavior may have its inputs changed by editing them
CKBEHAVIOR_VARIABLEOUTPUTS | Behavior may have its outputs changed by editing them
CKBEHAVIOR_VARIABLEPARAMETERINPUTS | Behavior may have its number of input parameters changed by editing them
CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS | Behavior may have its number of output parameters changed by editing them
CKBEHAVIOR_WAITSFORMESSAGE | Behavior is waiting for a message to activate one of its outputs

Remarks

When creating a prototype, you can precise various flags about how your behavior will act: whether it will send or receive message, does the user may add inputs,outputs or parameters, is it active, etc.

See Also

CKBehaviorPrototype::SetBehaviorFlags,Behavior Prototype Creation


CK_BEHAVIOR_RETURN

Enumerated Type CK_BEHAVIOR_RETURN

enum CK_BEHAVIOR_RETURN
{
CKBR_OK = 0,
CKBR_ACTIVATENEXTFRAME = 1,
CKBR_ATTACHFAILED = 2,
CKBR_DETACHFAILED = 4,
CKBR_LOCKED = 6,
CKBR_INFINITELOOP = 8,
CKBR_BREAK = 10,
CKBR_GENERICERROR = 0xA000,
CKBR_BEHAVIORERROR = 0xA002,
CKBR_OWNERERROR = 0xA004,
CKBR_PARAMETERERROR = 0xA008,
CKBR_GENERICERROR_RETRY = 0xA001,
CKBR_BEHAVIORERROR_RETRY = 0xA003,
CKBR_OWNERERROR_RETRY = 0xA005,
CKBR_PARAMETERERROR_RETRY = 0xA009,

}

Return value for the behavior execution function.

Members

CKBR_ACTIVATENEXTFRAME | The behavior will be reactivated next frame
CKBR_ATTACHFAILED | The attach failed
CKBR_BEHAVIORERROR | The behavior gave to the code was wrong
CKBR_BEHAVIORERROR_RETRY |
CKBR_BREAK | Break the processing here => Keep on processing windows messages but keep on calling the behavior until it returns a different value (Used by script debugger )
CKBR_DETACHFAILED | The attach failed
CKBR_GENERICERROR | Something went wrong
CKBR_GENERICERROR_RETRY |
CKBR_INFINITELOOP | The behavior has reached the infinite loop limit...
CKBR_LOCKED | obsolete..
CKBR_OK | Everything's ok. Behavior is deactivated unless one of its inputs is active.
CKBR_OWNERERROR | The owner isn't what it should be
CKBR_OWNERERROR_RETRY |
CKBR_PARAMETERERROR | Some of the parameters are wrong
CKBR_PARAMETERERROR_RETRY |

Remarks

Return value of a behavior execution function is used to activate it the next frame and handle errors.

A return value with _RETRY (CKBR_ACTIVATENEXTFRAME bit set) forces the behavior to be reactivated next frame.

See Also

CKBehaviorPrototype::SetFunction


CK_BEHAVIOR_TYPE

Enumerated Type CK_BEHAVIOR_TYPE

enum CK_BEHAVIOR_TYPE {
CKBEHAVIORTYPE_BASE =0x00000000,
CKBEHAVIORTYPE_SCRIPT =0x00000001,
CKBEHAVIORTYPE_BEHAVIOR =0x00000004,
}

Behavior Type.

Members

CKBEHAVIORTYPE_BASE | This Behavior is a most simple type of behavior ( a function )
CKBEHAVIORTYPE_BEHAVIOR | This Behavior is a simple one ( a graph )
CKBEHAVIORTYPE_SCRIPT | This Behavior is a script

Remarks

Behaviors may be scripts, simpliest behaviors (a function) or elaborated graphs of sub-behaviors.

See Also

CKBehavior::GetType


CK_BINARYOPERATOR

Enumerated Type CK_BINARYOPERATOR

enum CK_BINARYOPERATOR{
CKADD = 1,
CKSUB = 2,
CKMUL = 3,
CKDIV = 4
}

Available operations between colums of a DataArray

Members

CKADD | Addition
CKDIV | Division
CKMUL | Multiplication
CKSUB | Substraction

See Also

CKDataArray::ColumnTransform, CKDataArray::ColumnsOperate


CK_BITMAP_SAVEOPTIONS

Type Definition CK_BITMAP_SAVEOPTIONS

typedef CK_TEXTURE_SAVEOPTIONS CK_BITMAP_SAVEOPTIONS

Specify the way textures or sprites will be saved

See Also

CK_TEXTURE_SAVEOPTIONS


CK_BITMAP_SYSTEMCACHING

Enumerated Type CK_BITMAP_SYSTEMCACHING

enum CK_BITMAP_SYSTEMCACHING
{
CKBITMAP_PROCEDURAL = 0,
CKBITMAP_VIDEOSHADOW = 1,
CKBITMAP_DISCARD = 2
}

Specify the way textures or sprites are stored in system memory

Members

CKBITMAP_DISCARD | The texture is not stored in system memory
CKBITMAP_PROCEDURAL | The texture is stored in a raw 32 bit per pixel format for easy read and write operations (needed for SetPixel and ReadPixel for ex.).
CKBITMAP_VIDEOSHADOW | The texture is stored in the same format as the desired video

See Also

CKBitmapData::SetSystemCaching,CKContext::SetGlobalImagesSaveOptions


CK_BITMAPREADER_ERROR

Enumerated Type CK_BITMAPREADER_ERROR

enum CK_BITMAPREADER_ERROR {
CKBITMAPERROR_GENERIC =1,
CKBITMAPERROR_READERROR =2,
CKBITMAPERROR_UNSUPPORTEDFILE =3,
CKBITMAPERROR_FILECORRUPTED =4,
CKBITMAPERROR_SAVEERROR =5,
CKBITMAPERROR_UNSUPPORTEDSAVEFORMAT =6,
CKBITMAPERROR_UNSUPPORTEDFUNCTION =7
}

Bitmap Reader Error Values.

Members

CKBITMAPERROR_FILECORRUPTED | File is corrupted (CRC error)
CKBITMAPERROR_GENERIC | Generic Error
CKBITMAPERROR_READERROR | File could not be read
CKBITMAPERROR_SAVEERROR | File could not be saved
CKBITMAPERROR_UNSUPPORTEDFILE | Image Format is not supported for a load operation
CKBITMAPERROR_UNSUPPORTEDFUNCTION | Image Format is not supported for a save operation
CKBITMAPERROR_UNSUPPORTEDSAVEFORMAT | Image Format is not supported for a save operation


CK_BONES_REFERENTIAL

Enumerated Type CK_BONES_REFERENTIAL

enum CK_BONES_REFERENTIAL {

CK_BONE_LOCAL = 0x00000000,
CK_BONE_WORLD ,
CK_BONE_WORLDVIEW ,

}

Type of bone matrices send to the skinning shader

Members

CK_BONE_LOCAL | Matrices transformed from bones referential to skin holder referential
CK_BONE_WORLD | Matrices transformed from bones referential to world referential
CK_BONE_WORLDVIEW | Matrices transformed from bones referential to camera referential


CK_COMPOPERATOR

Enumerated Type CK_COMPOPERATOR

enum CK_COMPOPERATOR{
CKEQUAL = 1,
CKNOTEQUAL = 2,
CKLESSER = 3,
CKLESSEREQUAL = 4,
CKGREATER = 5,
CKGREATEREQUAL = 6
}

Available comparisons between colums of a DataArray

Members

CKEQUAL
CKGREATER
CKGREATEREQUAL
CKLESSER
CKLESSEREQUAL
CKNOTEQUAL

See Also

CKDataArray::CreateGroup, CKDataArray::FindLine


CK_CONFIG_FLAGS

Enumerated Type CK_CONFIG_FLAGS

enum CK_CONFIG_FLAGS {
CK_CONFIG_DISABLEDSOUND= 1,
CK_CONFIG_DISABLEDINPUT= 2,
CK_CONFIG_DOWARN= 4
}

Flags specifying start options for Virtools

Members

CK_CONFIG_DISABLEDINPUT | Prevent CK from initializing Input Engines
CK_CONFIG_DISABLEDSOUND | Prevent CK from initializing Sound Engines
CK_CONFIG_DOWARN | Set this flag for message box warning (sound init failed, etc.)

Remarks

Flags specifying start options for Virtools

See Also

CKCreateContext


CK_DATAREADER_FLAGS

Enumerated Type CK_DATAREADER_FLAGS

enum CK_DATAREADER_FLAGS {
CK_DATAREADER_FILELOAD = 0x00000001,
CK_DATAREADER_FILESAVE = 0x00000002,
CK_DATAREADER_MEMORYLOAD = 0x00000004,
CK_DATAREADER_MEMORYSAVE = 0x00000008,
CK_DATAREADER_STREAMFILE = 0x00000010,
CK_DATAREADER_STREAMURL = 0x00000020,
CK_DATAREADER_VXSTREAMLOAD = 0x00000040,
}

Readers loading/saving capabilities.

Members

CK_DATAREADER_FILELOAD | This reader can load data from file
CK_DATAREADER_FILESAVE | This reader can save data to file
CK_DATAREADER_MEMORYLOAD | This reader can load data from memory
CK_DATAREADER_MEMORYSAVE | This reader can save data to memory
CK_DATAREADER_STREAMFILE | This reader can stream data from file
CK_DATAREADER_STREAMURL | This reader can stream data from URL
CK_DATAREADER_VXSTREAMLOAD | This reader can load data from a VxStream

Remarks

A Reader (either bitmap,sound or model) must implement the GetFlags method to indicate its loading / saving capabilities by returning a combination of the following flags.

See Also

CKDataReader::GetFlags


CK_DEPENDENCIES_FLAGS

Enumerated Type CK_DEPENDENCIES_FLAGS

enum CK_DEPENDENCIES_FLAGS {
CK_DEPENDENCIES_CUSTOM = 0x00000000,
CK_DEPENDENCIES_NONE = 0x00000001,
CK_DEPENDENCIES_FULL = 0x00000002
}

Dependencies options

Members

CK_DEPENDENCIES_CUSTOM | Dependencies will depends on what options where modified in CKDependencies
CK_DEPENDENCIES_FULL | Every dependencies will be taken
CK_DEPENDENCIES_NONE | No dependencies will be taken into account

See Also

CKDependencies


CK_DEPENDENCIES_OPMODE

Enumerated Type CK_DEPENDENCIES_OPMODE

enum CK_DEPENDENCIES_OPMODE {
CK_DEPENDENCIES_COPY = 1,
CK_DEPENDENCIES_DELETE = 2,
CK_DEPENDENCIES_REPLACE = 3,
CK_DEPENDENCIES_SAVE = 4,
CK_DEPENDENCIES_BUILD = 5,
CK_DEPENDENCIES_OPERATIONMODE = 0xF
}

Specify the mode of operation of a CKDependenciesContext.

Members

CK_DEPENDENCIES_BUILD | Building a list of dependencies
CK_DEPENDENCIES_COPY | Copying objects
CK_DEPENDENCIES_DELETE | Deleting objects
CK_DEPENDENCIES_OPERATIONMODE |
CK_DEPENDENCIES_SAVE | Saving objects

Remarks

A CKDependenciesContext class is always used when it come to work with object dependencies (A mesh if a dependencies of a CK3dEntity for example)

See Also

CKCreateObject


CK_DESTROY_FLAGS

Enumerated Type CK_DESTROY_FLAGS

enum CK_DESTROY_FLAGS {
CK_DESTROY_FREEID = 0x00000001,
CK_DESTROY_NONOTIFY = 0x00000002,
CK_DESTROY_TEMPOBJECT = 0x00000003,
}

Objects destruction Flags

Members

CK_DESTROY_FREEID | Release the CK_ID of the object so that it can be re-used bu new objects.
CK_DESTROY_NONOTIFY | Managers and other objects won't be notified of this deletion
CK_DESTROY_TEMPOBJECT | Combination for temporary objects : Do not notify and release CK_ID

Remarks

Flags specifying how objects should be deleted.

See Also

CKContext::DestroyObjects,CKContext::DestroyObject


CK_FILE_WRITEMODE

Enumerated Type CK_FILE_WRITEMODE

enum CK_FILE_WRITEMODE
{
CKFILE_UNCOMPRESSED =0,
CKFILE_CHUNKCOMPRESSED_OLD =1,
CKFILE_EXTERNALTEXTURES_OLD=2,
CKFILE_FORVIEWER =4,
CKFILE_WHOLECOMPRESSED =8,
}

Specify the way files are saved to disk (compression)

Members

CKFILE_CHUNKCOMPRESSED_OLD | Obsolete
CKFILE_EXTERNALTEXTURES_OLD | Obsolete : use CKContext::SetGlobalImagesSaveOptions instead.
CKFILE_FORVIEWER | Don't save Interface Data within the file, the level won't be editable anymore in the interface
CKFILE_UNCOMPRESSED | Save data uncompressed
CKFILE_WHOLECOMPRESSED | Compress the whole file

Remarks

File write mode controls the format of a Virtools file when saved. More specifically it controls whether compression is enabled and also if the Virtools Interface specific data should be stored in the file (if CKFILE_FORVIEWER flag is set , no interface data is saved)

See Also

CKContext::SetFileWriteMode,CKContext::GetFileWriteMode,CKContext::SetCompressionLevel,CKContext::SetGlobalImagesSaveOptions,CKContext::SetGlobalSoundsSaveOptions


CK_FLOORGEOMETRY

Enumerated Type CK_FLOORGEOMETRY

enum CK_FLOORGEOMETRY {
CKFLOOR_FACES =0x00000000,
CKFLOOR_BOX =0x00000001,
}

Geometric precision for floor-intersection tests.

Members

CKFLOOR_BOX | Floors testing will occur at the Object Local Bounding Box level
CKFLOOR_FACES | Floors testing will occur at the Object Faces level.

Remarks

Enum defining the geometric precision that should be use by default for an entity during the floor test

See Also

CKFloorManager


CK_FLOORNEAREST

Enumerated Type CK_FLOORNEAREST

enum CK_FLOORNEAREST{
CKFLOOR_NOFLOOR =0x00000000,
CKFLOOR_DOWN =0x00000001,
CKFLOOR_UP =0x00000002,
}

Enum defining the floors found when retrieving the floors around a position

Members

CKFLOOR_DOWN | There is a floor below the asked position
CKFLOOR_NOFLOOR | No Floors were found
CKFLOOR_UP | There is a floor above the asked position

See Also

CKFloorManager::GetNearestFloors


CK_FOCUSLOST_BEHAVIOR

Enumerated Type CK_FOCUSLOST_BEHAVIOR

enum CK_FOCUSLOST_BEHAVIOR {
CK_FOCUSLOST_NONE = 0,
CK_FOCUSLOST_PAUSEINPUT_MAIN = 1,
CK_FOCUSLOST_PAUSEINPUT_PLAYER = 2,
CK_FOCUSLOST_PAUSEALL = 3,
CK_FOCUSLOST_PAUSEINPUT_WHENOUT = 4
}

web player's behavior when it losts focus (used by webplayer)

Members

CK_FOCUSLOST_NONE
CK_FOCUSLOST_PAUSEALL
CK_FOCUSLOST_PAUSEINPUT_MAIN
CK_FOCUSLOST_PAUSEINPUT_PLAYER
CK_FOCUSLOST_PAUSEINPUT_WHENOUT


CK_FRAMERATE_LIMITS

Enumerated Type CK_FRAMERATE_LIMITS

enum CK_FRAMERATE_LIMITS
{
CK_RATE_NOP = 0x00000000,
CK_BEHRATE_SYNC = 0x00000001,
CK_BEHRATE_LIMIT = 0x00000004,
CK_BEHRATE_MASK = 0x0000000F,

CK_FRAMERATE_SYNC = 0x00000010,
CK_FRAMERATE_FREE = 0x00000020,
CK_FRAMERATE_LIMIT = 0x00000040,
CK_FRAMERATE_MASK = 0x000000F0,
}

Time limits settings

Members

CK_BEHRATE_LIMIT | Behavioral Rate is limited to a maximum value (see CKTimeManager::SetBehavioralRateLimit)
CK_BEHRATE_MASK | Mask for values concerning behavioral rate
CK_BEHRATE_SYNC | Behavioral Rate is synchronized to frame rate
CK_FRAMERATE_FREE | Frame Rate is free. Rendering occurs at the maximum possible rate.
CK_FRAMERATE_LIMIT | Frame Rate is limited to a maximum value (see CKTimeManager::SetFrameRateLimit)
CK_FRAMERATE_MASK | Mask for values concerning frame rate
CK_FRAMERATE_SYNC | Frame Rate is synchronized to screen refresh rate (Render function will wait for vertical blank signal)

Remarks

The default settings for the process loop is to execute one behavioral process then one rendering (with a synchonization to screen refresh rate). Behavioral process and Rendering can have a maximum frame rate in which case it is guaranteed the rendering and behavioral loop will not be called more than the given fps time per second. The asked frame rate may not be achieved but it will not be exceed.

See Also

CKTimeManager


CK_GEOMETRICPRECISION

Enumerated Type CK_GEOMETRICPRECISION

enum CK_GEOMETRICPRECISION {
CKCOLLISION_NONE =0x00000000,
CKCOLLISION_BOX =0x00000001,
CKCOLLISION_FACE =0x00000002,
}

Geometric precision for collision tests

Members

CKCOLLISION_BOX | Collision testing will occur at the Object Local Bounding Box level
CKCOLLISION_FACE | Collision testing will occur at the Object Faces level.
CKCOLLISION_NONE | This value is used only when we want to use the default precision when testing objects

Remarks

This enum is also used when asking for a collision detection. In this case it can override the precision attributed to the obstacles (by asking for box testing, for example) or it can use this default values by using CKCOLLISION_NONE (the preferred way).

See Also

CKCollisionManager,CKCollisionManager::DetectCollision


CK_GRIDORIENTATION

Enumerated Type CK_GRIDORIENTATION

enum CK_GRIDORIENTATION{
CKGRID_FREE = 0x00000000,
CKGRID_XZ = 0x00000001,
CKGRID_XY = 0x00000002,
CKGRID_YZ = 0x00000003,
}

Enum defining the orientation of a Grid

Members

CKGRID_FREE | Free Orientation
CKGRID_XY | Aligned along the X and Y world axis
CKGRID_XZ | Aligned along the X and Z world axis
CKGRID_YZ | Aligned along the Y and Z world axis

See Also

CKGrid::GetOrientationMode, CKGrid::SetOrientationMode


CK_IMPACTINFO

Enumerated Type CK_IMPACTINFO

enum CK_IMPACTINFO {
OBSTACLETOUCHED =0x00000001,
SUBOBSTACLETOUCHED =0x00000002,
TOUCHEDFACE =0x00000004,
TOUCHINGFACE =0x00000008,
TOUCHEDVERTEX =0x00000010,
TOUCHINGVERTEX =0x00000020,
IMPACTWORLDMATRIX =0x00000040,
IMPACTPOINT =0x00000080,
IMPACTNORMAL =0x00000100,
OWNERENTITY =0x00000200,
}

Flags defining which informations should be returned from a collision.

Members

IMPACTNORMAL | Fills the m_ImpactNormal member of the structure
IMPACTPOINT | Fills the m_ImpactPoint member of the structure
IMPACTWORLDMATRIX | Fills the m_ImpactWorldMatrix member of the structure
OBSTACLETOUCHED | Fills the m_ObstacleTouched member of the structure
OWNERENTITY | Fills the m_OwnerEntity member of the structure
SUBOBSTACLETOUCHED | Fills the m_EntityTouched member of the structure
TOUCHEDFACE | Fills the m_TouchedFace member of the structure
TOUCHEDVERTEX | Fills the m_TouchedVertex member of the structure
TOUCHINGFACE | Fills the m_TouchingFace member of the structure
TOUCHINGVERTEX | Fills the m_TouchingVertex member of the structure

Remarks

These flags are used to specify which members of the ImpactDesc structure should be filled with collision information.

See Also

CKCollisionManager,CKCollisionManager::DetectCollision


CK_LOAD_FLAGS

Enumerated Type CK_LOAD_FLAGS

enum CK_LOAD_FLAGS {
CK_LOAD_ANIMATION =1<<0,
CK_LOAD_GEOMETRY =1<<1,
CK_LOAD_DEFAULT =CK_LOAD_GEOMETRY|CK_LOAD_ANIMATION,
CK_LOAD_ASCHARACTER =1<<2,
CK_LOAD_DODIALOG =1<<3,
CK_LOAD_AS_DYNAMIC_OBJECT =1<<4,
CK_LOAD_AUTOMATICMODE =1<<5,
CK_LOAD_CHECKDUPLICATES =1<<6,
CK_LOAD_CHECKDEPENDENCIES =1<<7,
CK_LOAD_ONLYBEHAVIORS =1<<8,
CK_LOAD_REPLACEALL_WITHSCRIPT =1<<9,
CK_LOAD_KEEP_CKFILE_OBJECT_AFTER_LOAD =1<<10,
}

Load Options.

Members

CK_LOAD_ANIMATION | Load animations
CK_LOAD_AS_DYNAMIC_OBJECT | Objects loaded from this file may be deleted at run-time or are temporary
CK_LOAD_ASCHARACTER | Load all the objects and create a character that contains them all .
CK_LOAD_AUTOMATICMODE | Check object name unicity and automatically rename or replace according to the options specified in CKContext::SetAutomaticLoadMode
CK_LOAD_CHECKDEPENDENCIES | Check if every plugins needed are availables
CK_LOAD_CHECKDUPLICATES | Check object name unicity (The list of duplicates is stored in the CKFile class after a OpenFile call
CK_LOAD_DEFAULT | Load animations & geometry
CK_LOAD_DODIALOG | Check object name unicity and warns the user with a dialog box when duplicate names are found.
CK_LOAD_GEOMETRY | Load geometry.
CK_LOAD_KEEP_CKFILE_OBJECT_AFTER_LOAD | ask the reader not to delete the CKFile & store it with CKContext::SetLoadedFile for interface ui purpose
CK_LOAD_ONLYBEHAVIORS |
CK_LOAD_REPLACEALL_WITHSCRIPT | Replace all duplicates names, scripts included (old scripts are deleted)

Remarks

This options apply when loading a Virtools file or a importing a 3D Model file. They defines whether object geometry,only animations or only behaviors should be loaded. One can specify (using the CK_LOAD_AS_DYNAMIC_OBJECT) if created CKObjects should be created as dynamic (See also Dynamic Objects)

See Also

CKContext::Load,CKContext::CKSave


CK_MOUSEBUTTON

Enumerated Type CK_MOUSEBUTTON

enum CK_MOUSEBUTTON {
CK_MOUSEBUTTON_LEFT = 0,
CK_MOUSEBUTTON_RIGHT = 1,
CK_MOUSEBUTTON_MIDDLE = 2,
CK_MOUSEBUTTON_4 = 3
}

Mouse Buttons Constants

Members

CK_MOUSEBUTTON_4 |
CK_MOUSEBUTTON_LEFT | Left Mouse Button
CK_MOUSEBUTTON_MIDDLE | Middle Mouse Button
CK_MOUSEBUTTON_RIGHT | Right Mouse Button

Remarks

Constants identifying mouse buttons.

See Also

CKInputManager::IsMouseButtonDown()


CK_MOVIEREADER_ERROR

Enumerated Type CK_MOVIEREADER_ERROR

enum CK_MOVIEREADER_ERROR {
CKMOVIEERROR_GENERIC = 1,
CKMOVIEERROR_READERROR = 2,
CKMOVIEERROR_UNSUPPORTEDFILE = 3,
CKMOVIEERROR_FILECORRUPTED = 4,
CKMOVIEERROR_SAVEERROR = 5,
CKMOVIEERROR_UNSUPPORTEDSAVEFORMAT = 6
}

Movie Reader Error Values.

Members

CKMOVIEERROR_FILECORRUPTED | File is corrupted (CRC error)
CKMOVIEERROR_GENERIC | Generic Error
CKMOVIEERROR_READERROR | File could not be read
CKMOVIEERROR_SAVEERROR | File could not be saved
CKMOVIEERROR_UNSUPPORTEDFILE | Image Format is not supported for a load operation
CKMOVIEERROR_UNSUPPORTEDSAVEFORMAT | Image Format is not supported for a save operation


CK_OBJECT_FLAGS

Enumerated Type CK_OBJECT_FLAGS

enum CK_OBJECT_FLAGS {
CK_OBJECT_INTERFACEOBJ = 0x00000001,
CK_OBJECT_PRIVATE = 0x00000002,
CK_OBJECT_INTERFACEMARK = 0x00000004,
CK_OBJECT_FREEID = 0x00000008,
CK_OBJECT_TOBEDELETED = 0x00000010,
CK_OBJECT_NOTTOBESAVED = 0x00000020,
CK_OBJECT_VISIBLE = 0x00000040,
CK_OBJECT_NAMESHARED = 0x00000080,
CK_OBJECT_DYNAMIC = 0x00000108,
CK_OBJECT_HIERACHICALHIDE = 0x00000200,
CK_OBJECT_UPTODATE = 0x00000400,
CK_OBJECT_TEMPMARKER = 0x00000800,
CK_OBJECT_ONLYFORFILEREFERENCE = 0x00001000,
CK_OBJECT_NOTTOBEDELETED = 0x00002000,
CK_OBJECT_APPDATA = 0x00004000,
CK_OBJECT_SINGLEACTIVITY = 0x00008000,
CK_OBJECT_LOADSKIPBEOBJECT = 0x00010000,
CK_OBJECT_KEEPSINGLEACTIVITY = 0x00020000,
CK_OBJECT_LOADREPLACINGOBJECT = 0x00040000,

CK_OBJECT_NOTTOBELISTEDANDSAVED = 0x00000023,
CK_OBJECT_SELECTIONSET = 0x00080000,
CK_OBJECT_VR_DISTRIBUTED = 0x00100000,

CK_PARAMETEROUT_SETTINGS = 0x00400000,
CK_PARAMETEROUT_PARAMOP = 0x00800000,
CK_PARAMETERIN_DISABLED = 0x01000000,
CK_PARAMETERIN_THIS = 0x02000000,
CK_PARAMETERIN_SHARED = 0x04000000,
CK_PARAMETEROUT_DELETEAFTERUSE = 0x08000000,
CK_OBJECT_PARAMMASK = 0x0FC00000,

CK_BEHAVIORIO_IN = 0x10000000,
CK_BEHAVIORIO_OUT = 0x20000000,
CK_BEHAVIORIO_ACTIVE = 0x40000000,
CK_OBJECT_IOTYPEMASK = 0x30000000,
CK_OBJECT_IOMASK = 0xF0000000,

CKBEHAVIORLINK_RESERVED = 0x10000000,
CKBEHAVIORLINK_ACTIVATEDLASTFRAME = 0x20000000,
CK_OBJECT_BEHAVIORLINKMASK = 0x30000000,
}

CKObject Flags

Members

CK_BEHAVIORIO_ACTIVE | This BehaviorIO is a currently active (CKBehaviorIO::Activate}
CK_BEHAVIORIO_IN | This BehaviorIO is a behavior input (CKBehaviorIO::SetType}
CK_BEHAVIORIO_OUT | This BehaviorIO is a behavior output (CKBehaviorIO::SetType)
CK_OBJECT_APPDATA | This object has app data
CK_OBJECT_DYNAMIC | This object may be created or deleted at run-time, it also contails CK_OBJECT_FREEID. (CKObject::IsDynamic,CKContext::CreateObject)
CK_OBJECT_FREEID | ID of this object can be released safely and is free to be reused by future CKobjects.
CK_OBJECT_HIERACHICALHIDE | This object hides all its hierarchy (CKObject::Show)
CK_OBJECT_INTERFACEOBJ | Reserved for Inteface Use
CK_OBJECT_KEEPSINGLEACTIVITY | this object must keep its information of single activity (active at scene start,etc..)
CK_OBJECT_LOADREPLACINGOBJECT | Indicates the object being loaded is being replaced
CK_OBJECT_LOADSKIPBEOBJECT | When loading this object the CKBeObject part should be skipped
CK_OBJECT_NAMESHARED | This object has its name from another entity
CK_OBJECT_NOTTOBEDELETED | This object must not be deleted in a clear all
CK_OBJECT_NOTTOBELISTEDANDSAVED | Combination of Private and Not To Be Saved
CK_OBJECT_NOTTOBESAVED | This object must not be saved
CK_OBJECT_PARAMMASK | Mask for options specific to parameters
CK_OBJECT_PRIVATE | The object must not be displayed in interface (Lists,Level view,etc...),nor should it be saved. (CKObject::IsPrivate()
CK_OBJECT_SELECTIONSET | if group, then it is a selection set, otherwise, temporary flag used for objects belonging to a selection set. Used by Virtools's Interface
CK_OBJECT_SINGLEACTIVITY | this object has an information of single activity (active at scene start,etc..)
CK_OBJECT_TOBEDELETED | This object is being deleted
CK_OBJECT_UPTODATE | (Camera,etc..)
CK_OBJECT_VISIBLE | This object is visible (CKObject::Show)
CK_OBJECT_VR_DISTRIBUTED | distributed object for VR (ie mainly used for distributed parameters for VR)
CK_PARAMETERIN_DISABLED | Parameter In or Out is disabled (CKBehavior::EnableInputParameter,CKBehavior::DisableInputParameter)
CK_PARAMETERIN_THIS | Special parameter type : its value and type are always equal to its owner (CKParameter::SetAsMyselfParameter)
CK_PARAMETEROUT_DELETEAFTERUSE | When adding parameters to CKMessage, they can be automatically deleted when message is released (CKMessage::AddParameter)
CK_PARAMETEROUT_PARAMOP | This parameter is the output of a CKParameterOperation (Automatically set by Engine)
CKBEHAVIORLINK_ACTIVATEDLASTFRAME | This link had been activated last frame
CKBEHAVIORLINK_RESERVED | This BehaviorIO is a behavior input (CKBehaviorIO::SetType}

Remarks

Flags specifying special settings for basic objects. Some of this flags are shared with sub-classes such as CKParameterIn,CKParameterOut and CKBehaviorIO. You rarely need to modify directly this flags through CKObject::SetFlags or CKObject::ModifyObjectFlags instead you should always use the specific acces function (given between ()) which may need to perform additionnal operations.

See Also

CKObject,CKObject::GetObjectFlags,CKObject::ModifyObjectFlags


CK_OBJECTANIMATION_FLAGS

Enumerated Type CK_OBJECTANIMATION_FLAGS

enum CK_OBJECTANIMATION_FLAGS {
CK_OBJECTANIMATION_IGNOREPOS = 0x00000004,
CK_OBJECTANIMATION_IGNOREROT = 0x00000008,
CK_OBJECTANIMATION_IGNORESCALE = 0x00000010,
CK_OBJECTANIMATION_IGNOREMORPH = 0x00000020,
CK_OBJECTANIMATION_IGNORESCALEROT = 0x00000040,
CK_OBJECTANIMATION_MERGED = 0x00000080,
CK_OBJECTANIMATION_WARPER = 0x40000000,
CK_OBJECTANIMATION_RESERVED = 0x80000000,
}

Special settings for object animations.

Members

CK_OBJECTANIMATION_IGNOREMORPH | Ignore Morph information
CK_OBJECTANIMATION_IGNOREPOS | Ignore Position information
CK_OBJECTANIMATION_IGNOREROT | Ignore Rotation information
CK_OBJECTANIMATION_IGNORESCALE | Ignore Scaling information
CK_OBJECTANIMATION_IGNORESCALEROT | Ignore Shear information
CK_OBJECTANIMATION_MERGED | This animation is a merged animation (CKObjectAnimation::CreateMergedAnimation)
CK_OBJECTANIMATION_RESERVED | reserved for internal use
CK_OBJECTANIMATION_WARPER | This animation is used for transitions (internal)

Remarks

These flags specify special settings for object animations such as ignoring position,scale or rotation information.

See Also

CKObjectAnimation::GetFlags


CK_OBJECTCREATION_OPTIONS

Enumerated Type CK_OBJECTCREATION_OPTIONS

enum CK_OBJECTCREATION_OPTIONS
{
CK_OBJECTCREATION_NONAMECHECK = 0,
CK_OBJECTCREATION_REPLACE = 1,
CK_OBJECTCREATION_RENAME = 2,
CK_OBJECTCREATION_USECURRENT = 3,
CK_OBJECTCREATION_ASK = 4,
CK_OBJECTCREATION_FLAGSMASK = 0x0000000F,
CK_OBJECTCREATION_DYNAMIC = 0x00000010,
CK_OBJECTCREATION_ACTIVATE = 0x00000020,
CK_OBJECTCREATION_NONAMECOPY = 0x00000040
}

Specify the way an object is created through CKCreateObject.

Members

CK_OBJECTCREATION_ACTIVATE | The object will be copied/created active
CK_OBJECTCREATION_ASK | If a duplicate name if found, opens a dialog box to ask the useror use automatic load mode if any.
CK_OBJECTCREATION_DYNAMIC | The object must be created dynamic
CK_OBJECTCREATION_FLAGSMASK | Mask for previous values
CK_OBJECTCREATION_NONAMECHECK | Do not test for name unicity (may be overriden in special case)
CK_OBJECTCREATION_NONAMECOPY | The object will take control of the string given to it directly, without copying it
CK_OBJECTCREATION_RENAME | Rename the created object to ensure its uniqueness
CK_OBJECTCREATION_REPLACE | Replace the current object by the object being loaded
CK_OBJECTCREATION_USECURRENT | Do not create a new object, use the one with the same name instead

Remarks

These flag controls the way an object is created, the most important of these flags being CK_OBJECTCREATION_DYNAMIC which, if set in CKCreateObject, make the newly created object dynamic.

See Also

CKContext::CreateObject,Dynamic Objects


CK_PARAMETERTYPE_FLAGS

Enumerated Type CK_PARAMETERTYPE_FLAGS

enum CK_PARAMETERTYPE_FLAGS {
CKPARAMETERTYPE_VARIABLESIZE = 0x00000001,
CKPARAMETERTYPE_RESERVED = 0x00000002,
CKPARAMETERTYPE_HIDDEN = 0x00000004,
CKPARAMETERTYPE_FLAGS = 0x00000008,
CKPARAMETERTYPE_STRUCT = 0x00000010,
CKPARAMETERTYPE_ENUMS = 0x00000020,
CKPARAMETERTYPE_USER = 0x00000040,
CKPARAMETERTYPE_NOENDIANCONV = 0x00000080,
CKPARAMETERTYPE_TOSAVE = 0x00000100,
}

Flags settings for new parameter types

Members

CKPARAMETERTYPE_ENUMS | This parameter type is an enumeration (See CKParameterManager::RegisterNewEnum)
CKPARAMETERTYPE_FLAGS | This parameter type is a flag (See CKParameterManager::RegisterNewFlags)
CKPARAMETERTYPE_HIDDEN | This parameter type should not be shown in the interface
CKPARAMETERTYPE_NOENDIANCONV | Do not try to convert this parameter buffer On Big-Endian processors (strings, void buffer have this flags)
CKPARAMETERTYPE_RESERVED | Reserved
CKPARAMETERTYPE_STRUCT | This parameter type is a structure of parameters (See CKParameterManager::RegisterNewStructure)
CKPARAMETERTYPE_TOSAVE | Temporary flag set in CKFile::EndSave(). This parameter type is to be saved in the SaveData callback of managers. Used in Parameter Manager (used user's flags & enums)
CKPARAMETERTYPE_USER | This parameter type is a user-defined one created in the interface
CKPARAMETERTYPE_VARIABLESIZE | Size of the buffer stored by the parameter may change

Remarks

+These flags specify special settings for a parameter type. +Parameter may have a fixed or variable buffer size, some may be hidden so that they are not displayed in the interface.

See Also

CKParameterTypeDesc


CK_PATCH_FLAGS

Enumerated Type CK_PATCH_FLAGS

enum CK_PATCH_FLAGS {
CK_PATCH_TRI =3,
CK_PATCH_QUAD =4,
}

Type of a patch (Triangle or Quad).

Members

CK_PATCH_QUAD | Quad Patch.
CK_PATCH_TRI | Triangle Patch.

See Also

CKPatch,CKPatchMesh


CK_PATHMANAGER_CATEGORY

Enumerated Type CK_PATHMANAGER_CATEGORY

enum CK_PATHMANAGER_CATEGORY {
BITMAP_PATH_IDX =0,
DATA_PATH_IDX =1,
SOUND_PATH_IDX =2
}

Enumeration of pre-registred path categories

Members

BITMAP_PATH_IDX | Category index for bitmaps paths
DATA_PATH_IDX | Category index for datas paths
SOUND_PATH_IDX | Category index for sounds paths

Remarks

The path manager pre-registers 3 categories of path (sound,bitmap and misc. data).

See Also

CKPathManager


CK_PLUGIN_TYPE

Enumerated Type CK_PLUGIN_TYPE

enum CK_PLUGIN_TYPE {
CKPLUGIN_BITMAP_READER = 0,
CKPLUGIN_SOUND_READER = 1,
CKPLUGIN_MODEL_READER = 2,
CKPLUGIN_MANAGER_DLL = 3,
CKPLUGIN_BEHAVIOR_DLL = 4,
CKPLUGIN_RENDERENGINE_DLL = 5,
CKPLUGIN_MOVIE_READER = 6,
CKPLUGIN_EXTENSION_DLL = 7,
}
#define CKPLUGIN_BITMAP "Bitmap Readers"
#define CKPLUGIN_SOUND "Sound Readers"
#define CKPLUGIN_MODEL "Model Readers"
#define CKPLUGIN_MANAGER "Managers"
#define CKPLUGIN_BEHAVIOR "BuildingBlocks"
#define CKPLUGIN_RENDERENGINE "Render Engines"
#define CKPLUGIN_MOVIE "Movie Readers"
#define CKPLUGIN_EXTENSIONS "Extensions"

Type identifier for a Virtools plugin.

Members

CKPLUGIN_BEHAVIOR_DLL | The plugin implements one or more behaviors
CKPLUGIN_BITMAP_READER | The plugin is bitmap (textures,sprites) loader
CKPLUGIN_EXTENSION_DLL | Generic extension (definition of new parameter types or operations for ex.)
CKPLUGIN_MANAGER_DLL | The plugin implements a Manager
CKPLUGIN_MODEL_READER | 3D Model Reader
CKPLUGIN_MOVIE_READER | Movie (AVI,Mpeg) reader
CKPLUGIN_RENDERENGINE_DLL | Render Engine plugin
CKPLUGIN_SOUND_READER | Sound Reader Plugin

Remarks

+Each plugin must be given a type. +This enumeration is used to identify a specific catagory of plugin when using the CKPluginManager.

See Also

CKPluginManager,Creating New Plugins


CK_RAYINTERSECTION

Enumerated Type CK_RAYINTERSECTION

enum CK_RAYINTERSECTION {
CKRAYINTERSECTION_DEFAULT = 0x00000000,
CKRAYINTERSECTION_SEGMENT = 0x00000001,
CKRAYINTERSECTION_IGNOREALPHA = 0x00000002,
CKRAYINTERSECTION_FIRSTCONTACT = 0x00000004,
CKRAYINTERSECTION_IGNORECULLING = 0x00000008,
CKRAYINTERSECTION_IGNOREBOTHSIDED = 0x00000010
}

Options for the RayIntersection

Members

CKRAYINTERSECTION_DEFAULT | Default Behavior
CKRAYINTERSECTION_FIRSTCONTACT | The ray will stop at the first face touched, not the nearest
CKRAYINTERSECTION_IGNOREALPHA | The ray will ignore the pick threshold set in the textures
CKRAYINTERSECTION_IGNOREBOTHSIDED | The ray consider the face culling even if material's both sided flag is set to TRUE.
CKRAYINTERSECTION_IGNORECULLING | The ray will ignore whether a face is clockwise or counterclockwise, otherwise we use the material “both sided” to determine if culling should done.
CKRAYINTERSECTION_SEGMENT | The ray will be considered as a segment

See Also

CKCollisionManager,CKCollisionManager::DetectCollision


CK_RENDER_FLAGS

Enumerated Type CK_RENDER_FLAGS

enum CK_RENDER_FLAGS {
CK_RENDER_BACKGROUNDSPRITES = 0x00000001,
CK_RENDER_FOREGROUNDSPRITES = 0x00000002,
CK_RENDER_USECAMERARATIO = 0x00000008,
CK_RENDER_CLEARZ = 0x00000010,
CK_RENDER_CLEARBACK = 0x00000020,
CK_RENDER_CLEARSTENCIL = 0x00000040,
CK_RENDER_DOBACKTOFRONT = 0x00000080,

CK_RENDER_DEFAULTSETTINGS = 0x000000FF,

CK_RENDER_CLEARVIEWPORT = 0x00000100,
CK_RENDER_WAITVBL = 0x00000200,
CK_RENDER_SKIPDRAWSCENE = 0x00000400,
CK_RENDER_DONOTUPDATEEXTENTS = 0x00000800,
CK_RENDER_SKIP3D = 0x00001000,
CK_RENDER_SKIPTRANSPARENT = 0x00002000,
CK_RENDER_OPTIONSMASK = 0x0000FFFF,

CK_RENDER_PLAYERCONTEXT = 0x00010000,
CK_RENDER_RESTORENEXTFRAME = 0x00020000,

CK_RENDER_HINTRENDERATTRIBTEX = 0x00040000,

CK_RENDER_USECURRENTSETTINGS = 0x00000000
}

Render options

Members

CK_RENDER_BACKGROUNDSPRITES | Background sprites are to be rendered
CK_RENDER_CLEARBACK | Clear Back Buffer
CK_RENDER_CLEARSTENCIL | Clear Stencil Buffer
CK_RENDER_CLEARVIEWPORT | Do not clear entire device, only viewport
CK_RENDER_CLEARZ | Clear ZBuffer
CK_RENDER_DEFAULTSETTINGS | Default render context settings
CK_RENDER_DOBACKTOFRONT | Swap buffers
CK_RENDER_DONOTUPDATEEXTENTS | Do not update object extents
CK_RENDER_FOREGROUNDSPRITES | Foreground sprites are to be rendered
CK_RENDER_HINTRENDERATTRIBTEX | An attribute texture render is current (z-texture, position of fragments for deferred shading etc): BBs such as “Shadow Stencil” should not render themselves
CK_RENDER_OPTIONSMASK | All rendering flags
CK_RENDER_PLAYERCONTEXT | Use by behaviors to know render contextes on which they should act.
CK_RENDER_RESTORENEXTFRAME | Restores the clear flags and skipt draw scene next frame, and removes itself.
CK_RENDER_SKIP3D | Do not draw 3D objects (nor device callbacks)
CK_RENDER_SKIPDRAWSCENE | Do not draw scene ( Both 3D and 2D objects)
CK_RENDER_SKIPTRANSPARENT | Do not draw transparent objects
CK_RENDER_USECAMERARATIO | Render Context size is automatically set using current camera aspect ratio and window size.
CK_RENDER_USECURRENTSETTINGS | When calling CKRenderContext::Render,CKRenderContext::DrawScene,CKRenderContext::Clear and CKRenderContext::BackToFront use this flag to use default options specified in SetCurrentRenderOptions
CK_RENDER_WAITVBL | Wait for Vertical Blank before blitting

Remarks

This flags specifies different render options when drawing the scenes.

See Also

CKRenderContext::ModifyCurrentRenderOptions,CKRenderContext::Render,CKRenderContext::DrawScene,CKRenderContext::Clear,CKRenderContext::BackToFront


CK_SCENEOBJECT_FLAGS

Enumerated Type CK_SCENEOBJECT_FLAGS

enum CK_SCENEOBJECT_FLAGS {
CK_SCENEOBJECT_START_ACTIVATE = 0x0001,
CK_SCENEOBJECT_ACTIVE = 0x0008,
CK_SCENEOBJECT_START_DEACTIVATE = 0x0010,
CK_SCENEOBJECT_START_LEAVE = 0x0020,
CK_SCENEOBJECT_START_RESET = 0x0040,
CK_SCENEOBJECT_INTERNAL_IC = 0x0080,
}

Flags describing state of an object in a scene.

Members

CK_SCENEOBJECT_ACTIVE | The object or script is currently active (behaviors will be executed)
CK_SCENEOBJECT_START_ACTIVATE | The object or script is activated when the scene starts (Default)
CK_SCENEOBJECT_START_DEACTIVATE | The object or script is deactivated when the scene starts
CK_SCENEOBJECT_START_LEAVE | The object or script stay in their current state when the scene starts
CK_SCENEOBJECT_START_RESET | Objects : Reset their initial conditions if any, Scripts : Re-initialize script.( Default)

Remarks

Objects present in a CKScene use these flags to describe their state in the scene. Objects may be hidden or have an initial state forced to a specific value.

See Also

CKScene::SetObjectFlags,CKScene::ModifyObjectFlags


CK_SCENEOBJECTACTIVITY_FLAGS

Enumerated Type CK_SCENEOBJECTACTIVITY_FLAGS

enum CK_SCENEOBJECTACTIVITY_FLAGS {
CK_SCENEOBJECTACTIVITY_SCENEDEFAULT = 0x00000000,
CK_SCENEOBJECTACTIVITY_ACTIVATE = 0x00000001,
CK_SCENEOBJECTACTIVITY_DEACTIVATE = 0x00000002,
CK_SCENEOBJECTACTIVITY_DONOTHING = 0x00000003,
}

Flags overriding activity flags of objects and scripts in a scene.

Members

CK_SCENEOBJECTACTIVITY_ACTIVATE | The objects and scripts will be activated
CK_SCENEOBJECTACTIVITY_DEACTIVATE | The objects and scripts will be deactivated
CK_SCENEOBJECTACTIVITY_DONOTHING | The objects and scripts stay in their current state (whether active or not)
CK_SCENEOBJECTACTIVITY_SCENEDEFAULT | The object or script will be activated according to its CK_SCENEOBJECT_FLAGS in the scene

Remarks

When launching a scene objects and scripts are activated according to their scene flags (CK_SCENEOBJECT_FLAGS). You can override this flags when launching a scene by specifying to force activation for example using CK_SCENEOBJECTACTIVITY_ACTIVATE.

See Also

CKLevel::LaunchScene


CK_SCENEOBJECTRESET_FLAGS

Enumerated Type CK_SCENEOBJECTRESET_FLAGS

enum CK_SCENEOBJECTRESET_FLAGS {
CK_SCENEOBJECTRESET_SCENEDEFAULT = 0x00000000,
CK_SCENEOBJECTRESET_RESET = 0x00000001,
CK_SCENEOBJECTRESET_DONOTHING = 0x00000002,
}

Flags overriding reset flag of objects and scripts in a scene.

Members

CK_SCENEOBJECTRESET_DONOTHING | The objects and scripts stay in their current state
CK_SCENEOBJECTRESET_RESET | Force objects to reset their initial conditions (if any) and scripts to be reset.
CK_SCENEOBJECTRESET_SCENEDEFAULT | The object or script will be reset according to its CK_SCENEOBJECT_FLAGS in the scene

Remarks

When launching a scene objects and scripts are reset according to their scene flags (CK_SCENEOBJECT_FLAGS). You can override this flags when launching a scene by specifying to force objects not to return to their initial conditions for example using CK_SCENEOBJECTRESET_DONOTHING.

See Also

CKLevel::LaunchScene,


CK_SECONDARYANIMATION_FLAGS

Enumerated Type CK_SECONDARYANIMATION_FLAGS

enum CK_SECONDARYANIMATION_FLAGS {
CKSECONDARYANIMATION_ONESHOT= 0x00000004,
CKSECONDARYANIMATION_LOOP= 0x00000008,
CKSECONDARYANIMATION_LASTFRAME= 0x00000020,
CKSECONDARYANIMATION_LOOPNTIMES= 0x00000040,
CKSECONDARYANIMATION_DOWARP= 0x00000080,

CKSECONDARYANIMATION_FROMANIMATION=0x00000100,
}

Flags settings for secondary animations

Members

CKSECONDARYANIMATION_DOWARP | Creates a transition when starting or stopping a animation
CKSECONDARYANIMATION_FROMANIMATION | Uses settings specified in CKAnimation::SetSecondaryAnimationMode
CKSECONDARYANIMATION_LASTFRAME | Animation will stay on last frame
CKSECONDARYANIMATION_LOOP | Animation will be played continously
CKSECONDARYANIMATION_LOOPNTIMES | Animation will be played continously for N loop (specified in CKCharacter::PlaySecondaryAnimation)
CKSECONDARYANIMATION_ONESHOT | Animation will be played once

Remarks

+These flags specify play options for secondary animations on a character. +They be given when playing a secondary animation in CKCharacter::PlaySecondaryAnimation or set once on the animation using CKAnimation::SetSecondaryAnimationMode.

See Also

CKAnimation, CKCharacter::PlaySecondaryAnimation,CKAnimation::SetSecondaryAnimationMode


CK_SOUND_SAVEOPTIONS

Enumerated Type CK_SOUND_SAVEOPTIONS

enum CK_SOUND_SAVEOPTIONS
{
CKSOUND_EXTERNAL =0,
CKSOUND_INCLUDEORIGINALFILE =1,
CKSOUND_USEGLOBAL =2,
}

Specify the way sounds will be saved

Members

CKSOUND_EXTERNAL | Store only the file name for the sound. The sound file must be present in one of the sound paths when the composition is loaded.
CKSOUND_INCLUDEORIGINALFILE | Insert original sound file inside the CMO file. The sound file that was used originally will be append to the composition file and extracted when the file is loaded.
CKSOUND_USEGLOBAL | Use Global settings. This flag is only valid for the CKSound::SetSaveOptions method.

Remarks

Sounds can kept as references to external files or the original sound file can be appended to the composition file. These options can be used for a specific sound or as a global setting.

See Also

CKSound::SetSaveOptions,CKContext::SetGlobalSoundSaveOptions


CK_SOUNDMANAGER_CAPS

Enumerated Type CK_SOUNDMANAGER_CAPS

enum CK_SOUNDMANAGER_CAPS {
CK_SOUNDMANAGER_ONFLYTYPE = 0x00000001,
CK_SOUNDMANAGER_OCCLUSION = 0x00000002,
CK_SOUNDMANAGER_REFLECTION = 0x00000004,
CK_SOUNDMANAGER_ALL = 0x00000007,

CK_WAVESOUND_SETTINGS_GAIN = 0x00000010,
CK_WAVESOUND_SETTINGS_EQUALIZATION = 0x00000020,
CK_WAVESOUND_SETTINGS_PITCH = 0x00000040,
CK_WAVESOUND_SETTINGS_PRIORITY = 0x00000080,
CK_WAVESOUND_SETTINGS_PAN = 0x00000100,
CK_WAVESOUND_SETTINGS_ALL = 0x000001F0,

CK_WAVESOUND_3DSETTINGS_CONE = 0x00001000,
CK_WAVESOUND_3DSETTINGS_MINMAXDISTANCE = 0x00002000,
CK_WAVESOUND_3DSETTINGS_DISTANCEFACTOR = 0x00004000,
CK_WAVESOUND_3DSETTINGS_DOPPLERFACTOR = 0x00008000,
CK_WAVESOUND_3DSETTINGS_POSITION = 0x00010000,
CK_WAVESOUND_3DSETTINGS_VELOCITY = 0x00020000,
CK_WAVESOUND_3DSETTINGS_ORIENTATION = 0x00040000,
CK_WAVESOUND_3DSETTINGS_HEADRELATIVE = 0x00080000,
CK_WAVESOUND_3DSETTINGS_ALL = 0x000FF000,

CK_LISTENERSETTINGS_DISTANCE = 0x00100000,
CK_LISTENERSETTINGS_DOPPLER = 0x00200000,
CK_LISTENERSETTINGS_UNITS = 0x00400000,
CK_LISTENERSETTINGS_ROLLOFF = 0x00400000,
CK_LISTENERSETTINGS_EQ = 0x00800000,
CK_LISTENERSETTINGS_GAIN = 0x01000000,
CK_LISTENERSETTINGS_PRIORITY = 0x02000000,
CK_LISTENERSETTINGS_SOFTWARESOURCES = 0x04000000,
CK_LISTENERSETTINGS_ALL = 0x07F00000,
}

Members

CK_LISTENERSETTINGS_ALL |
CK_LISTENERSETTINGS_DISTANCE |
CK_LISTENERSETTINGS_DOPPLER |
CK_LISTENERSETTINGS_EQ |
CK_LISTENERSETTINGS_GAIN |
CK_LISTENERSETTINGS_PRIORITY |
CK_LISTENERSETTINGS_ROLLOFF |
CK_LISTENERSETTINGS_SOFTWARESOURCES |
CK_LISTENERSETTINGS_UNITS |
CK_SOUNDMANAGER_ALL |
CK_SOUNDMANAGER_OCCLUSION | Allows occlusions
CK_SOUNDMANAGER_ONFLYTYPE | Allows on the fly type changement
CK_SOUNDMANAGER_REFLECTION | Allows reflections
CK_WAVESOUND_3DSETTINGS_ALL |
CK_WAVESOUND_3DSETTINGS_CONE |
CK_WAVESOUND_3DSETTINGS_DISTANCEFACTOR |
CK_WAVESOUND_3DSETTINGS_DOPPLERFACTOR |
CK_WAVESOUND_3DSETTINGS_HEADRELATIVE |
CK_WAVESOUND_3DSETTINGS_MINMAXDISTANCE |
CK_WAVESOUND_3DSETTINGS_ORIENTATION |
CK_WAVESOUND_3DSETTINGS_POSITION |
CK_WAVESOUND_3DSETTINGS_VELOCITY |
CK_WAVESOUND_SETTINGS_ALL |
CK_WAVESOUND_SETTINGS_EQUALIZATION |
CK_WAVESOUND_SETTINGS_GAIN |
CK_WAVESOUND_SETTINGS_PAN |
CK_WAVESOUND_SETTINGS_PITCH |
CK_WAVESOUND_SETTINGS_PRIORITY |


CK_SOUNDREADER_ERROR

Enumerated Type CK_SOUNDREADER_ERROR

enum CK_SOUNDREADER_ERROR {
CKSOUND_READER_OK = 0,
CKSOUND_READER_GENERICERR = -1,
CKSOUND_READER_EOF = -2,
CKSOUND_READER_NO_DATA_READY= -3
}

Members

CKSOUND_READER_EOF
CKSOUND_READER_GENERICERR
CKSOUND_READER_NO_DATA_READY
CKSOUND_READER_OK


CK_TEXTURE_SAVEOPTIONS

Enumerated Type CK_TEXTURE_SAVEOPTIONS

enum CK_TEXTURE_SAVEOPTIONS
{
CKTEXTURE_RAWDATA =0,
CKTEXTURE_EXTERNAL =1,
CKTEXTURE_IMAGEFORMAT =2,
CKTEXTURE_USEGLOBAL =3,
CKTEXTURE_INCLUDEORIGINALFILE =4,
}

Specify the way textures or sprites will be saved

Members

CKTEXTURE_EXTERNAL | Store only the file name for the texture. The bitmap file must be present in the bitmap paths when loading the composition.
CKTEXTURE_IMAGEFORMAT | Save using format specified. The bitmap data will be converted to the specified format by the correspondant bitmap plugin and saved inside file.
CKTEXTURE_INCLUDEORIGINALFILE | Insert original image file inside CMO file. The bitmap file that was used originally for the texture or sprite will be append to the composition file and extracted when the file is loaded.
CKTEXTURE_RAWDATA | Save raw data inside file. The bitmap is saved in a raw 32 bit per pixel format.
CKTEXTURE_USEGLOBAL | Use Global settings, that is the settings given with CKContext::SetGlobalImagesSaveOptions. (Not valid when using CKContext::SetImagesSaveOptions).

Remarks

Textures can be stored inside Virtools files or kept as references to external files. These options can be used for a specific texture (or sprite) or as a global setting.

See Also

CKBitmapData::SetSaveOptions,CKSprite::SetSaveOptions,CKContext::SetGlobalImagesSaveOptions


CK_VIDEO_AUTHOR_FLAGS

Enumerated Type CK_VIDEO_AUTHOR_FLAGS

enum CK_VIDEO_AUTHOR_FLAGS
{
CK_VIDEO_TYPEMASK = 0xF0000000,
CK_VIDEO_DISPLAYMASK = 0x0F000000,
CK_VIDEO_SAVEOPTIONMASK = 0x00F00000,
CK_VIDEO_AUTHORMASK = 0x000FFFFF,

CK_VIDEO_LOOP = 0x00000001,
CK_VIDEO_SOUND = 0x00000002,
CK_VIDEO_ASYNCLOAD = 0x00000004,
CK_VIDEO_TEXFILL = 0x00000008,
CK_VIDEO_TEXNONPOW2 = 0x00000010,
CK_VIDEO_TEXAUTOSIZE = 0x00000020,
CK_VIDEO_TEXAUTOFORMAT = 0x00000040,

CK_VIDEO_RESERVEDAFLAG0 = 0x00000080,
CK_VIDEO_RESERVEDAFLAG1 = 0x00000100,
CK_VIDEO_RESERVEDAFLAG2 = 0x00000200,
CK_VIDEO_RESERVEDAFLAG3 = 0x00000400,
CK_VIDEO_RESERVEDAFLAG4 = 0x00000800,

}

Current video flags.

Members

CK_VIDEO_ASYNCLOAD | Should the video be loaded asynchronously
CK_VIDEO_AUTHORMASK | Mask for other options defined here
CK_VIDEO_DISPLAYMASK | Mask for video display (CK_VIDEO_DISPLAY)
CK_VIDEO_LOOP | Should the video loop (need to be able to seek)
CK_VIDEO_RESERVEDAFLAG0 | Reserved for future use
CK_VIDEO_RESERVEDAFLAG1 | Reserved for future use
CK_VIDEO_RESERVEDAFLAG2 | Reserved for future use
CK_VIDEO_RESERVEDAFLAG3 | Reserved for future use
CK_VIDEO_RESERVEDAFLAG4 | Reserved for future use
CK_VIDEO_SAVEOPTIONMASK | Mask for saving options (CK_VIDEO_SAVEOPTION)
CK_VIDEO_SOUND | Should we play the video sound.
CK_VIDEO_TEXAUTOFORMAT | Should we change the texture format for best performance
CK_VIDEO_TEXAUTOSIZE | Not Implemented.
CK_VIDEO_TEXFILL | Should the video be resized to fill the texture
CK_VIDEO_TEXNONPOW2 | Should we change the texture size for best performance
CK_VIDEO_TYPEMASK | Mask for video type (CK_VIDEO_TYPE)

Remarks

Part of Video Flags Bit 1 is reserved for Type that is exclusive Bit 2 is reserved for Display that is exclusive Other flags are not exclusive


CK_VIDEO_DISPLAY

Enumerated Type CK_VIDEO_DISPLAY

enum CK_VIDEO_DISPLAY
{
CK_VIDEO_TEXTURE = 0x01000000,
CK_VIDEO_SCREEN = 0x02000000
}

On what support do we display the video ?

Members

CK_VIDEO_SCREEN | The video is displayed on the screen
CK_VIDEO_TEXTURE | The video is displayed on a texture

Remarks

+ Part of Video Flags

See Also

CKVideoManager, CKVideo


CK_VIDEO_ERRORS

Enumerated Type CK_VIDEO_ERRORS

enum CK_VIDEO_ERRORS
{
CK_VIDEOERR_GENERIC = 500,

CK_VIDEOERR_NOPLUGIN,
CK_VIDEOERR_PLUGINCAPS,
CK_VIDEOERR_VIDEOCAPS,
CK_VIDEOERR_TIMEOUT,

CK_VIDEOERR_INPUTTYPE,
CK_VIDEOERR_OUTPUTTYPE,
CK_VIDEOERR_MAXCOUNT,
CK_VIDEOERR_TEXTURE,
CK_VIDEOERR_TEXTURELOCK,
CK_VIDEOERR_SEEKTIME,
CK_VIDEOERR_INFO,

CK_VIDEOERR_STATE,
CK_VIDEOERR_PREVIEWSTATE,
CK_VIDEOERR_LOADED,
CK_VIDEOERR_LOADING,
CK_VIDEOERR_NOTLOADED,
CK_VIDEOERR_UNLOADING,
CK_VIDEOERR_TEXTUREUSED,
CK_VIDEOERR_PROTOCOL,

CK_VIDEOERR_RESERVED0,
CK_VIDEOERR_RESERVED1,
CK_VIDEOERR_RESERVED2,
CK_VIDEOERR_RESERVED3,
CK_VIDEOERR_RESERVED4,
CK_VIDEOERR_RESERVED5,
CK_VIDEOERR_RESERVED6,
CK_VIDEOERR_RESERVED7,
CK_VIDEOERR_RESERVED8,
CK_VIDEOERR_RESERVED9,
CK_VIDEOERR_IMPSTART,

}

Video possible errors

Members

CK_VIDEOERR_GENERIC | Support video files
CK_VIDEOERR_IMPSTART | Error from here are implementation specific
CK_VIDEOERR_INFO | Video info are not valid.
CK_VIDEOERR_INPUTTYPE | Not supported by the current video input type
CK_VIDEOERR_LOADED | Not supported when the video is loaded
CK_VIDEOERR_LOADING | Not supported when the video is loading
CK_VIDEOERR_MAXCOUNT | The maximum number of playing videos has been reached. (1 for screen, no limit for texture one).
CK_VIDEOERR_NOPLUGIN | No video plugin available
CK_VIDEOERR_NOTLOADED | Not supported when the video is not loaded
CK_VIDEOERR_OUTPUTTYPE | Not supported by the current video output type
CK_VIDEOERR_PLUGINCAPS | Not supported by the current video engine
CK_VIDEOERR_PREVIEWSTATE | Not supported in the current preview state
CK_VIDEOERR_PROTOCOL | The stream protocol is unknown
CK_VIDEOERR_RESERVED0 | Reserved for future use
CK_VIDEOERR_RESERVED1 | Reserved for future use
CK_VIDEOERR_RESERVED2 | Reserved for future use
CK_VIDEOERR_RESERVED3 | Reserved for future use
CK_VIDEOERR_RESERVED4 | Reserved for future use
CK_VIDEOERR_RESERVED5 | Reserved for future use
CK_VIDEOERR_RESERVED6 | Reserved for future use
CK_VIDEOERR_RESERVED7 | Reserved for future use
CK_VIDEOERR_RESERVED8 | Reserved for future use
CK_VIDEOERR_RESERVED9 | Reserved for future use
CK_VIDEOERR_SEEKTIME | Seek times are not valid (>Duration)
CK_VIDEOERR_STATE | Not supported in the current video state
CK_VIDEOERR_TEXTURE | The target texture is invalid.
CK_VIDEOERR_TEXTURELOCK | A texture could not be locked (target or capture texture).
CK_VIDEOERR_TEXTUREUSED | The texture is already used
CK_VIDEOERR_TIMEOUT | The maximum wait time has been reached.
CK_VIDEOERR_UNLOADING | Not supported when the video is unloading
CK_VIDEOERR_VIDEOCAPS | Not supported by the current video (compression format...)

See Also

CKVideoManager, CKVideo


CK_VIDEO_EVENT

Enumerated Type CK_VIDEO_EVENT

enum CK_VIDEO_EVENT
{
CK_VIDEOEVENT_LOADED,
CK_VIDEOEVENT_UNLOADED,
CK_VIDEOEVENT_NEWIMAGE,
CK_VIDEOEVENT_PROCESSIMAGE,
CK_VIDEOEVENT_COUNT
}

Events that happens on a video

Members

CK_VIDEOEVENT_COUNT | Number of video events
CK_VIDEOEVENT_LOADED | Not Supported Yet - The video has just been loaded [EventData = NULL]
CK_VIDEOEVENT_NEWIMAGE | A new image is displayed [EventData = NULL]
CK_VIDEOEVENT_PROCESSIMAGE | A new image is displayed [EventData = VxImageDescEx*]
CK_VIDEOEVENT_UNLOADED | Not Supported Yet - The video has just unloaded [EventData = NULL]

Remarks

This events may called from a different thread than Virtools rendering thread. So, make sure to protect the objects you want to access in these callbacks.

See Also

CKVideoManager, CKVideo


CK_VIDEO_MANAGERSAVEOPTION

Enumerated Type CK_VIDEO_MANAGERSAVEOPTION

enum CK_VIDEO_MANAGERSAVEOPTION
{
CK_VIDEOSAVE_IDBYNAME = 0x00000001,
CK_VIDEOSAVE_IDBYINDEX = 0x00000002
}

Possible saving options for a video from the video manager.

Members

CK_VIDEOSAVE_IDBYINDEX | Save Live IDs by Index
CK_VIDEOSAVE_IDBYNAME | Save Live IDs by Name

See Also

CKVideoManager


CK_VIDEO_RUNTIME_FLAGS

Enumerated Type CK_VIDEO_RUNTIME_FLAGS

enum CK_VIDEO_RUNTIME_FLAGS
{
CK_VIDEO_STATEMASK = 0xFF000000,
CK_VIDEO_PREVIEWMASK = 0x00FF0000,
CK_VIDEO_RUNTIMEMASK = 0x0000FFFF,

CK_VIDEO_FINISHED = 0x00000001,
CK_VIDEO_CANSEEK = 0x00000002,
CK_VIDEO_CANSPEED = 0x00000004,
CK_VIDEO_CANSPEEDBACK = 0x00000008,
CK_VIDEO_CANLOOP = 0x00000010,
CK_VIDEO_HASSOUND = 0x00000020,
CK_VIDEO_TEXTUREREADY = 0x00000040,
CK_VIDEO_LOGOFF = 0x00000080,

CK_VIDEO_RESERVEDRFLAG0 = 0x00000100,
CK_VIDEO_RESERVEDRFLAG1 = 0x00000200,
CK_VIDEO_RESERVEDRFLAG2 = 0x00000400,
CK_VIDEO_RESERVEDRFLAG3 = 0x00000800,
CK_VIDEO_RESERVEDRFLAG4 = 0x00001000,
}

Video runtime flags. following flags.

Members

CK_VIDEO_CANLOOP

Can the video loop
CK_VIDEO_CANSEEK

Support video seeking
CK_VIDEO_CANSPEED

Support video speed change
CK_VIDEO_CANSPEEDBACK

Support video negative speed
CK_VIDEO_FINISHED

Video is finished and paused
CK_VIDEO_HASSOUND

Does the video has sound
CK_VIDEO_LOGOFF
Privat

Video logging is stopped
CK_VIDEO_PREVIEWMASK

Mask for preview state (CK_VIDEO_STATE)
CK_VIDEO_RESERVEDRFLAG0

Reserved for future use
CK_VIDEO_RESERVEDRFLAG1

Reserved for future use
CK_VIDEO_RESERVEDRFLAG2

Reserved for future use
CK_VIDEO_RESERVEDRFLAG3

Reserved for future use
CK_VIDEO_RESERVEDRFLAG4

Reserved for future use
CK_VIDEO_RUNTIMEMASK

Mask for other options defined here
CK_VIDEO_STATEMASK

Mask for source state (CK_VIDEO_STATE)
CK_VIDEO_TEXTUREREADY
Privat

Video texture is ready (initialized)

Remarks

Part of Runtime Flags Bit 1 & 2 are reserved for Video State that is exclusive Other flags are not exclusive Runtime flags other than state are updated by the source directly.


CK_VIDEO_SAVEOPTION

Enumerated Type CK_VIDEO_SAVEOPTION

enum CK_VIDEO_SAVEOPTION
{
CK_VIDEOSAVE_GLOBAL = 0x00100000,
CK_VIDEOSAVE_INTERNAL = 0x00200000,
CK_VIDEOSAVE_EXTERNAL = 0x00400000
}

Possible saving options

Members

CK_VIDEOSAVE_EXTERNAL | Don't save the video file, keep it external
CK_VIDEOSAVE_GLOBAL | Use global saving options
CK_VIDEOSAVE_INTERNAL | Save the video file within the .cmo

See Also

CKVideoManager


CK_VIDEO_STATE

Enumerated Type CK_VIDEO_STATE

enum CK_VIDEO_STATE
{
CK_VIDEO_INVALID = 0x01000000,
CK_VIDEO_LOADING = 0x02000000,
CK_VIDEO_UNLOADING = 0x04000000,
CK_VIDEO_PAUSED = 0x08000000,
CK_VIDEO_PLAYING = 0x10000000,
CK_VIDEO_STOPPED = 0x20000000
}

Current Video State

Members

CK_VIDEO_INVALID | Video source is invalid
CK_VIDEO_LOADING | Video source is currently loading
CK_VIDEO_PAUSED | Video is paused
CK_VIDEO_PLAYING | Video is playing
CK_VIDEO_STOPPED | Video is stopped
CK_VIDEO_UNLOADING | Video source is currently unloading

Remarks

+ Part of Runtime Flags

See Also

CKVideoManager, CKVideo


CK_VIDEO_TYPE

Enumerated Type CK_VIDEO_TYPE

enum CK_VIDEO_TYPE
{
CK_VIDEO_FILE = 0x10000000,
CK_VIDEO_LIVE = 0x20000000,
CK_VIDEO_STREAM = 0x40000000
}

Supported Video Types

Members

CK_VIDEO_FILE | The video is readed from a file
CK_VIDEO_LIVE | The video is readed from a live source
CK_VIDEO_STREAM | The video comes from an internet stream

Remarks

+ Part of Video Flags

See Also

CKVideoManager, CKVideo


CK_WAVESOUND_LOCKMODE

Enumerated Type CK_WAVESOUND_LOCKMODE

enum CK_WAVESOUND_LOCKMODE {
CK_WAVESOUND_LOCKFROMWRITE = 1,
CK_WAVESOUND_LOCKENTIREBUFFER = 2
}

Enums specifying lock mode

Members

CK_WAVESOUND_LOCKENTIREBUFFER | Ignores dwWriteCursor and dwNumBytes - locks the whole buffer
CK_WAVESOUND_LOCKFROMWRITE | Uses current cursor position and ignores dwWriteCursor

See Also

CKSoundManager::Lock


CK_WAVESOUND_STATE

Enumerated Type CK_WAVESOUND_STATE

enum CK_WAVESOUND_STATE {
CK_WAVESOUND_ALLTYPE = 0x00000007,
CK_WAVESOUND_LOOPED = 0x00000008,
CK_WAVESOUND_FADEIN = 0x00000020,
CK_WAVESOUND_FADEOUT = 0x00000040,
CK_WAVESOUND_FADE = 0x00000060,
CK_WAVESOUND_COULDBERESTARTED = 0x00000080,
CK_WAVESOUND_NODUPLICATE = 0x00000100,
CK_WAVESOUND_OCCLUSIONS = 0x00000200,
CK_WAVESOUND_1ST_REFLECTIONS = 0x00000400,
CK_WAVESOUND_MONO = 0x00000800,
CK_WAVESOUND_HASMOVED = 0x00001000,
CK_WAVESOUND_FILESTREAMED = 0x00002000,
CK_WAVESOUND_STREAMOVERLAP = 0x00004000,
CK_WAVESOUND_STREAMFULLYLOADED = 0x00008000,
CK_WAVESOUND_NEEDREWIND = 0x00010000,
CK_WAVESOUND_PAUSED = 0x00020000,

}

Flags specifying current state of a sound

Members

CK_WAVESOUND_1ST_REFLECTIONS | The sound can be reflected
CK_WAVESOUND_ALLTYPE | The vave type part of the state
CK_WAVESOUND_COULDBERESTARTED | The wave data could be restarted while playing
CK_WAVESOUND_FADE | The wave is in fade
CK_WAVESOUND_FADEIN | The wave is in fadein
CK_WAVESOUND_FADEOUT | The wave is in fadeout
CK_WAVESOUND_FILESTREAMED | The Sound is streamed from an external file
CK_WAVESOUND_HASMOVED | The sound must be updated
CK_WAVESOUND_LOOPED | The vave must loop
CK_WAVESOUND_MONO | The sound is in mono
CK_WAVESOUND_NEEDREWIND | The sound has reached the end and needs to be rewinded before next playback
CK_WAVESOUND_NODUPLICATE | The wave data could not be duplicated
CK_WAVESOUND_OCCLUSIONS | The sound can be occluded
CK_WAVESOUND_PAUSED | The sound has reached the end and needs to be rewinded before next playback
CK_WAVESOUND_STREAMFULLYLOADED | The streamed sound is small enough to be loaded entierly in the buffer (do not modify this flags, used internally)
CK_WAVESOUND_STREAMOVERLAP | The Streaming buffer is overlapping the current play position

See Also

CKSoundManager,CKWaveSound


CK_WAVESOUND_TYPE

Enumerated Type CK_WAVESOUND_TYPE

enum CK_WAVESOUND_TYPE {
CK_WAVESOUND_BACKGROUND = 1,
CK_WAVESOUND_POINT = 2,
CK_WAVESOUND_CONE = 3,
}

Enums specifying the type of a sound

Members

CK_WAVESOUND_BACKGROUND | The sound is in 2D
CK_WAVESOUND_CONE | The sound is a 3D Cone : NOT YET IMPLEMENTED
CK_WAVESOUND_POINT | The sound is in 3D

See Also

CKSoundManager::CreateSource


CKANIMATION_CONTROLLER

Enumerated Type CKANIMATION_CONTROLLER

enum CKANIMATION_CONTROLLER {
CKANIMATION_CONTROLLER_POS = 0x00000001,
CKANIMATION_CONTROLLER_ROT = 0x00000002,
CKANIMATION_CONTROLLER_SCL = 0x00000004,
CKANIMATION_CONTROLLER_SCLAXIS = 0x00000008,
CKANIMATION_CONTROLLER_MORPH = 0x00000010,
CKANIMATION_CONTROLLER_FLOAT = 0x00000020,
CKANIMATION_CONTROLLER_MASK = 0x000000FF,

CKANIMATION_LINFLOAT_CONTROL = 0x40856620,
CKANIMATION_LINPOS_CONTROL = 0x637c4301,
CKANIMATION_LINROT_CONTROL = 0x49ed4002,
CKANIMATION_LINSCL_CONTROL = 0x654a3a04,
CKANIMATION_LINSCLAXIS_CONTROL = 0x2f200b08,

CKANIMATION_TCBFLOAT_CONTROL = 0x5cb57a20,
CKANIMATION_TCBPOS_CONTROL = 0x347e4a01,
CKANIMATION_TCBROT_CONTROL = 0x45b52a02,
CKANIMATION_TCBSCL_CONTROL = 0x1b545904,
CKANIMATION_TCBSCLAXIS_CONTROL = 0x32595908,

CKANIMATION_BEZIERFLOAT_CONTROL = 0x5ed10220,
CKANIMATION_BEZIERPOS_CONTROL = 0x921ab801,
CKANIMATION_BEZIERSCL_CONTROL = 0x18ab4404,

CKANIMATION_MORPH_CONTROL = 0x73847810
}

List of availables animations controllers

Members

CKANIMATION_BEZIERFLOAT_CONTROL | Bezier Float Controller
CKANIMATION_BEZIERPOS_CONTROL | Bezier Position Controller
CKANIMATION_BEZIERSCL_CONTROL | Bezier Scale Controller
CKANIMATION_CONTROLLER_FLOAT | Base type mask for float controller (blend shapes)
CKANIMATION_CONTROLLER_MASK | Mask for all controller types
CKANIMATION_CONTROLLER_MORPH | Base type mask for morph controller
CKANIMATION_CONTROLLER_POS | Base type mask for position controllers
CKANIMATION_CONTROLLER_ROT | Base type mask for rotation controllers
CKANIMATION_CONTROLLER_SCL | Base type mask for scale controller
CKANIMATION_CONTROLLER_SCLAXIS | Base type mask for off-axis scale controller (Shear)
CKANIMATION_LINFLOAT_CONTROL | LinearFloat Controller
CKANIMATION_LINPOS_CONTROL | LinearPosition Controller
CKANIMATION_LINROT_CONTROL | Linear Rotation Controller
CKANIMATION_LINSCL_CONTROL | Linear Scale Controller
CKANIMATION_LINSCLAXIS_CONTROL | Linear Off-Axis Scale Controller (Shear)
CKANIMATION_MORPH_CONTROL | Morph Controller
CKANIMATION_TCBFLOAT_CONTROL | TCB Float Controller
CKANIMATION_TCBPOS_CONTROL | TCB Position Controller
CKANIMATION_TCBROT_CONTROL | TCB Rotation Controller
CKANIMATION_TCBSCL_CONTROL | TCB Scale Controller
CKANIMATION_TCBSCLAXIS_CONTROL | TCB Off-Axis Scale Controller (Shear)

Remarks

CKANIMATION_CONTROLLER contains the list of available animation controllers. It is used when creating or deleting a controller on a CKObjectAnimation.

When deleting a controller with CKObjectAnimation::DeleteController only the base type is used (CKANIMATION_CONTROLLER_MASK).

See Also

CKAnimController,CKObjectAnimation::CreateController,CKObjectAnimation::DeleteController


CKGRID_LAYER_FORMAT

Enumerated Type CKGRID_LAYER_FORMAT

enum CKGRID_LAYER_FORMAT{
CKGRID_LAYER_FORMAT_NORMAL = 0x00000000,
}

Enum defining the format of a Grid Layer

Members

CKGRID_LAYER_FORMAT_NORMAL

Free Orientation

See Also

CKGrid,CKLayer::GetFormat, CKLayer::SetFormat


CKMANAGER_FUNCTIONS

Enumerated Type CKMANAGER_FUNCTIONS

enum CKMANAGER_FUNCTIONS {
CKMANAGER_FUNC_OnSequenceToBeDeleted = 0x00000001,
CKMANAGER_FUNC_OnSequenceDeleted = 0x00000002,
CKMANAGER_FUNC_PreProcess = 0x00000004,
CKMANAGER_FUNC_PostProcess = 0x00000008,
CKMANAGER_FUNC_PreClearAll = 0x00000010,
CKMANAGER_FUNC_PostClearAll = 0x00000020,
CKMANAGER_FUNC_OnCKInit = 0x00000040,
CKMANAGER_FUNC_OnCKEnd = 0x00000080,
CKMANAGER_FUNC_OnCKPlay = 0x00000100,
CKMANAGER_FUNC_OnCKPause = 0x00000200,
CKMANAGER_FUNC_PreLoad = 0x00000400,
CKMANAGER_FUNC_PreSave = 0x00000800,
CKMANAGER_FUNC_PreLaunchScene = 0x00001000,
CKMANAGER_FUNC_PostLaunchScene = 0x00002000,
CKMANAGER_FUNC_OnCKReset = 0x00004000,
CKMANAGER_FUNC_PostLoad = 0x00008000,
CKMANAGER_FUNC_PostSave = 0x00010000,
CKMANAGER_FUNC_OnCKPostReset = 0x00020000,
CKMANAGER_FUNC_OnSequenceAddedToScene = 0x00040000,
CKMANAGER_FUNC_OnSequenceRemovedFromScene = 0x00080000,
CKMANAGER_FUNC_OnPreCopy = 0x00100000,
CKMANAGER_FUNC_OnPostCopy = 0x00200000,
CKMANAGER_FUNC_OnPreRender = 0x00400000,
CKMANAGER_FUNC_OnPostRender = 0x00800000,
CKMANAGER_FUNC_OnPostSpriteRender = 0x01000000,
CKMANAGER_FUNC_OnPreBackToFront = 0x02000000,
CKMANAGER_FUNC_OnPostBackToFront = 0x04000000,
CKMANAGER_FUNC_OnPreFullScreen = 0x08000000,
CKMANAGER_FUNC_OnPostFullScreen = 0x10000000,
CKMANAGER_FUNC_OnRasterizerEvent = 0x20000000,
CKMANAGER_FUNC_OnPreSpriteRender = 0x40000000
}

Mask for Base Manager overridable functions.

Members

CKMANAGER_FUNC_OnCKEnd | CKBaseManager::OnCKEnd
CKMANAGER_FUNC_OnCKInit | CKBaseManager::OnCKInit
CKMANAGER_FUNC_OnCKPause | CKBaseManager::OnCKPause
CKMANAGER_FUNC_OnCKPlay | CKBaseManager::OnCKPlay
CKMANAGER_FUNC_OnCKPostReset | CKBaseManager::OnCKPostReset
CKMANAGER_FUNC_OnCKReset | CKBaseManager::OnCKReset
CKMANAGER_FUNC_OnPostBackToFront | CKBaseManager::OnPostBackToFront
CKMANAGER_FUNC_OnPostCopy | CKBaseManager::OnPostCopy
CKMANAGER_FUNC_OnPostFullScreen | CKBaseManager::OnPostFullScreen
CKMANAGER_FUNC_OnPostRender | CKBaseManager::OnPostRender
CKMANAGER_FUNC_OnPostSpriteRender | CKBaseManager::OnPostSpriteRender
CKMANAGER_FUNC_OnPreBackToFront | CKBaseManager::OnPreBackToFront
CKMANAGER_FUNC_OnPreCopy | CKBaseManager::OnPreCopy
CKMANAGER_FUNC_OnPreFullScreen | CKBaseManager::OnPreFullScreen
CKMANAGER_FUNC_OnPreRender | CKBaseManager::OnPreRender
CKMANAGER_FUNC_OnPreSpriteRender | CKBaseManager::OnPreSpriteRender
CKMANAGER_FUNC_OnRasterizerEvent | CKBaseManager::OnRasterizerEvent
CKMANAGER_FUNC_OnSequenceAddedToScene | CKBaseManager::OnSequenceAddedToScene
CKMANAGER_FUNC_OnSequenceDeleted | CKBaseManager::OnSequenceDeleted
CKMANAGER_FUNC_OnSequenceRemovedFromScene | CKBaseManager::OnSequenceRemovedFromScene
CKMANAGER_FUNC_OnSequenceToBeDeleted | CKBaseManager::OnSequenceToBeDeleted
CKMANAGER_FUNC_PostClearAll | CKBaseManager::PostClearAll
CKMANAGER_FUNC_PostLaunchScene | CKBaseManager::PostLaunchScene
CKMANAGER_FUNC_PostLoad | CKBaseManager::PostLoad
CKMANAGER_FUNC_PostProcess | CKBaseManager::PostProcess
CKMANAGER_FUNC_PostSave | CKBaseManager::PostSave
CKMANAGER_FUNC_PreClearAll | CKBaseManager::PreClearAll
CKMANAGER_FUNC_PreLaunchScene | CKBaseManager::PreLaunchScene
CKMANAGER_FUNC_PreLoad | CKBaseManager::PreLoad
CKMANAGER_FUNC_PreProcess | CKBaseManager::PreProcess
CKMANAGER_FUNC_PreSave | CKBaseManager::PreSave

Remarks

When implementing a manager the CKBaseManager::GetValidFunctionsMask must be overriden to return a combination of these flag to indicate which methods are implemented.

See Also

CKBaseManager,CKBaseManager::GetValidFunctionsMask


CKSPRITETEXT_ALIGNMENT

Enumerated Type CKSPRITETEXT_ALIGNMENT

enum CKSPRITETEXT_ALIGNMENT {
CKSPRITETEXT_CENTER =0x00000001,
CKSPRITETEXT_LEFT =0x00000002,
CKSPRITETEXT_RIGHT =0x00000004,
CKSPRITETEXT_TOP =0x00000008,
CKSPRITETEXT_BOTTOM =0x00000010,
CKSPRITETEXT_VCENTER =0x00000020,
CKSPRITETEXT_HCENTER =0x00000040,
}

Sprite Text Alignment

Members

CKSPRITETEXT_BOTTOM | Text is aligned to the bottom of the sprite
CKSPRITETEXT_CENTER | Text is centered when written in the sprite
CKSPRITETEXT_HCENTER | Text is centered horizontaly when written in the sprite
CKSPRITETEXT_LEFT | Text is aligned to the left of the sprite
CKSPRITETEXT_RIGHT | Text is aligned to the right of the sprite
CKSPRITETEXT_TOP | Text is aligned to the top of the sprite
CKSPRITETEXT_VCENTER | Text is centered verticaly when written in the sprite

Remarks

Alignment attributes of the text in a CKSpriteText

See Also

CKSpriteText, CKSpriteText::SetAlign


Render Engine Enumerations

Render Engine related enumeration definitions

Enumerated Type CKLOCKFLAGS | CKVertexBuffer::Lock behavior flags.
Enumerated Type CKRST_DPFLAGS | Vertex format and draw primitive options.
Enumerated Type CKRST_EVENTS | Rasterizer Events .
Enumerated Type CKRST_TEXTURESTAGESTATETYPE | Texture rendering states.
Enumerated Type CKVB_STATE | CKVertexBuffer::Check return flags.
Driver Caps | Render driver capabilities enumerations
Enumerated Type VX_EFFECT | Material special effects
Enumerated Type VX_EFFECTCALLBACK_RETVAL | Effect callback return value
Enumerated Type VX_LOCKFLAGS | Lock Flags.
Enumerated Type VX_MOVEABLE_FLAGS | 3dEntity additionnal flags Options
Enumerated Type VXBLEND_MODE | Blending Mode options
Enumerated Type VxBpps | Bits per pixel constants
Enumerated Type VXBUFFER_TYPE | Video Buffer
Enumerated Type VXCHANNEL_FLAGS | Mesh additionnal material channel options
Enumerated Type VXCMPFUNC | Comparison Function
Enumerated Type VXCULL | Backface culling options
Class VxEffectDescription | Material special effects
Enumerated Type VXFILL_MODE | Fill Mode Options
Enumerated Type VXFOG_MODE | Fog Options
Enumerated Type VXLIGHT_TYPE | Light type.
Enumerated Type VXMESH_FLAGS | Mesh Flags Options
Enumerated Type VXMESH_LITMODE | Mesh lighting options
Enumerated Type VXPRIMITIVETYPE | Type of primitive (Triangle,strips,line,points,etc.) to draw.
Enumerated Type VXRENDERSTATETYPE | Rendering states.
Enumerated Type VXSHADE_MODE | Shade Mode Options
Enumerated Type VxShadeType | Global Shade Mode
Enumerated Type VXSPRITE3D_TYPE | Sprite3D Orientation Options
Enumerated Type VXSPRITE_RENDEROPTIONS | Sprite rendering options
Enumerated Type VXSPRITE_RENDEROPTIONS2 | Sprite rendering options
Enumerated Type VXSTENCILOP | Stencil Operations
Enumerated Type VXTEXTURE_ADDRESSMODE | Texture addressing modes.
Enumerated Type VXTEXTURE_BLENDMODE | Blend Mode Flags
Enumerated Type VXTEXTURE_FILTERMODE | Filter Mode Options
Enumerated Type VXTEXTURE_WRAPMODE | Wrapping Flags
Enumerated Type VXWRAP_MODE | Texture coordinates wrapping mode
Enumerated Type VXSHADOWMAP_FORMAT | Texture format used by shadow maps

See Also

Enumerations


CKLOCKFLAGS

Enumerated Type CKLOCKFLAGS

enum CKLOCKFLAGS {
CK_LOCK_DEFAULT = 0x00000000,
CK_LOCK_NOOVERWRITE = 0x00000001,
CK_LOCK_DISCARD = 0x00000002,
}

CKVertexBuffer::Lock behavior flags.

Members

CK_LOCK_DEFAULT | No assumption
CK_LOCK_DISCARD | No need for the previous memory
CK_LOCK_NOOVERWRITE | Write operation will not overwrite any vertex used in a pending drawing operation.

See Also

CKVertexBuffer::Lock


CKRST_DPFLAGS

Enumerated Type CKRST_DPFLAGS

enum CKRST_DPFLAGS
{
CKRST_DP_TRANSFORM = 0x00000001UL,
CKRST_DP_LIGHT = 0x00000002UL,
CKRST_DP_DOCLIP = 0x00000004UL,
CKRST_DP_DIFFUSE = 0x00000010UL,
#ifdef PSP
CKRST_DP_SPECULAR = 0x00000000UL,
CKRST_DP_TANSPACE = 0x00000000UL,
#else
CKRST_DP_SPECULAR = 0x00000020UL,
CKRST_DP_TANSPACE = 0x00000040UL,
#endif
CKRST_DP_STAGESMASK= 0x0001FE00UL,
CKRST_DP_STAGES0 = 0x00000200UL,
CKRST_DP_STAGES1 = 0x00000400UL,
CKRST_DP_STAGES2 = 0x00000800UL,
CKRST_DP_STAGES3 = 0x00001000UL,
CKRST_DP_STAGES4 = 0x00002000UL,
CKRST_DP_STAGES5 = 0x00004000UL,
CKRST_DP_STAGES6 = 0x00008000UL,
CKRST_DP_STAGES7 = 0x00010000UL,

CKRST_DP_WEIGHTMASK= 0x01F00000UL,
CKRST_DP_WEIGHTS1 = 0x00100000UL,
CKRST_DP_WEIGHTS2 = 0x00200000UL,
CKRST_DP_WEIGHTS3 = 0x00400000UL,
CKRST_DP_WEIGHTS4 = 0x00800000UL,
CKRST_DP_WEIGHTS5 = 0x01000000UL,
CKRST_DP_MATRIXPAL = 0x02000000UL,

CKRST_DP_VBUFFER = 0x10000000UL,
CKRST_DP_TRANSFORMW = 0x20000000UL,

CKRST_DP_TR_CL_VNT = 0x00000207UL,
CKRST_DP_TR_CL_VCST = 0x00000235UL,
CKRST_DP_TR_CL_VCT = 0x00000215UL,
CKRST_DP_TR_CL_VCS = 0x00000035UL,
CKRST_DP_TR_CL_VC = 0x00000015UL,
CKRST_DP_TR_CL_V = 0x00000005U,

CKRST_DP_CL_VCST = 0x00000234UL,
CKRST_DP_CL_VCT = 0x00000214UL,
CKRST_DP_CL_VC = 0x00000014UL,
CKRST_DP_CL_V = 0x00000004UL,

CKRST_DP_TR_VNT = 0x00000203UL,
CKRST_DP_TR_VCST = 0x00000231UL,
CKRST_DP_TR_VCT = 0x00000211UL,
CKRST_DP_TR_VCS = 0x00000031UL,
CKRST_DP_TR_VC = 0x00000011UL,
CKRST_DP_TR_V = 0x00000001UL,

CKRST_DP_V = 0x00000000UL,
CKRST_DP_VC = 0x00000010UL,
CKRST_DP_VCT = 0x00000210UL,
CKRST_DP_VCST = 0x00000230UL
}
#define CKRST_DP_WEIGHT(x) (x ? (CKRST_DP_WEIGHTS1 << (x-1)) : 0)
#define CKRST_DP_IWEIGHT(x) (x ? (CKRST_DP_MATRIXPAL|(CKRST_DP_WEIGHTS1 << (x-1))) : 0)
#define CKRST_DP_STAGE(i) (CKRST_DP_STAGES0 << i)
#define CKRST_DP_STAGEFLAGS(f) ((f & CKRST_DP_STAGESMASK) >> 9)
#define CKRST_MAX_STAGES 16

Vertex format and draw primitive options.

Members

CKRST_DP_CL_V | pre-transformed vertices (white).
CKRST_DP_CL_VC | pre-transformed vertices with diffuse color only.
CKRST_DP_CL_VCST | pre-transformed vertices with colors (diffuse+specular) and texture coords
CKRST_DP_CL_VCT | pre-transformed vertices with diffuse color and texture coords
CKRST_DP_DIFFUSE | Diffuse Color
CKRST_DP_DOCLIP | Perfom frustum clipping
CKRST_DP_LIGHT | Enable lighting and lit vertices if normals information is present.
CKRST_DP_MATRIXPAL | The last weight is a DWORD which contains the indices of matrix to which the weights are associated.
CKRST_DP_SPECULAR | Specular Color
CKRST_DP_STAGES0 | Texture coords up to Stage 0
CKRST_DP_STAGES1 | Texture coords up to Stage 1
CKRST_DP_STAGES2 | ...
CKRST_DP_STAGES3 | ...
CKRST_DP_STAGES4 | ...
CKRST_DP_STAGES5 | ...
CKRST_DP_STAGES6 | ...
CKRST_DP_STAGES7 | Texture coords up to Stage 7
CKRST_DP_STAGESMASK | Mask for texture coord sets
CKRST_DP_TANSPACE | Tangent Space info (2x 3dcoords)
CKRST_DP_TR_CL_V | non-transformed vertices (white).
CKRST_DP_TR_CL_VC | non-transformed vertices with diffuse color only.
CKRST_DP_TR_CL_VCS | non-transformed vertices with colors (diffuse+specular) and no-texture coords
CKRST_DP_TR_CL_VCST | non-transformed vertices with colors (diffuse+specular) and texture coords
CKRST_DP_TR_CL_VCT | non-transformed vertices with diffuse color only and texture coords
CKRST_DP_TR_CL_VNT | non-transformed vertices with normal and texture coords
CKRST_DP_TR_V | non-transformed vertices (white,No Clipping).
CKRST_DP_TR_VC | non-transformed vertices with colors (diffuse only) (No Clipping).
CKRST_DP_TR_VCS | non-transformed vertices with colors (diffuse+specular) and no-texture coords (No Clipping).
CKRST_DP_TR_VCST | non-transformed vertices with colors (diffuse+specular) and texture coords (No Clipping).
CKRST_DP_TR_VCT | non-transformed vertices with diffuse color only and texture coords (No Clipping).
CKRST_DP_TR_VNT | non-transformed vertices with normal and texture coords (No Clipping).
CKRST_DP_TRANSFORM | Transform vertices using the current transformations matrices (see CKRenderContext::SetWorldTransformationMatrix,..)
CKRST_DP_TRANSFORMW | Vertex format contains transformed and clipped (x, y, z, w). This constant is designed for, and can only be used with, the programmable vertex pipeline.
CKRST_DP_V | pre-transformed vertices (White,No Clipping).
CKRST_DP_VBUFFER | If a Vertex Buffer can be created, the returned structure should directly point to it.
CKRST_DP_VC | pre-transformed vertices with diffuse color only (No Clipping).
CKRST_DP_VCST | pre-transformed vertices with diffuse and specular color and texture coords only (No Clipping).
CKRST_DP_VCT | pre-transformed vertices with diffuse color and texture coords only (No Clipping).
CKRST_DP_WEIGHTMASK | Mask for texture coord sets
CKRST_DP_WEIGHTS1 | 1 Weight data is added to each vertex for HW vertex skinning or blending
CKRST_DP_WEIGHTS2 | 2 Weights data are added to each vertex for HW vertex skinning or blending
CKRST_DP_WEIGHTS3 | 3 Weights data are added to each vertex for HW vertex skinning or blending
CKRST_DP_WEIGHTS4 | 4 Weights data are added to each vertex for HW vertex skinning or blending
CKRST_DP_WEIGHTS5 | 5 Weights data are added to each vertex for HW vertex skinning or blending

Remarks

This enumeration is used to specify the format of vertex used when drawing a a primitive and the actions to perform.

It can also be used by the CKRenderContext::GetDrawPrimitiveStructure when asking to retrieve a pre-allocated VxDrawPrimitiveData structure. For example calling RenderContext->GetDrawPrimitiveStructure(CKRST_DP_TR_CL_VNT,20); returns a VxDrawPrimitiveData structure with a vertex count of 20. Normals and texture coordinates will be present and when drawing the vertices will be transformed,lit and clipped.

If the flags CKRST_DP_VBUFFER is set and the current context supports Vertex Buffers,the returned structure will point to a vertex buffer. It must be released before any rendering through the CKRenderContext::ReleaseCurrentVB method.

See Also

VxDrawPrimitiveData,CKRenderContext::DrawPrimitive,CKRenderContext::GetDrawPrimitiveStructure


CKRST_EVENTS

Enumerated Type CKRST_EVENTS

enum CKRST_EVENTS
{
CKRST_EVENT_CREATE = 0x00000001UL,
CKRST_EVENT_DESTROY = 0x00000002UL,
CKRST_EVENT_LOST = 0x00000003UL,
CKRST_EVENT_RESET = 0x00000004UL,
CKRST_EVENT_RESIZING= 0x00000008UL,
CKRST_EVENT_RESIZED = 0x00000010UL,
}

Rasterizer Events .

Members

CKRST_EVENT_CREATE | Rasterizer context (device) has just been created
CKRST_EVENT_DESTROY | Rasterizer context (device) is being destroyed
CKRST_EVENT_LOST | Device was lost
CKRST_EVENT_RESET | Device was reset
CKRST_EVENT_RESIZED | Device was resized
CKRST_EVENT_RESIZING | Device is about to be resized

Remarks

Rasterizer contexts used as render devices can be destroyed and recreated at runtime. According to implementation (DirectX , OpenGL,etc.) some events can occur such as LostDevice with DirectX that you might need to handle when directly using DirectX objects in a manager.

See Also

CKBaseManager::OnRasterizerEvent


CKRST_TEXTURESTAGESTATETYPE

Enumerated Type CKRST_TEXTURESTAGESTATETYPE

#define STAGEBLEND(Src,Dst) ((Src<<4)|Dst)
enum CKRST_TEXTURESTAGESTATETYPE {
CKRST_TSS_OP = 1UL,
CKRST_TSS_ARG1 = 2UL,
CKRST_TSS_ARG2 = 3UL,
CKRST_TSS_AOP = 4UL,
CKRST_TSS_AARG1 = 5UL,
CKRST_TSS_AARG2 = 6UL,
CKRST_TSS_BUMPENVMAT00 = 7UL,
CKRST_TSS_BUMPENVMAT01 = 8UL,
CKRST_TSS_BUMPENVMAT10 = 9UL,
CKRST_TSS_BUMPENVMAT11 = 10UL,
CKRST_TSS_TEXCOORDINDEX = 11UL,
CKRST_TSS_ADDRESS = 12UL,
CKRST_TSS_ADDRESSU = 13UL,
CKRST_TSS_ADDRESSV = 14UL,
CKRST_TSS_BORDERCOLOR = 15UL,
CKRST_TSS_MAGFILTER = 16UL,
CKRST_TSS_MINFILTER = 17UL,

CKRST_TSS_MIPMAPLODBIAS = 19UL,
CKRST_TSS_MAXMIPMLEVEL = 20UL,
CKRST_TSS_MAXANISOTROPY = 21UL,
CKRST_TSS_BUMPENVLSCALE = 22UL,
CKRST_TSS_BUMPENVLOFFSET = 23UL,

CKRST_TSS_TEXTURETRANSFORMFLAGS = 24UL,

CKRST_TSS_ADDRESW = 25UL,
CKRST_TSS_COLORARG0 = 26UL,
CKRST_TSS_ALPHAARG0 = 27UL,
CKRST_TSS_RESULTARG0 = 28UL,

CKRST_TSS_TEXTUREMAPBLEND = 39UL,
CKRST_TSS_STAGEBLEND = 40UL,
CKRST_TSS_MAXSTATE = 41UL
}

Texture rendering states.

Members

CKRST_TSS_AARG1 | CKRST_TEXTUREARG (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_AARG2 | CKRST_TEXTUREARG (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_ADDRESS | VXTEXTURE_ADDRESSMODE
CKRST_TSS_ADDRESSU | VXTEXTURE_ADDRESSMODE
CKRST_TSS_ADDRESSV | VXTEXTURE_ADDRESSMODE
CKRST_TSS_ADDRESW |
CKRST_TSS_ALPHAARG0 |
CKRST_TSS_AOP | CKRST_TEXTUREOP (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_ARG1 | CKRST_TEXTUREARG (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_ARG2 | CKRST_TEXTUREARG (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_BORDERCOLOR | DWORD RGBA
CKRST_TSS_BUMPENVLOFFSET | float
CKRST_TSS_BUMPENVLSCALE | float
CKRST_TSS_BUMPENVMAT00 | float *(DWORD *)&Value (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_BUMPENVMAT01 | float (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_BUMPENVMAT10 | float (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_BUMPENVMAT11 | float (Not yet supported on all implementations, Left for DirectX Usage Only)
CKRST_TSS_COLORARG0 |
CKRST_TSS_MAGFILTER | VXTEXTURE_FILTERMODE
CKRST_TSS_MAXANISOTROPY | float
CKRST_TSS_MAXMIPMLEVEL |
CKRST_TSS_MINFILTER | VXTEXTURE_FILTERMODE
CKRST_TSS_MIPMAPLODBIAS | float
CKRST_TSS_OP | CKRST_TEXTUREOP (Not yet supported on all implementations, left for DirectX7/8 OpenGL Usage Only)
CKRST_TSS_RESULTARG0 |
CKRST_TSS_STAGEBLEND | Use STAGEBLEND(SrcBlendMode,DstBlendMode) macro. This state is used to test if we can perform mono-pass multitexturing. For example to draw a texture with a shadow-map in mono-pass we will try to set the CKRST_TSS_STAGEBLEND state of the second stage (1) to STAGEBLEND(VXBLEND_DESTCOLOR,0) or STAGEBLEND(0,VXBLEND_SRCCOLOR) if the return value is OK (0) then we can render in mono-pass otherwise we will need to render in two passes.
CKRST_TSS_TEXCOORDINDEX | int (Not yet supported on all implementations, left for DirectX Usage Only)
CKRST_TSS_TEXTUREMAPBLEND | VXTEXTURE_BLENDMODE
CKRST_TSS_TEXTURETRANSFORMFLAGS | CKRST_TEXTURETRANSFORMFLAGS

Remarks

The texture render states defines the texture filtering,blending or address modes for the currently active texture. Each time a mesh,sprite3d or 2dEntity is drawn it automatically sets the appropriate render states for its rendering (See CKMaterial::SetAsCurrent).

See Also

CKRenderContext::SetTextureStageState, CKRenderContext::SetState


CKVB_STATE

Enumerated Type CKVB_STATE

enum CKVB_STATE {
CK_VB_OK = 0x00000000,
CK_VB_LOST = 0x00000001,
CK_VB_FAILED = 0x00000002,
}

CKVertexBuffer::Check return flags.

Members

CK_VB_FAILED | Vertex buffer can not be created with the given format or vertex count.
CK_VB_LOST | Vertex buffer content must be updated.
CK_VB_OK | Vertex buffer format and content are up to date.


Driver Caps

Render driver capabilities enumerations

Enumerated Type CKRST_2DCAPS | Supported 2D caps.
Enumerated Type CKRST_BLENDCAPS | Supported blending factors.
Enumerated Type CKRST_CMPCAPS | Supported comparison functions.
Enumerated Type CKRST_MISCCAPS | Miscellaneous capabilities
Enumerated Type CKRST_RASTERCAPS | Rasterization capabilities
Enumerated Type CKRST_SPECIFICCAPS | CKRasterizer specific caps
Enumerated Type CKRST_STENCILCAPS | Stencil operations supported
Enumerated Type CKRST_TADDRESSCAPS | Texture Addressing Capabilities
Enumerated Type CKRST_TEXTURECAPS | Texture Capabilities
Enumerated Type CKRST_TFILTERCAPS | Texture Filtering Capabilities
Enumerated Type CKRST_VTXCAPS | Supported vertex processing caps.

See Also

Render Engine Enumerations


CKRST_2DCAPS

Enumerated Type CKRST_2DCAPS

enum CKRST_2DCAPS {
CKRST_2DCAPS_WINDOWED =0x00000001UL,
CKRST_2DCAPS_3D =0x00000002UL,
CKRST_2DCAPS_GDI =0x00000004UL
}

Supported 2D caps.

Members

CKRST_2DCAPS_3D | Driver supports 3d acceleration
CKRST_2DCAPS_GDI | Driver shared with GDI
CKRST_2DCAPS_WINDOWED | Driver supports windowed rendering

See Also

VxDriverDesc,Vx2DCapsDesc,CKRenderManager::GetRenderDriverDescription


CKRST_BLENDCAPS

Enumerated Type CKRST_BLENDCAPS

enum CKRST_BLENDCAPS {
CKRST_BLENDCAPS_ZERO =0x00000001UL
,CKRST_BLENDCAPS_ONE =0x00000002UL
,CKRST_BLENDCAPS_SRCCOLOR =0x00000004UL
,CKRST_BLENDCAPS_INVSRCCOLOR =0x00000008UL
,CKRST_BLENDCAPS_SRCALPHA =0x00000010UL
,CKRST_BLENDCAPS_INVSRCALPHA =0x00000020UL
,CKRST_BLENDCAPS_DESTALPHA =0x00000040UL
,CKRST_BLENDCAPS_INVDESTALPHA =0x00000080UL
,CKRST_BLENDCAPS_DESTCOLOR =0x00000100UL
,CKRST_BLENDCAPS_INVDESTCOLOR =0x00000200UL
,CKRST_BLENDCAPS_SRCALPHASAT =0x00000400UL
,CKRST_BLENDCAPS_BOTHSRCALPHA =0x00000800UL
,CKRST_BLENDCAPS_BOTHINVSRCALPHA =0x00001000UL
}

Supported blending factors.

Members

CKRST_BLENDCAPS_BOTHINVSRCALPHA | Driver supports VXBLEND_BOTHINVSRCALPHA
CKRST_BLENDCAPS_BOTHSRCALPHA | Driver supports VXBLEND_BOTHSRCALPHA
CKRST_BLENDCAPS_DESTALPHA | Driver supports VXBLEND_DESTALPHA
CKRST_BLENDCAPS_DESTCOLOR | Driver supports VXBLEND_DESTCOLOR
CKRST_BLENDCAPS_INVDESTALPHA | Driver supports VXBLEND_INVDESTALPHA
CKRST_BLENDCAPS_INVDESTCOLOR | Driver supports VXBLEND_INVDESTCOLOR
CKRST_BLENDCAPS_INVSRCALPHA | Driver supports VXBLEND_INVSRCALPHA
CKRST_BLENDCAPS_INVSRCCOLOR | Driver supports VXBLEND_INVSRCCOLOR
CKRST_BLENDCAPS_ONE | Driver supports VXBLEND_ONE
CKRST_BLENDCAPS_SRCALPHA | Driver supports VXBLEND_SRCALPHA
CKRST_BLENDCAPS_SRCALPHASAT | Driver supports VXBLEND_SRCALPHASAT
CKRST_BLENDCAPS_SRCCOLOR | Driver supports VXBLEND_SRCCOLOR
CKRST_BLENDCAPS_ZERO | Driver supports VXBLEND_ZERO

Remarks

This enumeration gives the blending factors (VXBLEND_MODE) supported by a render driver.

See Also

VxDriverDesc,Vx3DCapsDesc,CKRenderManager::GetRenderDriverDescription,VXBLEND_MODE.


CKRST_CMPCAPS

Enumerated Type CKRST_CMPCAPS

enum CKRST_CMPCAPS {
CKRST_CMPCAPS_NEVER =0x00000001UL,
CKRST_CMPCAPS_LESS =0x00000002UL,
CKRST_CMPCAPS_EQUAL =0x00000004UL,
CKRST_CMPCAPS_LESSEQUAL =0x00000008UL,
CKRST_CMPCAPS_GREATER =0x00000010UL,
CKRST_CMPCAPS_NOTEQUAL =0x00000020UL,
CKRST_CMPCAPS_GREATEREQUAL =0x00000040UL,
CKRST_CMPCAPS_ALWAYS =0x00000080UL
}

Supported comparison functions.

Members

CKRST_CMPCAPS_ALWAYS | Driver supports VXCMP_ALWAYS
CKRST_CMPCAPS_EQUAL | Driver supports VXCMP_EQUAL
CKRST_CMPCAPS_GREATER | Driver supports VXCMP_GREATER
CKRST_CMPCAPS_GREATEREQUAL | Driver supports VXCMP_GREATEREQUAL
CKRST_CMPCAPS_LESS | Driver supports VXCMP_LESS
CKRST_CMPCAPS_LESSEQUAL | Driver supports VXCMP_LESSEQUAL
CKRST_CMPCAPS_NEVER | Driver supports VXCMP_NEVER
CKRST_CMPCAPS_NOTEQUAL | Driver supports VXCMP_NOTEQUAL

Remarks

This enumeration gives the comparison function (VXCMPFUNC) supported by a render driver.

See Also

VxDriverDesc,Vx3DCapsDesc,CKRenderManager::GetRenderDriverDescription,VXCMPFUNC


CKRST_MISCCAPS

Enumerated Type CKRST_MISCCAPS

enum CKRST_MISCCAPS {
CKRST_MISCCAPS_MASKZ =0x00000002UL,
CKRST_MISCCAPS_CONFORMANT =0x00000008UL,
CKRST_MISCCAPS_CULLNONE =0x00000010UL,
CKRST_MISCCAPS_CULLCW =0x00000020UL,
CKRST_MISCCAPS_CULLCCW =0x00000040UL
}

Miscellaneous capabilities

Members

CKRST_MISCCAPS_CONFORMANT | Driver is conformant to the OpenGL standard.
CKRST_MISCCAPS_CULLCCW | The driver supports counter clockwise triangle culling.
CKRST_MISCCAPS_CULLCW | The driver supports clockwise triangle culling.
CKRST_MISCCAPS_CULLNONE | no triangle culling
CKRST_MISCCAPS_MASKZ | Driver can enable and disable modification of the depth buffer (Zwrite Enable)

See Also

VxDriverDesc,Vx3DCapsDesc,CKRenderManager::GetRenderDriverDescription


CKRST_RASTERCAPS

Enumerated Type CKRST_RASTERCAPS

enum CKRST_RASTERCAPS {
CKRST_RASTERCAPS_DITHER =0x00000001UL,
CKRST_RASTERCAPS_ZTEST =0x00000010UL,
CKRST_RASTERCAPS_SUBPIXEL =0x00000060UL,
CKRST_RASTERCAPS_FOGVERTEX =0x00000080UL,
CKRST_RASTERCAPS_FOGPIXEL =0x00000100UL,
CKRST_RASTERCAPS_ZBIAS =0x00004000UL,
CKRST_RASTERCAPS_ZBUFFERLESSHSR =0x00008000UL,
CKRST_RASTERCAPS_FOGRANGE =0x00010000UL,
CKRST_RASTERCAPS_ANISOTROPY =0x00020000UL,
CKRST_RASTERCAPS_WBUFFER =0x00040000UL,
CKRST_RASTERCAPS_WFOG =0x00100000UL,
CKRST_RASTERCAPS_ZFOG =0x00200000UL,
}

Rasterization capabilities

Members

CKRST_RASTERCAPS_ANISOTROPY | Anisotropic filtering is supported
CKRST_RASTERCAPS_DITHER | Driver can perform dithering
CKRST_RASTERCAPS_FOGPIXEL | Per Pixel fog is supported
CKRST_RASTERCAPS_FOGRANGE | Support range based fog.
CKRST_RASTERCAPS_FOGVERTEX | Per vertex fog is supported
CKRST_RASTERCAPS_SUBPIXEL | Subpixel placement supported
CKRST_RASTERCAPS_WBUFFER | Depth buffering can be perfomed using w values (more precise).
CKRST_RASTERCAPS_WFOG | The device supports w-based pixel fog.
CKRST_RASTERCAPS_ZBIAS | Coplanar polygon can be rendered using a Z-bias to avoid Z-fight problems (VXRENDERSTATE_ZBIAS)
CKRST_RASTERCAPS_ZBUFFERLESSHSR | Hidden surface removal can be performed without a Z-buffer
CKRST_RASTERCAPS_ZFOG | The device supports z-based pixel fog.
CKRST_RASTERCAPS_ZTEST | Z-tests operations are supported

See Also

VxDriverDesc,Vx3DCapsDesc,CKRenderManager::GetRenderDriverDescription


CKRST_SPECIFICCAPS

Enumerated Type CKRST_SPECIFICCAPS

enum CKRST_SPECIFICCAPS {
CKRST_SPECIFICCAPS_SPRITEASTEXTURES =0x00000001UL,
CKRST_SPECIFICCAPS_CLAMPEDGEALPHA =0x00000002UL,
CKRST_SPECIFICCAPS_CANDOVERTEXBUFFER =0x00000004UL,
CKRST_SPECIFICCAPS_GLATTENUATIONMODEL =0x00000008UL,
CKRST_SPECIFICCAPS_SOFTWARE =0x00000010UL,
CKRST_SPECIFICCAPS_HARDWARE =0x00000020UL,
CKRST_SPECIFICCAPS_HARDWARETL =0x00000040UL,
CKRST_SPECIFICCAPS_COPYTEXTURE =0x00000080UL,

CKRST_SPECIFICCAPS_DX5 =0x00000100UL,
CKRST_SPECIFICCAPS_DX7 =0x00000200UL,
CKRST_SPECIFICCAPS_DX8 =0x00000400UL,
CKRST_SPECIFICCAPS_DX9 =0x00000800UL,

CKRST_SPECIFICCAPS_SUPPORTSHADERS =0x00001000UL,
CKRST_SPECIFICCAPS_POINTSPRITES =0x00002000UL,

CKRST_SPECIFICCAPS_VERTEXCOLORABGR =0x00004000UL,
CKRST_SPECIFICCAPS_BLENDTEXTEFFECT =0x00008000UL,

CKRST_SPECIFICCAPS_CANDOINDEXBUFFER =0x00010000UL,
CKRST_SPECIFICCAPS_HW_SKINNING =0x00020000UL,

CKRST_SPECIFICCAPS_AUTGENMIPMAP =0x00040000UL,

}

CKRasterizer specific caps

Members

CKRST_SPECIFICCAPS_AUTGENMIPMAP | Graphics card supports automatic mipmap generation
CKRST_SPECIFICCAPS_BLENDTEXTEFFECT | OGL implementation : if set, CK2_3D do BlendTexturesEffect (Texture Combine Effect)
CKRST_SPECIFICCAPS_CANDOINDEXBUFFER | Index buffers can be lock to be read or write
CKRST_SPECIFICCAPS_CANDOVERTEXBUFFER | Vertex buffer can be lock to be read or write
CKRST_SPECIFICCAPS_CLAMPEDGEALPHA | Texture border alpha needs to be set to zero for Texture clamping to work correctly (OpenGL implementation of clamping for ex.)
CKRST_SPECIFICCAPS_COPYTEXTURE | Can copy back buffer parts into a texture ? (GL..)
CKRST_SPECIFICCAPS_DX5 | DX 5 implementation (if Family == CKRST_DIRECTX)
CKRST_SPECIFICCAPS_DX7 | DX 7 implementation (if Family == CKRST_DIRECTX)
CKRST_SPECIFICCAPS_DX8 | DX 8.1 implementation (if Family == CKRST_DIRECTX)
CKRST_SPECIFICCAPS_DX9 | DX 9 implementation (if Family == CKRST_DIRECTX)
CKRST_SPECIFICCAPS_GLATTENUATIONMODEL | GL attenuation (or DX 7) light attenuation model
CKRST_SPECIFICCAPS_HARDWARE | Software transformations and lighting,hardware rasterization.
CKRST_SPECIFICCAPS_HARDWARETL | Hardware transformations,lighting and rasterization.
CKRST_SPECIFICCAPS_HW_SKINNING | Implementation can perform hardware accelerated skinning
CKRST_SPECIFICCAPS_POINTSPRITES | Point sprites are supported
CKRST_SPECIFICCAPS_SOFTWARE | Software transformations,lighting and rasterization.
CKRST_SPECIFICCAPS_SPRITEASTEXTURES | Sprites are rendered using textured primitives.
CKRST_SPECIFICCAPS_SUPPORTSHADERS | CKShaders are supported by this implementation
CKRST_SPECIFICCAPS_VERTEXCOLORABGR | OGL implementation : if set, CK2_3D will send colors of Vertex Buffers into the appropriate format

Remarks

This enumeration is used to know special implementation details of a given rasterizer.

See Also

VxDriverDesc,Vx3DCapsDesc,CKRenderManager::GetRenderDriverDescription


CKRST_STENCILCAPS

Enumerated Type CKRST_STENCILCAPS

enum CKRST_STENCILCAPS {
CKRST_STENCILCAPS_KEEP =0x00000001UL,
CKRST_STENCILCAPS_ZERO =0x00000002UL,
CKRST_STENCILCAPS_REPLACE =0x00000004UL,
CKRST_STENCILCAPS_INCRSAT =0x00000008UL,
CKRST_STENCILCAPS_DECRSAT =0x00000010UL,
CKRST_STENCILCAPS_INVERT =0x00000020UL,
CKRST_STENCILCAPS_INCR =0x00000040UL,
CKRST_STENCILCAPS_DECR =0x00000080UL
}

Stencil operations supported

Members

CKRST_STENCILCAPS_DECR | VXSTENCILOP_DECR operation is supported
CKRST_STENCILCAPS_DECRSAT | VXSTENCILOP_DECRSAT operation is supported
CKRST_STENCILCAPS_INCR | VXSTENCILOP_INCR operation is supported
CKRST_STENCILCAPS_INCRSAT | VXSTENCILOP_INCRSAT operation is supported
CKRST_STENCILCAPS_INVERT | VXSTENCILOP_INVERT operation is supported
CKRST_STENCILCAPS_KEEP | VXSTENCILOP_KEEP operation is supported
CKRST_STENCILCAPS_REPLACE | VXSTENCILOP_REPLACE operation is supported
CKRST_STENCILCAPS_ZERO | VXSTENCILOP_ZERO operation is supported

Remarks

This enumeration gives the stencil operations supported by a render driver.

See Also

VxDriverDesc,Vx3DCapsDesc,VXSTENCILOP,CKRenderManager::GetRenderDriverDescription


CKRST_TADDRESSCAPS

Enumerated Type CKRST_TADDRESSCAPS

enum CKRST_TADDRESSCAPS {
CKRST_TADDRESSCAPS_WRAP =0x00000001UL,
CKRST_TADDRESSCAPS_MIRROR =0x00000002UL,
CKRST_TADDRESSCAPS_CLAMP =0x00000004UL,
CKRST_TADDRESSCAPS_BORDER =0x00000008UL,
CKRST_TADDRESSCAPS_INDEPENDENTUV =0x00000010UL
}

Texture Addressing Capabilities

Members

CKRST_TADDRESSCAPS_BORDER | A border color can be used outside the [0..1] range
CKRST_TADDRESSCAPS_CLAMP | Texture clamping supported
CKRST_TADDRESSCAPS_INDEPENDENTUV | Address mode can be set separately on U and V components (see CKRST_TSS_ADDRESS,CKRST_TSS_ADDRESSU,CKRST_TSS_ADDRESSV)
CKRST_TADDRESSCAPS_MIRROR | Texture mirroring supported
CKRST_TADDRESSCAPS_WRAP | Texture wrapping supported

Remarks

This enumeration gives the texture addressing mode supported by a render driver.

See Also

VxDriverDesc,Vx3DCapsDesc,CKMaterial::SetTextureAddressMode,CKRenderManager::GetRenderDriverDescription


CKRST_TEXTURECAPS

Enumerated Type CKRST_TEXTURECAPS

enum CKRST_TEXTURECAPS {
CKRST_TEXTURECAPS_PERSPECTIVE =0x00000001UL
,CKRST_TEXTURECAPS_POW2 =0x00000002UL
,CKRST_TEXTURECAPS_ALPHA =0x00000004UL
,CKRST_TEXTURECAPS_SQUAREONLY =0x00000020UL
,CKRST_TEXTURECAPS_CONDITIONALNONPOW2 =0x00000100UL
,CKRST_TEXTURECAPS_PROJECTED =0x00000400UL
,CKRST_TEXTURECAPS_CUBEMAP =0x00000800UL
,CKRST_TEXTURECAPS_VOLUMEMAP =0x00002000UL
}

Texture Capabilities

Members

CKRST_TEXTURECAPS_ALPHA | Supports texture with alpha values with VXTEXTUREBLEND_DECAL and VXTEXTUREBLEND_MODULATE blending modes.
CKRST_TEXTURECAPS_CONDITIONALNONPOW2 | Device support conditionnal pow2 textures
CKRST_TEXTURECAPS_CUBEMAP | Device can do cube maps
CKRST_TEXTURECAPS_PERSPECTIVE | Perspective correction is supported
CKRST_TEXTURECAPS_POW2 | Texture size must be powers of 2
CKRST_TEXTURECAPS_PROJECTED | Device supports the CKRST_TTF_PROJECTED transform flags: If this capability is present, then the projective divide occurs per pixel
CKRST_TEXTURECAPS_SQUAREONLY | Textures must have the same witdh than height.
CKRST_TEXTURECAPS_VOLUMEMAP | Device can do volume maps.

Remarks

This enumeration gives the texture operation supported by a render driver.

See Also

VxDriverDesc,Vx3DCapsDesc,CKMaterial::PerspectiveCorrectionEnabled,CKMaterial::SetTextureBlendMode,CKRenderManager::GetRenderDriverDescription


CKRST_TFILTERCAPS

Enumerated Type CKRST_TFILTERCAPS

enum CKRST_TFILTERCAPS {
CKRST_TFILTERCAPS_NEAREST =0x00000001UL,
CKRST_TFILTERCAPS_LINEAR =0x00000002UL,
CKRST_TFILTERCAPS_MIPNEAREST =0x00000004UL,
CKRST_TFILTERCAPS_MIPLINEAR =0x00000008UL,
CKRST_TFILTERCAPS_LINEARMIPNEAREST =0x00000010UL,
CKRST_TFILTERCAPS_LINEARMIPLINEAR =0x00000020UL,
CKRST_TFILTERCAPS_ANISOTROPIC =0x00000400UL
}

Texture Filtering Capabilities

Members

CKRST_TFILTERCAPS_ANISOTROPIC | Anisotropic filtering supported
CKRST_TFILTERCAPS_LINEAR | Bilinear filtering supported
CKRST_TFILTERCAPS_LINEARMIPLINEAR | Trilinear filtering supported
CKRST_TFILTERCAPS_LINEARMIPNEAREST | Bilinear interpolation between mipmaps with point sampling
CKRST_TFILTERCAPS_MIPLINEAR | Mipmapping supported with bilinear filtering
CKRST_TFILTERCAPS_MIPNEAREST | Mipmapping supported with point sampling
CKRST_TFILTERCAPS_NEAREST | Point sampling supported

Remarks

This enumeration gives the supported filter mode supported by a render driver.

See Also

VxDriverDesc,Vx3DCapsDesc,CKMaterial::SetTextureMinMode,CKMaterial::SetTextureMagMode,CKRenderManager::GetRenderDriverDescription


CKRST_VTXCAPS

Enumerated Type CKRST_VTXCAPS

enum CKRST_VTXCAPS {
CKRST_VTXCAPS_TEXGEN =0x00000001UL,
CKRST_VTXCAPS_MATERIALSOURCE =0x00000002UL,
CKRST_VTXCAPS_VERTEXFOG =0x00000004UL,
CKRST_VTXCAPS_DIRECTIONALLIGHTS =0x00000008UL,
CKRST_VTXCAPS_POSITIONALLIGHTS =0x00000010UL,
CKRST_VTXCAPS_LOCALVIEWER =0x00000020UL
}

Supported vertex processing caps.

Members

CKRST_VTXCAPS_DIRECTIONALLIGHTS | Device supports directional lights.
CKRST_VTXCAPS_LOCALVIEWER | Device supports orthogonal specular highlights, enabled by setting the VXRENDERSTATE_LOCALVIEWER render state to FALSE.
CKRST_VTXCAPS_MATERIALSOURCE | Device supports selectable vertex color sources (material or vertex).
CKRST_VTXCAPS_POSITIONALLIGHTS | Device supports positional lights (including point lights and spotlights).
CKRST_VTXCAPS_TEXGEN | Device can generate texture coordinates.
CKRST_VTXCAPS_VERTEXFOG | Device supports vertex fog.

See Also

VxDriverDesc,Vx3DCapsDesc,CKRenderManager::GetRenderDriverDescription


VX_EFFECT

Enumerated Type VX_EFFECT

enum VX_EFFECT
{
VXEFFECT_NONE = 0UL,
VXEFFECT_TEXGEN = 1UL,
VXEFFECT_TEXGENREF = 2UL,
VXEFFECT_BUMPENV = 3UL,
VXEFFECT_DP3 = 4UL,
VXEFFECT_2TEXTURES = 5UL,
VXEFFECT_3TEXTURES = 6UL,
VXEFFECT_MASK = 0xFUL
}

Material special effects

Members

VXEFFECT_2TEXTURES | Blend 2 Textures
VXEFFECT_3TEXTURES | Blend 3 Textures
VXEFFECT_BUMPENV | Environment Bump Mapping
VXEFFECT_DP3 | Dot Product 3 bump mapping
VXEFFECT_MASK | Mask for all possible values.
VXEFFECT_NONE | No Effect
VXEFFECT_TEXGEN | Texture coordinate generation using current viewpoint as referential
VXEFFECT_TEXGENREF | texture generation generation with an optionnal referential

Remarks

  • Effects provide additionnal functionnalities to take advantage of graphic features such as bump mapping,cube maps etc...

  • When an effect is enabled on a material (CKMaterial::SetEffect) it may override the default settings of mesh channels or material blend options

  • New effects can be created by providing a callback function (see CKRenderManager::AddEffect)

  • This enumeration provides the list of hardcoded existing effects.

  • Most of this effect are heavily hardware and device (DX8,DX7,etc..) dependant

See Also

CKMaterial::SetEffect,CKMaterial::GetEffect,CKRenderManager::AddEffect


VX_EFFECTCALLBACK_RETVAL

Enumerated Type VX_EFFECTCALLBACK_RETVAL

enum VX_EFFECTCALLBACK_RETVAL
{
VXEFFECTRETVAL_SKIPNONE = 0UL,
VXEFFECTRETVAL_SKIPTEXMAT = 1UL,
VXEFFECTRETVAL_SKIPALLTEX = 2UL,
VXEFFECTRETVAL_SKIPALL = 0xFFFFFFFFUL,
}

Effect callback return value

Members

VXEFFECTRETVAL_SKIPALL | The Effect has set all the needed render states , no other processing should be done by the material
VXEFFECTRETVAL_SKIPALLTEX | Texture stages has been set by the callback , material must not set them
VXEFFECTRETVAL_SKIPNONE |
VXEFFECTRETVAL_SKIPTEXMAT | Texture matrix has been set by the callback , material must not set it

Remarks

  • Effects provide additionnal functionnalities to take advantage of graphic features such as bump mapping,cube maps etc...

  • When an effect is enabled on a material (CKMaterial::SetEffect) it may override the default settings of mesh channels or material blend options

  • New effects can be created by providing a callback function (see CKRenderManager::AddEffect)

  • The return value of the callback function determines which material settings should be set by the default function

See Also

CKMaterial::SetEffect,CKMaterial::GetEffect,CKRenderManager::AddEffect,VxEffectDescriptio


VX_LOCKFLAGS

Enumerated Type VX_LOCKFLAGS

enum VX_LOCKFLAGS {
VX_LOCK_DEFAULT = 0x00000000,
VX_LOCK_WRITEONLY = 0x00000001,
VX_LOCK_READONLY = 0x00000002,
VX_LOCK_DISCARD = 0x00000004,
}

Lock Flags.

Members

VX_LOCK_DEFAULT | No assumption
VX_LOCK_DISCARD | Write operation only , All current content can be discarded.
VX_LOCK_READONLY | Read operation only
VX_LOCK_WRITEONLY | Write operation only.

Remarks

When accessing a video memory surface, these flags should be used to warn the drivers of the intended operation (Write or Read Only)

See Also

CKTexture::LockVideoMemory,CKSprite::LockVideoMemory


VX_MOVEABLE_FLAGS

Enumerated Type VX_MOVEABLE_FLAGS

enum VX_MOVEABLE_FLAGS {
VX_MOVEABLE_PICKABLE =0x00000001,
VX_MOVEABLE_VISIBLE =0x00000002,
VX_MOVEABLE_UPTODATE =0x00000004,
VX_MOVEABLE_USERBOX =0x00000010,
VX_MOVEABLE_EXTENTSUPTODATE =0x00000020,
VX_MOVEABLE_BOXVALID =0x00004000,
VX_MOVEABLE_RENDERLAST =0x00010000,
VX_MOVEABLE_HASMOVED =0x00020000,
VX_MOVEABLE_WORLDALIGNED =0x00040000,
VX_MOVEABLE_NOZBUFFERWRITE =0x00080000,
VX_MOVEABLE_RENDERFIRST =0x00100000,
VX_MOVEABLE_NOZBUFFERTEST =0x00200000,
VX_MOVEABLE_INVERSEWORLDMATVALID =0x00400000,
VX_MOVEABLE_DONTUPDATEFROMPARENT =0x00800000,
VX_MOVEABLE_INDIRECTMATRIX =0x01000000,
VX_MOVEABLE_ZBUFONLY =0x02000000,
VX_MOVEABLE_STENCILONLY =0x04000000,
VX_MOVEABLE_HIERARCHICALHIDE =0x10000000,
VX_MOVEABLE_CHARACTERRENDERED =0x20000000,
VX_MOVEABLE_RESERVED2 =0x40000000,
}

3dEntity additionnal flags Options

Members

VX_MOVEABLE_BOXVALID | (Engine) If not set the moveable has no mesh associated so its bounding box is irrelevant (a point).
VX_MOVEABLE_CHARACTERRENDERED | (Engine) Set if a character was rendered last frame...
VX_MOVEABLE_DONTUPDATEFROMPARENT | (User) This object will not be updated by parent (neither World nor Local matrix wil be updated) . This flags can be used by physic engine for example in which hierarchy is not relevant for physicalised objects
VX_MOVEABLE_EXTENTSUPTODATE | (Engine) Indicate that object 2D extents are up to date
VX_MOVEABLE_HASMOVED | (Engine) Set when its position or orientation has changed. (Reset every frame when rendering starts)
VX_MOVEABLE_HIERARCHICALHIDE | (Engine) If Object has this flags and is hidden its children won't be rendered
VX_MOVEABLE_INDIRECTMATRIX | (User/Engine) Set by the engine at load time : The object matrix is in left hand referential, culling needs to be inverted
VX_MOVEABLE_INVERSEWORLDMATVALID | (Engine) Inverse world matrix is not up to date and should be recomputed
VX_MOVEABLE_NOZBUFFERTEST | (User) Set by the user to warn Render Engine that this object must not test against Z buffer (This override settings of all materials used by this Entity)
VX_MOVEABLE_NOZBUFFERWRITE | (User) Set by the user to warn Render Engine that this object must not write information to Z buffer
VX_MOVEABLE_PICKABLE | (User)If not set this entity cannot be returned by CKRenderContext::Pick() or CKRenderContext::RectPict() functions.
VX_MOVEABLE_RENDERFIRST | (User) If set the moveable will be rendered within the firsts objects
VX_MOVEABLE_RENDERLAST | (User) If set the moveable will be rendered with the transparent objects (i.e in last) (CK3dEntity::SetRenderAsTransparent)
VX_MOVEABLE_RESERVED2 | (Engine)
VX_MOVEABLE_STENCILONLY | (User) The object will only be rendered in stencil buffer
VX_MOVEABLE_UPTODATE | (Engine) Used to Notify change in the data of the entity.
VX_MOVEABLE_USERBOX | (Engine) When CK3dEntity::SetBoundingBox is called with a user box, this flag is set.
VX_MOVEABLE_VISIBLE | (Engine) See CKObject::Show,CK3dEntity::IsVisible
VX_MOVEABLE_WORLDALIGNED | (User) Hint for render engine : this object is aligned with world position and orientation.
VX_MOVEABLE_ZBUFONLY | (User) The object will only be rendered in depth buffer

Remarks

The VX_MOVEABLE_FLAGS is used by CK3dEntity::SetMoveableFlags to specify different hints to the render engine about the entity. The (Engine) flags are set by the render engine and should not be modified by user. They can be checked with the CK3dEntity::GetMoveableFlags method. The (User) flags are to be set by the user or can be set by a specific method of CK3dEntity.

See Also

CK3dEntity::SetMoveableFlags


VXBLEND_MODE

Enumerated Type VXBLEND_MODE

enum VXBLEND_MODE
{
VXBLEND_ZERO = 1UL,
VXBLEND_ONE = 2UL,
VXBLEND_SRCCOLOR = 3UL,
VXBLEND_INVSRCCOLOR = 4UL,
VXBLEND_SRCALPHA = 5UL,
VXBLEND_INVSRCALPHA = 6UL,
VXBLEND_DESTALPHA = 7UL,
VXBLEND_INVDESTALPHA = 8UL,
VXBLEND_DESTCOLOR = 9UL,
VXBLEND_INVDESTCOLOR = 10UL,
VXBLEND_SRCALPHASAT = 11UL,
VXBLEND_BOTHSRCALPHA = 12UL,
VXBLEND_BOTHINVSRCALPHA = 13UL,
VXBLEND_MASK = 0xFUL
}

Blending Mode options

Members

VXBLEND_BOTHINVSRCALPHA | Source blend factor is (1-As, 1-As, 1-As, 1-As) and destination blend factor is (As, As, As, As)
VXBLEND_BOTHSRCALPHA | Source blend factor is (As, As, As, As) and destination blend factor is (1-As, 1-As, 1-As, 1-As)
VXBLEND_DESTALPHA | Blend factor is (Ad, Ad, Ad, Ad).
VXBLEND_DESTCOLOR | Blend factor is (Rd, Gd, Bd, Ad).
VXBLEND_INVDESTALPHA | Blend factor is (1-Ad, 1-Ad, 1-Ad, 1-Ad).
VXBLEND_INVDESTCOLOR | Blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad).
VXBLEND_INVSRCALPHA | Blend factor is (1-As, 1-As, 1-As, 1-As).
VXBLEND_INVSRCCOLOR | Blend factor is (1-Rs, 1-Gs, 1-Bs, 1-As).
VXBLEND_MASK | Source blend factor is (1-As, 1-As, 1-As, 1-As) and destination blend factor is (As, As, As, As)
VXBLEND_ONE | Blend factor is (1, 1, 1, 1).
VXBLEND_SRCALPHA | Blend factor is (As, As, As, As).
VXBLEND_SRCALPHASAT | Blend factor is (f, f, f, 1); f = min(As, 1-Ad).
VXBLEND_SRCCOLOR | Blend factor is (Rs, Gs, Bs, As).
VXBLEND_ZERO | Blend factor is (0, 0, 0, 0).

Remarks

The VXBLEND_MODE is used by CKMaterial::SetSourceBlend() and SetDestBlend() to specify the blend factors that are used when blending is enabled. (Rs,Gs,Bs,As) are color components of the source pixel (being drawn) and (Rd,Gd,Bd,Ad) are color components of the destination pixel (current pixel on screen). When blending is enabled the final pixel will be equal to :

SrcBlendFactor * SrcPixel + DstBlendFactor * CurrentPixelOnScreen

Also used as value for VXRENDERSTATE_SRCBLEND and VXRENDERSTATE_DESTBLEND render state.

See Also

CKMaterial,CKTexture,CKMaterial::SetSourceBlend,CKMaterial::SetDestBlend,CKRenderContext::SetState,CKSprite::SetBlending,VXRENDERSTATE_SRCBLEND,VXRENDERSTATE_DESTBLEND


VxBpps

Enumerated Type VxBpps

enum VxBpps {
VX_BPP1 = 0x00004000UL,
VX_BPP2 = 0x00002000UL,
VX_BPP4 = 0x00001000UL,
VX_BPP8 = 0x00000800UL,
VX_BPP16 = 0x00000400UL,
VX_BPP24 = 0x00000200UL,
VX_BPP32 = 0x00000100UL,
}

Bits per pixel constants

Members

VX_BPP1 | 1 bit per pixel
VX_BPP16 | 16 bits per pixel
VX_BPP2 | 2 bits per pixel
VX_BPP24 | 24 bits per pixel
VX_BPP32 | 32 bits per pixel
VX_BPP4 | 4 bits per pixel
VX_BPP8 | 8 bits per pixel

Remarks

This enumeration is used to return the available Bit per pixel modes for a particular type of buffer (Depth,Color or Stencil).

See Also

Vx3DCapsDesc


VXBUFFER_TYPE

Enumerated Type VXBUFFER_TYPE

enum VXBUFFER_TYPE
{
VXBUFFER_BACKBUFFER = 0x00000001UL,
VXBUFFER_ZBUFFER = 0x00000002UL,
VXBUFFER_STENCILBUFFER = 0x00000004UL
}

Video Buffer

Members

VXBUFFER_BACKBUFFER | Back Buffer
VXBUFFER_STENCILBUFFER | Stencil Buffer
VXBUFFER_ZBUFFER | Depth Buffer

Remarks

The VXBUFFER_TYPE is used by CKRenderContext::DumpToMemory() method to specify which video buffer to copy.

See Also

CKRenderContext::CopyToVideo,CKRenderContext::DumpToMemory.


VXCHANNEL_FLAGS

Enumerated Type VXCHANNEL_FLAGS

enum VXCHANNEL_FLAGS {
VXCHANNEL_ACTIVE = 0x00000001,
VXCHANNEL_SAMENORMAL = 0x00000002,
VXCHANNEL_VERTEXCOLOR = 0x00000004,
VXCHANNEL_HINT_USEORIGINALMESHVB = 0x00000008,
VXCHANNEL_KEEPFOG = 0x00400000,
VXCHANNEL_SAMEUV = 0x00800000,
VXCHANNEL_NOTLIT = 0x01000000,
VXCHANNEL_MONO = 0x02000000,
VXCHANNEL_RESERVED1 = 0x04000000,
VXCHANNEL_LAST = 0x08000000,
VXCHANNEL_UPTODATE = 0x10000000,
VXCHANNEL_SUBSET = 0x20000000,
VXCHANNEL_USEORIGINALMESHVB = 0x40000000,
VXCHANNEL_MATERIALSUBSET = 0x80000000

}

Mesh additionnal material channel options

Members

VXCHANNEL_ACTIVE | This channel is active
VXCHANNEL_HINT_USEORIGINALMESHVB | Hint : try to use the mesh original vb when possible, instead of creating an additional vertex buffer for the channel. when this is possible, the shared vb used for that channel will be deallocated
VXCHANNEL_KEEPFOG | By default fog is deactivated when rendering channels in multipass.. This flag prevent this from happening.
VXCHANNEL_LAST | Internal use : Set at runtime by render engine to indicate this channel isthe last to be rendered. Dot Not Modify
VXCHANNEL_MATERIALSUBSET |
VXCHANNEL_MONO | Internal use : Set at runtime by render engine to indicate whether this channel was rendered using multiple pass or not.(Dot Not Modify)
VXCHANNEL_NOTLIT | Additionnal Material Channel should not be lit (some channels may not be rendered in one pass with this option)
VXCHANNEL_RESERVED1 | Internal use : Reserved
VXCHANNEL_SAMENORMAL | Force to include normals from the mesh in this channel (if the channel has a material with an effect, then normals are added automatically, so specifying this flag is unecessary)
VXCHANNEL_SAMEUV | This channel should use the texture coordinates of the base mesh.
VXCHANNEL_SUBSET | Internal use : Channel should only use a subset of the face indices... If not set, then indices of the channel cover the whole mesh, as a result it may be possible to merge channel with material to do a single pass render
VXCHANNEL_UPTODATE | Internal use : Vertex data hold in vertex buffer is uptodate...
VXCHANNEL_USEORIGINALMESHVB | Internal use : The channel can use the original mesh vb instead of creating its own
VXCHANNEL_VERTEXCOLOR | Force the channel to include its own vertex colors (diffuse color / vertex color 0)

Remarks

The VXCHANNEL_FLAGS is used by CKMesh::SetChannelFlags to give the behavior of an additional material channel.

See Also

CKMesh,CKMesh::AddChannel,CKMesh::IsChannelLit,CKMesh::IsChannelActive


VXCMPFUNC

Enumerated Type VXCMPFUNC

enum VXCMPFUNC
{
VXCMP_NEVER = 1UL,
VXCMP_LESS = 2UL,
VXCMP_EQUAL = 3UL,
VXCMP_LESSEQUAL = 4UL,
VXCMP_GREATER = 5UL,
VXCMP_NOTEQUAL = 6UL,
VXCMP_GREATEREQUAL = 7UL,
VXCMP_ALWAYS = 8UL,
VXCMP_MASK = 0xFUL
}

Comparison Function

Members

VXCMP_ALWAYS | Always accept the test.
VXCMP_EQUAL | Accept if value if equal than current value.
VXCMP_GREATER | Accept if value if greater than current value.
VXCMP_GREATEREQUAL | Accept if value if greater or equal current value.
VXCMP_LESS | Accept if value if less than current value.
VXCMP_LESSEQUAL | Accept if value if less or equal than current value.
VXCMP_MASK | Mask for all possible values.
VXCMP_NEVER | Always fail the test.
VXCMP_NOTEQUAL | Accept if value if different than current value.

Remarks

Used by CKRenderContext::SetState with VXRENDERSTATE_ZFUNC, VXRENDERSTATE_ALPHAFUNC or VXRENDERSTATE_STENCILFUNC to specify the type of Z or Alpha comparison function. The comparison function is used to compare the stencil,alpha or z reference value to a stencil,z or alpha entry.

See Also

CKRenderContext::SetState,VXRENDERSTATETYPE,VXRENDERSTATE_ZFUNC,VXRENDERSTATE_ALPHAFUNC,


VXCULL

Enumerated Type VXCULL

enum VXCULL
{
VXCULL_NONE = 1UL,
VXCULL_CW = 2UL,
VXCULL_CCW = 3UL,
VXCULL_MASK = 3UL
}

Backface culling options

Members

VXCULL_CCW |
VXCULL_CW | Clockwise made faces are rejected when rendering
VXCULL_MASK |
VXCULL_NONE | No backface culling occurs

Remarks

Used by CKRenderContext::SetState(VXRENDERSTATE_CULLMODE) to specify the type of backface culling.

See Also

CKRenderContext::SetState,VXRENDERSTATE_CULLMODE


VxEffectDescription

Class VxEffectDescription

Material special effects

Remarks

  • Effects provide additionnal functionnalities to take advantage of graphic features such as bump mapping,cube maps etc...

  • When an effect is enabled on a material (CKMaterial::SetEffect) it may override the default settings of mesh channels or material blend options

  • This structure holds a description of an effect to display to the user.

Groups

Data Members
Member Variable CallbackArg | Arguments that will be given to the callback function
Member Variable DescImage | A image file that can be use to be displayed in the interface
Member Variable Description | A longer description that will appear in the interface to explain the effect to the user...
Member Variable EffectIndex | Index of this effect ( when using CKRenderManager::AddEffect the return value is the index of the newly added effect) so this member is ignored.
Member Variable MaxTextureCount | Number of textures that can be set on the material (CKMaterial::SetTexture)
Member Variable NeededTextureCoordsCount | Number of texture coordinates that must be set on the mesh for this effect to work (this is directly related to the number of channel you should set on the mesh that will use this effect)
Member Variable ParameterDefaultValue |
Member Variable ParameterDescription |
Member Variable ParameterType |
Member Variable SetCallback | A callback function that will be called to setup the effect if NULL the effect is likely to be hardcoded in render engine
Member Variable Summary | A short name that will be used for enumeration creation (eg. “Bump Map”)
Member Variable Tex1Description | A short description for texture 1
Member Variable Tex2Description | A short description for texture 2
Member Variable Tex3Description | A short description for texture 3
Constructors
Method VxEffectDescription | Description: Builds an instance of the object This builds an instance of the object out of its parameters.

See Also

VX_EFFECT,CKRenderManager::AddEffect,CKRenderManager::GetEffectDescription,CKMaterial::SetEffect,CKMaterial::GetEffect


VxEffectDescription::CallbackArg

Member Variable VxEffectDescription::CallbackArg

void* VxEffectDescription::CallbackArg

Remarks

Arguments that will be given to the callback function


VxEffectDescription::DescImage

Member Variable VxEffectDescription::DescImage

XString VxEffectDescription::DescImage

Remarks

A image file that can be use to be displayed in the interface


VxEffectDescription::Description

Member Variable VxEffectDescription::Description

XString VxEffectDescription::Description

Remarks

A longer description that will appear in the interface to explain the effect to the user...


VxEffectDescription::EffectIndex

Member Variable VxEffectDescription::EffectIndex

VX_EFFECT VxEffectDescription::EffectIndex

Remarks

Index of this effect ( when using CKRenderManager::AddEffect the return value is the index of the newly added effect) so this member is ignored.


VxEffectDescription::MaxTextureCount

Member Variable VxEffectDescription::MaxTextureCount

int VxEffectDescription::MaxTextureCount

Remarks

Number of textures that can be set on the material (CKMaterial::SetTexture)


VxEffectDescription::NeededTextureCoordsCount

Member Variable VxEffectDescription::NeededTextureCoordsCount

int VxEffectDescription::NeededTextureCoordsCount

Remarks

Number of texture coordinates that must be set on the mesh for this effect to work (this is directly related to the number of channel you should set on the mesh that will use this effect)


VxEffectDescription::ParameterDefaultValue

Member Variable VxEffectDescription::ParameterDefaultValue

XString VxEffectDescription::ParameterDefaultValue


VxEffectDescription::ParameterDescription

Member Variable VxEffectDescription::ParameterDescription

XString VxEffectDescription::ParameterDescription


VxEffectDescription::ParameterType

Member Variable VxEffectDescription::ParameterType

CKGUID VxEffectDescription::ParameterType


VxEffectDescription::SetCallback

Member Variable VxEffectDescription::SetCallback

CK_EFFECTCALLBACK VxEffectDescription::SetCallback

Remarks

A callback function that will be called to setup the effect if NULL the effect is likely to be hardcoded in render engine


VxEffectDescription::Summary

Member Variable VxEffectDescription::Summary

XString VxEffectDescription::Summary

Remarks

A short name that will be used for enumeration creation (eg. “Bump Map”)


VxEffectDescription::Tex1Description

Member Variable VxEffectDescription::Tex1Description

XString VxEffectDescription::Tex1Description

Remarks

A short description for texture 1


VxEffectDescription::Tex2Description

Member Variable VxEffectDescription::Tex2Description

XString VxEffectDescription::Tex2Description

Remarks

A short description for texture 2


VxEffectDescription::Tex3Description

Member Variable VxEffectDescription::Tex3Description

XString VxEffectDescription::Tex3Description

Remarks

A short description for texture 3


VxEffectDescription::VxEffectDescription

Method VxEffectDescription::VxEffectDescription

VxEffectDescription::VxEffectDescription()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VXFILL_MODE

Enumerated Type VXFILL_MODE

enum VXFILL_MODE
{
VXFILL_POINT = 1UL,
VXFILL_WIREFRAME = 2UL,
VXFILL_SOLID = 3UL,
VXFILL_MASK = 3UL
}

Fill Mode Options

Members

VXFILL_MASK |
VXFILL_POINT | Vertices rendering
VXFILL_SOLID | Face rendering
VXFILL_WIREFRAME | Edges rendering

Remarks

The VXFILL_MODE is used by CKMaterial::SetFillMode to specify how faces are drawn. Also used as value for VXRENDERSTATE_FILLMODE render state.

See Also

CKMaterial::SetFillMode,VXRENDERSTATE_FILLMODE


VXFOG_MODE

Enumerated Type VXFOG_MODE

enum VXFOG_MODE
{
VXFOG_NONE = 0UL,
VXFOG_EXP = 1UL,
VXFOG_EXP2 = 2UL,
VXFOG_LINEAR = 3UL
}

Fog Options

Members

VXFOG_EXP | Exponential Fog ()
VXFOG_EXP2 | Square Exponential Fog ()
VXFOG_LINEAR | Linear fog (most likely case )
VXFOG_NONE | No Fog (Default)

Remarks

Used by CKRenderContext::SetFogMode to specify the type of fog to apply to the scene. Also used as value for VXRENDERSTATE_FOGMODE render state.

See Also

CKRenderContext::SetFogMode,VXRENDERSTATE_FOGMODE,CKRenderContext::SetState.


VXLIGHT_TYPE

Enumerated Type VXLIGHT_TYPE

enum VXLIGHT_TYPE
{
VX_LIGHTPOINT = 1UL,
VX_LIGHTSPOT = 2UL,
VX_LIGHTDIREC = 3UL,
VX_LIGHTPARA = 4UL
}

Light type.

Members

VX_LIGHTDIREC | The light is directional light : Lights comes from an infinite point so only direction of light can be given
VX_LIGHTPARA | Obsolete, do not use
VX_LIGHTPOINT | The Light is a point of light
VX_LIGHTSPOT | The light is a spotlight

Remarks

Used by CKLight::SetType to specify the type of a light.

See Also

CKLight::SetType,CKLight::GetType


VXMESH_FLAGS

Enumerated Type VXMESH_FLAGS

enum VXMESH_FLAGS
{
VXMESH_BOUNDINGUPTODATE = 0x00000001,
VXMESH_VISIBLE = 0x00000002,
VXMESH_OPTIMIZED = 0x00000004,
VXMESH_FACENORMALSCOMPUTED = 0x00000008,
VXMESH_HASTRANSPARENCY = 0x00000010,
VXMESH_PRELITMODE = 0x00000080,
VXMESH_WRAPU = 0x00000100,
VXMESH_WRAPV = 0x00000200,
VXMESH_FORCETRANSPARENCY = 0x00001000,
VXMESH_TRANSPARENCYUPTODATE = 0x00002000,
VXMESH_UV_CHANGED = 0x00004000,
VXMESH_NORMAL_CHANGED = 0x00008000,
VXMESH_COLOR_CHANGED = 0x00010000,
VXMESH_POS_CHANGED = 0x00020000,
VXMESH_HINTDYNAMIC = 0x00040000,
VXMESH_GENNORMALS = 0x00080000,
VXMESH_PROCEDURALUV = 0x00100000,
VXMESH_PROCEDURALPOS = 0x00200000,
VXMESH_STRIPIFY = 0x00400000,
VXMESH_MONOMATERIAL = 0x00800000,
VXMESH_PM_BUILDNORM = 0x01000000,
VXMESH_BWEIGHTS_CHANGED = 0x02000000,
VXMESH_GENTANSPACE = 0x04000000,
VXMESH_UPDATEINDEXBUF = 0x08000000,
VXMESH_USECOLORANDNORMAL = 0x10000000,
VXMESH_ALLFLAGS = 0x1FFFF39F
}

Mesh Flags Options

Members

VXMESH_ALLFLAGS |
VXMESH_BOUNDINGUPTODATE | If set the bounding box is up to date (internal).
VXMESH_BWEIGHTS_CHANGED | Must be set if vertex blend weights have changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove)
VXMESH_COLOR_CHANGED | Must be set if colors changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::ColorChanged)
VXMESH_FACENORMALSCOMPUTED | Set by the render engine if the mesh face normal information is valid (internal)
VXMESH_FORCETRANSPARENCY | Forces this mesh to be considered as transparent even if no material is tranparent. (CKMesh::SetTransparent)
VXMESH_GENNORMALS | Hint : Normals were generated by BuildNormals : Do not save (internal)
VXMESH_GENTANSPACE | Generates tangent space vectors.
VXMESH_HASTRANSPARENCY | If set indicates that one or more of the faces of this mesh use a transparent material (internal)
VXMESH_HINTDYNAMIC | Hint for render engine : Mesh geometry is updated frequently
VXMESH_MONOMATERIAL | Set by the render engine if the mesh use only one material.
VXMESH_NORMAL_CHANGED | Must be set if normal coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::NormalChanged)
VXMESH_OPTIMIZED | Set by the render engine if the mesh is optimized for rendering. Unset it to force to recreate optimized structures (when changing materials or face organization ) (CKMesh::VertexMove)
VXMESH_PM_BUILDNORM | Build normals when performing progressive meshing : Do not save (internal)
VXMESH_POS_CHANGED | Must be set if vertex position changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::VertexMove)
VXMESH_PRELITMODE | If set, no lightning should occur for this mesh, vertex color should be used instead (CKMesh::SetLitMode)
VXMESH_PROCEDURALPOS | Hint : Vertices postions are generated : Do not save (internal)
VXMESH_PROCEDURALUV | Hint : UVs are generated : Do not save (internal)
VXMESH_STRIPIFY | If set the mesh will be stripified.
VXMESH_TRANSPARENCYUPTODATE | If set, the flags VXMESH_HASTRANSPARENCY is up to date. (internal)
VXMESH_UPDATEINDEXBUF | Index Buffer should be updated...
VXMESH_USECOLORANDNORMAL | Use Color AND Normal in the vertex buffer.
VXMESH_UV_CHANGED | Must be set if texture coordinates changed to enable the render engine to reconstruct potential display lists or vertex buffers. (CKMesh::UVChanged)
VXMESH_VISIBLE | If not set the mesh will not be rendered (CKMesh::Show)
VXMESH_WRAPU | Texture coordinates wrapping among u texture coordinates. (CKMesh::SetWrapMode)
VXMESH_WRAPV | Texture coordinates wrapping among v texture coordinates. (CKMesh::SetWrapMode)

Remarks

The VXMESH_FLAGS is used by CKMesh::SetFlags to specify different hints to the render engine about the mesh. Most of this flags can be set or asked using the appropriate method of CKMesh (given between () in the members documentation).

See Also

CKMesh,CKMesh::SetFlags


VXMESH_LITMODE

Enumerated Type VXMESH_LITMODE

enum VXMESH_LITMODE
{
VX_PRELITMESH = 0,
VX_LITMESH = 1,
}

Mesh lighting options

Members

VX_LITMESH | Lighting is done by renderer using normals and face material information.
VX_PRELITMESH | Lighting use color information store with vertices

Remarks

The VXMESH_LITMODE is used by CKMesh::SetLitMode to specify how lighting is done.

See Also

CKMaterial,CKMesh


VXPRIMITIVETYPE

Enumerated Type VXPRIMITIVETYPE

enum VXPRIMITIVETYPE
{
VX_POINTLIST = 1UL,
VX_LINELIST = 2UL,
VX_LINESTRIP = 3UL,
VX_TRIANGLELIST = 4UL,
VX_TRIANGLESTRIP = 5UL,
VX_TRIANGLEFAN = 6UL
}

Type of primitive (Triangle,strips,line,points,etc.) to draw.

Members

VX_LINELIST | Draw a list of lines, if indices are given there must be a multiple of 2 indices
VX_LINESTRIP | Draw a strip of lines
VX_POINTLIST | Draw a list of points, indices are not used to draw the points
VX_TRIANGLEFAN | Draw a fan of triangles
VX_TRIANGLELIST | Draw a list of triangles, if indices are given there must be a multiple of 3 indices
VX_TRIANGLESTRIP | Draw a strip of triangles

Remarks

Used by CKRenderContext::DrawPrimitive to specify the type of primitive to be drawn.

See Also

CKRenderContext::DrawPrimitive


VXRENDERSTATETYPE

Enumerated Type VXRENDERSTATETYPE

enum VXRENDERSTATETYPE {
VXRENDERSTATE_ANTIALIAS = 2,
VXRENDERSTATE_TEXTUREPERSPECTIVE = 4,
VXRENDERSTATE_ZENABLE = 7,
VXRENDERSTATE_FILLMODE = 8,
VXRENDERSTATE_SHADEMODE = 9,
VXRENDERSTATE_LINEPATTERN = 10,
VXRENDERSTATE_ZWRITEENABLE = 14,
VXRENDERSTATE_ALPHATESTENABLE = 15,
VXRENDERSTATE_SRCBLEND = 19,
VXRENDERSTATE_DESTBLEND = 20,
VXRENDERSTATE_CULLMODE = 22,
VXRENDERSTATE_ZFUNC = 23,
VXRENDERSTATE_ALPHAREF = 24,
VXRENDERSTATE_ALPHAFUNC = 25,
VXRENDERSTATE_DITHERENABLE = 26,
VXRENDERSTATE_ALPHABLENDENABLE = 27,
VXRENDERSTATE_FOGENABLE = 28,
VXRENDERSTATE_SPECULARENABLE = 29,
VXRENDERSTATE_FOGCOLOR = 34,
VXRENDERSTATE_FOGPIXELMODE = 35,
VXRENDERSTATE_FOGSTART = 36,
VXRENDERSTATE_FOGEND = 37,
VXRENDERSTATE_FOGDENSITY = 38,
VXRENDERSTATE_EDGEANTIALIAS = 40,
VXRENDERSTATE_ZBIAS = 47,
VXRENDERSTATE_RANGEFOGENABLE = 48,
VXRENDERSTATE_STENCILENABLE = 52,
VXRENDERSTATE_STENCILFAIL = 53,
VXRENDERSTATE_STENCILZFAIL = 54,
VXRENDERSTATE_STENCILPASS = 55,
VXRENDERSTATE_STENCILFUNC = 56,
VXRENDERSTATE_STENCILREF = 57,
VXRENDERSTATE_STENCILMASK = 58,
VXRENDERSTATE_STENCILWRITEMASK = 59,
VXRENDERSTATE_TEXTUREFACTOR = 60,
VXRENDERSTATE_WRAP0 = 128,
VXRENDERSTATE_WRAP1 = 129,
VXRENDERSTATE_WRAP2 = 130,
VXRENDERSTATE_WRAP3 = 131,
VXRENDERSTATE_WRAP4 = 132,
VXRENDERSTATE_WRAP5 = 133,
VXRENDERSTATE_WRAP6 = 134,
VXRENDERSTATE_WRAP7 = 135,
VXRENDERSTATE_CLIPPING = 136,
VXRENDERSTATE_LIGHTING = 137,
VXRENDERSTATE_AMBIENT = 139,
VXRENDERSTATE_FOGVERTEXMODE = 140,
VXRENDERSTATE_COLORVERTEX = 141,
VXRENDERSTATE_LOCALVIEWER = 142,
VXRENDERSTATE_NORMALIZENORMALS = 143,
VXRENDERSTATE_DIFFUSEFROMVERTEX = 145,
VXRENDERSTATE_SPECULARFROMVERTEX = 146,
VXRENDERSTATE_AMBIENTFROMVERTEX = 147,
VXRENDERSTATE_EMISSIVEFROMVERTEX = 148,

VXRENDERSTATE_VERTEXBLEND = 151,
VXRENDERSTATE_SOFTWAREVPROCESSING= 153,

VXRENDERSTATE_POINTSIZE = 154,
VXRENDERSTATE_POINTSIZE_MIN = 155,
VXRENDERSTATE_POINTSIZE_MAX = 166,
VXRENDERSTATE_POINTSPRITEENABLE = 156,

VXRENDERSTATE_POINTSCALEENABLE = 157,
VXRENDERSTATE_POINTSCALE_A = 158,
VXRENDERSTATE_POINTSCALE_B = 159,
VXRENDERSTATE_POINTSCALE_C = 160,

VXRENDERSTATE_CLIPPLANEENABLE = 152,
VXRENDERSTATE_INDEXVBLENDENABLE = 167,
VXRENDERSTATE_COLORWRITEENABLE = 168,
VXRENDERSTATE_BLENDOP = 171,
VXRENDERSTATE_SCISSORTESTENABLE = 174,
VXRENDERSTATE_TWOSIDEDLIGHTING = 175,

VXRENDERSTATE_LOCKMATERIALSTATES = 252,
VXRENDERSTATE_TEXTURETARGET = 253,
VXRENDERSTATE_INVERSEWINDING = 254,
VXRENDERSTATE_MAXSTATE = 256,
VXRENDERSTATE_FORCE_DWORD = 0x7fffffff
}

Rendering states.

Members

VXRENDERSTATE_ALPHABLENDENABLE

Enable alpha blending (TRUE/FALSE)
VXRENDERSTATE_ALPHAFUNC

Alpha-comparison function (VXCMPFUNC)
VXRENDERSTATE_ALPHAREF

Reference alpha value (DWORD (0..255) )
VXRENDERSTATE_ALPHATESTENABLE

Enable alpha tests (TRUE/FALSE)
VXRENDERSTATE_AMBIENT

Ambient color for scene (DWORD ARGB)
VXRENDERSTATE_AMBIENTFROMVERTEX

If VXRENDERSTATE_COLORVERTEX is TRUE this flags indicate whether ambient color is taken from the vertex color (TRUE) or from the currently set material (FALSE)
VXRENDERSTATE_ANTIALIAS

Antialiasing mode (TRUE/FALSE)
VXRENDERSTATE_BLENDOP

Set blending operation VXBLENDOP
VXRENDERSTATE_CLIPPING

Enable or disable primitive clipping (TRUE/FALSE)
VXRENDERSTATE_CLIPPLANEENABLE

Enable one or more user-defined clipping planes ( DWORD mask of planes)
VXRENDERSTATE_COLORVERTEX

Enable or disable per-vertex color
VXRENDERSTATE_COLORWRITEENABLE

Per channel masking. Bit 0 enables Red, Bit 1 enables Green, Bit 2 enables Blue, Bit 3 enables Alpha
VXRENDERSTATE_CULLMODE

Back-face culling mode (VXCULL)
VXRENDERSTATE_DESTBLEND

Blend factor for destination (VXBLEND_MODE)
VXRENDERSTATE_DIFFUSEFROMVERTEX

If VXRENDERSTATE_COLORVERTEX is TRUE this flags indicate whether diffuse color is taken from the vertex color (TRUE) or from the currently set material (FALSE)
VXRENDERSTATE_DITHERENABLE

Enable dithering (TRUE/FALSE)
VXRENDERSTATE_EDGEANTIALIAS

Antialias edges (TRUE/FALSE)
VXRENDERSTATE_EMISSIVEFROMVERTEX

If VXRENDERSTATE_COLORVERTEX is TRUE this flags indicate whether emissive color is taken from the vertex color (TRUE) or from the currently set material (FALSE)
VXRENDERSTATE_FILLMODE

Fill mode (VXFILL_MODE)
VXRENDERSTATE_FOGCOLOR

Fog color (DWORD ARGB)
VXRENDERSTATE_FOGDENSITY

Fog density (for both vertex and pixel fog)
VXRENDERSTATE_FOGENABLE

Enable fog (TRUE/FALSE)
VXRENDERSTATE_FOGEND

Fog end (for both vertex and pixel fog)
VXRENDERSTATE_FOGPIXELMODE

Fog mode for per pixel fog (VXFOG_MODE)
VXRENDERSTATE_FOGSTART

Fog start (for both vertex and pixel fog)
VXRENDERSTATE_FOGVERTEXMODE

Fog mode for per vertex fog (VXFOG_MODE)
VXRENDERSTATE_INDEXVBLENDENABLE

Enable indexed vertex blending (to use with VXRENDERSTATE_VERTEXBLEND)
VXRENDERSTATE_INVERSEWINDING

Invert Cull CW and cull CCW (TRUE/FALSE)
VXRENDERSTATE_LIGHTING

Enable or disable lighting (TRUE/FALSE)
VXRENDERSTATE_LINEPATTERN

Line pattern (bit pattern in a DWORD)
VXRENDERSTATE_LOCALVIEWER

Camera relative specular highlights (TRUE/FALSE)
VXRENDERSTATE_LOCKMATERIALSTATES

if Enabled, subsequent calls to CKRasterizerContext::SetMaterial are ignored
VXRENDERSTATE_NORMALIZENORMALS

Enable automatic normalization of vertex normals
VXRENDERSTATE_POINTSCALE_A

constant attenuation factor for point size computation (see VXRENDERSTATE_POINTSCALEENABLE)
VXRENDERSTATE_POINTSCALE_B

linear attenuation factor for point size computation (see VXRENDERSTATE_POINTSCALEENABLE)
VXRENDERSTATE_POINTSCALE_C

quadratic attenuation factor for point size computation (see VXRENDERSTATE_POINTSCALEENABLE)
VXRENDERSTATE_POINTSCALEENABLE
If true the size of point will be attenuated according to distance:
Size

pointSize * sqrt(1/ (a + b*dist + c * dist*dist)) where dist is the distance from viewpoint to point.
VXRENDERSTATE_POINTSIZE

Size of point when drawing point sprites. This value is in screen space units if VXRENDERSTATE_POINTSCALEENABLE is FALSE; otherwise this value is in world space units.
VXRENDERSTATE_POINTSIZE_MAX

Specifies the maximum size of point primitives. If below 1 the points drawn will disappear when smaller than a pixel
VXRENDERSTATE_POINTSIZE_MIN

Specifies the minimum size of point primitives. If below 1 the points drawn will disappear when smaller than a pixel
VXRENDERSTATE_POINTSPRITEENABLE
VXRENDERSTATE_RANGEFOGENABLE

Enables range-based fog
VXRENDERSTATE_SCISSORTESTENABLE

Enable / Disable the scissor test
VXRENDERSTATE_SHADEMODE

Shade mode (VXSHADE_MODE)
VXRENDERSTATE_SOFTWAREVPROCESSING

When using a T&L driver in mixed mode, for the usage of software processing
VXRENDERSTATE_SPECULARENABLE

Enable specular highlights (TRUE/FALSE)
VXRENDERSTATE_SPECULARFROMVERTEX

If VXRENDERSTATE_COLORVERTEX is TRUE this flags indicate whether specular color is taken from the vertex color (2) or from the currently set material (0)
VXRENDERSTATE_SRCBLEND

Blend factor for source (VXBLEND_MODE)
VXRENDERSTATE_STENCILENABLE

Enable or disable stenciling (TRUE/FALSE)
VXRENDERSTATE_STENCILFAIL

Stencil operation (VXSTENCILOP)
VXRENDERSTATE_STENCILFUNC

Stencil comparison function (VXCMPFUNC)
VXRENDERSTATE_STENCILMASK

Mask value used in stencil test (DWORD (0..255))
VXRENDERSTATE_STENCILPASS

Stencil operation (VXSTENCILOP)
VXRENDERSTATE_STENCILREF

Reference value for stencil test (DWORD (0..255))
VXRENDERSTATE_STENCILWRITEMASK

Stencil buffer write mask
VXRENDERSTATE_STENCILZFAIL

Stencil operation (VXSTENCILOP)
VXRENDERSTATE_TEXTUREFACTOR

Texture factor
VXRENDERSTATE_TEXTUREPERSPECTIVE

Enable Perspective correction (TRUE/FALSE)
VXRENDERSTATE_TEXTURETARGET

Hint: context is used to render on a texture
VXRENDERSTATE_TWOSIDEDLIGHTING
VXRENDERSTATE_VERTEXBLEND

Enable vertex blending and set the number of matrices to use (VXVERTEXBLENDFLAGS)
VXRENDERSTATE_WRAP0

Wrap flags for 1st texture coord set (VXWRAP_MODE)
VXRENDERSTATE_WRAP1

Wrap flags for 2nd texture coord set (VXWRAP_MODE)
VXRENDERSTATE_WRAP2

Wrap flags for 3rd texture coord set (VXWRAP_MODE)
VXRENDERSTATE_WRAP3

Wrap flags for 4th texture coord set (VXWRAP_MODE)
VXRENDERSTATE_WRAP4

Wrap flags for 5th texture coord set (VXWRAP_MODE)
VXRENDERSTATE_WRAP5

Wrap flags for 6th texture coord set (VXWRAP_MODE)
VXRENDERSTATE_WRAP6

Wrap flags for 7th texture coord set (VXWRAP_MODE)
VXRENDERSTATE_WRAP7

Wrap flags for last texture coord set
VXRENDERSTATE_ZBIAS

Z-bias (DWORD 0..16)
VXRENDERSTATE_ZENABLE

Enable z test (TRUE/FALSE)
VXRENDERSTATE_ZFUNC

Z-comparison function (VXCMPFUNC)
VXRENDERSTATE_ZWRITEENABLE

Enable z writes (TRUE/FALSE)

Remarks

+Through VXRENDERSTATETYPE , one can specify various mode for rendering, most of the time this settings are automatically set by render engine according to textures, objects and materials properties. Using SetState enable to override the default behavior especially in render callbacks. +Each time a mesh,sprite3d or 2dEntity is drawn, it automatically sets the appropriate render states for its rendering according to the material used (See CKMaterial::SetAsCurrent).

See Also

CKRenderContext, CKRenderContext::SetState


VXSHADE_MODE

Enumerated Type VXSHADE_MODE

enum VXSHADE_MODE
{
VXSHADE_FLAT = 1UL,
VXSHADE_GOURAUD = 2UL,
VXSHADE_PHONG = 3UL,
VXSHADE_MASK = 3UL
}

Shade Mode Options

Members

VXSHADE_FLAT | Flat Shading
VXSHADE_GOURAUD | Gouraud Shading
VXSHADE_MASK |
VXSHADE_PHONG | Phong Shading (Not yet supported by most implementation)

Remarks

+The VXSHADE_MODE is used by CKMaterial::SetShadeMode to specify how color interpolation is perform on faces when they are drawn. +Also used as value for VXRENDERSTATE_SHADEMODE render state.

See Also

CKMaterial::SetShadeMode,VXRENDERSTATE_SHADEMODE


VxShadeType

Enumerated Type VxShadeType

enum VxShadeType
{
WireFrame =0,
FlatShading =1,
GouraudShading =2,
PhongShading =3,
MaterialDefault =4
}

Global Shade Mode

Members

FlatShading | All Objects will be rendered using flat shading
GouraudShading | All Objects will be rendered using gouraud shading
MaterialDefault | All Objects will be rendered using their own shade mode
PhongShading | All Objects will be rendered using phong shading
WireFrame | Rendering will use settings of materials for rendering

Remarks

The VxShadeType describes a global render mode which is used for all objects in a context.

See Also

CKRenderContext::SetGlobalRenderMode


VXSPRITE3D_TYPE

Enumerated Type VXSPRITE3D_TYPE

enum VXSPRITE3D_TYPE
{
VXSPRITE3D_BILLBOARD = 0,
VXSPRITE3D_XROTATE,
VXSPRITE3D_YROTATE,
VXSPRITE3D_ORIENTABLE,
}

Sprite3D Orientation Options

Members

VXSPRITE3D_BILLBOARD | Orientation is set to always face the camera
VXSPRITE3D_ORIENTABLE | Orientation of the sprite3D is free
VXSPRITE3D_XROTATE | Orientation is set to face the camera but X axis is locked.
VXSPRITE3D_YROTATE | Orientation is set to face the camera but Y axis is locked (typically a tree for example).

Remarks

The VXSPRITE3D_TYPE is used by CKSprite3D::SetMode to specify how the orientation of the sprite3D is calculated.

See Also

CKSprite3D::SetMode,CKSprite3D::GetMode


VXSPRITE_RENDEROPTIONS

Enumerated Type VXSPRITE_RENDEROPTIONS

enum VXSPRITE_RENDEROPTIONS
{
VXSPRITE_NONE = 0x00000000UL,
VXSPRITE_ALPHATEST = 0x00000001UL,
VXSPRITE_BLEND = 0x00000002UL,
VXSPRITE_MODULATE = 0x00000004UL,
VXSPRITE_FILTER = 0x00000008UL

}

Sprite rendering options

Members

VXSPRITE_ALPHATEST | Alpha test is enabled, AlphaRefValue & AlphaTestFunc must be filled with correct values in VxSpriteRenderOptions
VXSPRITE_BLEND | Blending is enabled, SrcBlendMode & DstBlendMode must be filled with correct values in VxSpriteRenderOptions
VXSPRITE_FILTER |
VXSPRITE_MODULATE | Modulation is enabled, ModulateColor must be filled with correct values in VxSpriteRenderOptions
VXSPRITE_NONE | Default sprite rendering : no blending no filtering no modulation

See Also

VxSpriteRenderOptions,CKSprite::SetRenderOptions,CKSprite::GetRenderOptions

Generated by the DocJet Source Code Documentation System version 6.1.3 Thursday, February 26, 2009
C++
C#
VB
JScript
All
Group Class Hierarchy

Enumerated Type VXSPRITE_RENDEROPTIONS2

enum VXSPRITE_RENDEROPTIONS2
{
VXSPRITE2_NONE = 0x00000000UL,
VXSPRITE2_DISABLE_AA_CORRECTION = 0x00000001UL
}

Sprite rendering options

Members

VXSPRITE2_DISABLE_AA_CORRECTION | Disable Antialiasing special processing on the sprite (UV offset,...) .
VXSPRITE2_NONE | Default sprite rendering : no blending no filtering no modulation

See Also

VxSpriteRenderOptions,CKSprite::SetRenderOptions,CKSprite::GetRenderOptions


VXSTENCILOP

Enumerated Type VXSTENCILOP

enum VXSTENCILOP
{
VXSTENCILOP_KEEP = 1UL,
VXSTENCILOP_ZERO = 2UL,
VXSTENCILOP_REPLACE = 3UL,
VXSTENCILOP_INCRSAT = 4UL,
VXSTENCILOP_DECRSAT = 5UL,
VXSTENCILOP_INVERT = 6UL,
VXSTENCILOP_INCR = 7UL,
VXSTENCILOP_DECR = 8UL,
VXSTENCILOP_MASK = 0xFUL
}

Stencil Operations

Members

VXSTENCILOP_DECR | Decrement stencil value.
VXSTENCILOP_DECRSAT | Decrement stencil value ( down to 0)
VXSTENCILOP_INCR | Increment stencil value (Wrap to 0 when above maximum value)
VXSTENCILOP_INCRSAT | Increment stencil value ( up to maximum value (2^n-1) where n is the number bits for stencil buffer)
VXSTENCILOP_INVERT | Invert the bits of the stencil value
VXSTENCILOP_KEEP | Keep stencil value.
VXSTENCILOP_MASK | Mask for all possible values.
VXSTENCILOP_REPLACE | Set stencil value to reference (VXRENDERSTATE_STENCILREF)
VXSTENCILOP_ZERO | Set stencil value to zero

Remarks

This enumeration describes the stencil operations for the VXRENDERSTATE_STENCILFAIL,VXRENDERSTATE_ZFAIL,VXRENDERSTATE_STENCILPASS render states.

See Also

VXRENDERSTATETYPE,CKRenderContext::SetState


VXTEXTURE_ADDRESSMODE

Enumerated Type VXTEXTURE_ADDRESSMODE

enum VXTEXTURE_ADDRESSMODE
{
VXTEXTURE_ADDRESSWRAP = 1UL,
VXTEXTURE_ADDRESSMIRROR = 2UL,
VXTEXTURE_ADDRESSCLAMP = 3UL,
VXTEXTURE_ADDRESSBORDER = 4UL,
VXTEXTURE_ADDRESSMIRRORONCE = 5UL,
VXTEXTURE_ADDRESSMASK = 0x7UL
}

Texture addressing modes.

Members

VXTEXTURE_ADDRESSBORDER | When texture coordinates are greater than 1.0 or less than 0.0 texture is set to a color defined in CKMaterial::SetTextureBorderColor.
VXTEXTURE_ADDRESSCLAMP | Texture coordinates greater than 1.0 are set to 1.0, and values less than 0.0 are set to 0.0.
VXTEXTURE_ADDRESSMASK | mask for all values
VXTEXTURE_ADDRESSMIRROR | Texture coordinates outside the range [0..1] are flipped evenly.
VXTEXTURE_ADDRESSMIRRORONCE |
VXTEXTURE_ADDRESSWRAP | Default mesh wrap mode is used (see CKMesh::SetWrapMode)

Remarks

The VXTEXTURE_ADDRESSMODE is used by CKMaterial::SetTextureAddresMode to specify texture coordinate are taken into account when they are outside the range [0.0 , 1.0]. Also used as value for CKRST_TSS_ADDRESS texture stage state.

See Also

CKMaterial,CKTexture,CKRST_TSS_ADDRESS,CKRenderContext::SetTextureStageState


VXTEXTURE_BLENDMODE

Enumerated Type VXTEXTURE_BLENDMODE

enum VXTEXTURE_BLENDMODE
{
VXTEXTUREBLEND_DECAL = 1UL,
VXTEXTUREBLEND_MODULATE = 2UL,
VXTEXTUREBLEND_DECALALPHA = 3UL,
VXTEXTUREBLEND_MODULATEALPHA = 4UL,
VXTEXTUREBLEND_DECALMASK = 5UL,
VXTEXTUREBLEND_MODULATEMASK = 6UL,
VXTEXTUREBLEND_COPY = 7UL,
VXTEXTUREBLEND_ADD = 8UL,
VXTEXTUREBLEND_DOTPRODUCT3 = 9UL,
VXTEXTUREBLEND_MAX = 10UL,
VXTEXTUREBLEND_MASK = 0xFUL
}

Blend Mode Flags

Members

VXTEXTUREBLEND_ADD |
VXTEXTUREBLEND_COPY | Equivalent to DECAL
VXTEXTUREBLEND_DECAL | Texture replace any material information
VXTEXTUREBLEND_DECALALPHA | Alpha information in the texture specify how material and texture are combined. Alpha information of the texture replace material alpha component.
VXTEXTUREBLEND_DECALMASK |
VXTEXTUREBLEND_DOTPRODUCT3 | Perform a Dot Product 3 between texture (normal map) and a referential vector given in VXRENDERSTATE_TEXTUREFACTOR.
VXTEXTUREBLEND_MASK |
VXTEXTUREBLEND_MAX |
VXTEXTUREBLEND_MODULATE | Texture and material are combine. Alpha information of the texture replace material alpha component.
VXTEXTUREBLEND_MODULATEALPHA | Alpha information in the texture specify how material and texture are combined
VXTEXTUREBLEND_MODULATEMASK |

Remarks

The VXTEXTURE_BLENDMODE is used by CKMaterial::SetTextureBlendMode() to specify how texture is applied on primitives. Also used as value for CKRST_TSS_TEXTUREMAPBLEND texture stage state.

See Also

Using Materials,CKMaterial,CKTexture,CKMaterial::SetTextureBlendMode,CKRST_TSS_TEXTUREMAPBLEND.


VXTEXTURE_FILTERMODE

Enumerated Type VXTEXTURE_FILTERMODE

enum VXTEXTURE_FILTERMODE
{
VXTEXTUREFILTER_NEAREST = 1UL,
VXTEXTUREFILTER_LINEAR = 2UL,
VXTEXTUREFILTER_MIPNEAREST = 3UL,
VXTEXTUREFILTER_MIPLINEAR = 4UL,
VXTEXTUREFILTER_LINEARMIPNEAREST = 5UL,
VXTEXTUREFILTER_LINEARMIPLINEAR = 6UL,
VXTEXTUREFILTER_ANISOTROPIC = 7UL,
VXTEXTUREFILTER_MASK = 0xFUL
}

Filter Mode Options

Members

VXTEXTUREFILTER_ANISOTROPIC | Anisotropic filtering
VXTEXTUREFILTER_LINEAR | Bilinear Interpolation
VXTEXTUREFILTER_LINEARMIPLINEAR | Trilinear Filtering
VXTEXTUREFILTER_LINEARMIPNEAREST | Mip Mapping with Bilinear interpolation between mipmap levels.
VXTEXTUREFILTER_MASK |
VXTEXTUREFILTER_MIPLINEAR | Mip Mapping with Bilinear interpolation
VXTEXTUREFILTER_MIPNEAREST | Mip mapping
VXTEXTUREFILTER_NEAREST | No Filter

Remarks

The VXTEXTURE_FILTERMODE is used by CKMaterial::SetTextureMagMode and CKMaterial::SetTextureMinMode to specify how texture is filtered when magnified. Also used as value for CKRST_TSS_MAGFILTER and CKRST_TSS_MINFILTER texture stage state.

See Also

Using Materials,CKMaterial,CKTexture,CKMaterial::SetTextureMagMode,CKMaterial::SetTextureMinMode,,CKRenderContext::SetTextureStageState


VXTEXTURE_WRAPMODE

Enumerated Type VXTEXTURE_WRAPMODE

enum VXTEXTURE_WRAPMODE
{
VXTEXTUREWRAP_NONE = 0x00000000,
VXTEXTUREWRAP_U = 0x00000001,
VXTEXTUREWRAP_V = 0x00000002,
VXTEXTUREWRAP_UV = 0x00000003,
}

Wrapping Flags

Members

VXTEXTUREWRAP_NONE | Flat texture addressing
VXTEXTUREWRAP_U | Vertical cylinder mapping
VXTEXTUREWRAP_UV | Spherical mapping
VXTEXTUREWRAP_V | Horizontal cylinder mapping

Remarks

The VXTEXTURE_WRAPMODE is used by CKMesh::SetWrapMode() to specify how texture coordinates are interpolated.

See Also

Using Materials,CKMaterial,CKMesh::SetWrapMode.


VXWRAP_MODE

Enumerated Type VXWRAP_MODE

enum VXWRAP_MODE
{
VXWRAP_U = 0x00000001UL,
VXWRAP_V = 0x00000002UL,
VXWRAP_S = 0x00000004UL,
VXWRAP_T = 0x00000008UL,
VXWRAP_MASK = 0x000FUL
}

Texture coordinates wrapping mode

Members

VXWRAP_MASK |
VXWRAP_S | Texture coordinates wrapping among s texture coordinates
VXWRAP_T | Texture coordinates wrapping among t texture coordinates
VXWRAP_U | Texture coordinates wrapping among u texture coordinates
VXWRAP_V | Texture coordinates wrapping among v texture coordinates


VXSHADOWMAP_FORMAT

Enumerated Type VXSHADOWMAP_FORMAT

enum VXSHADOWMAP_FORMAT
{
VXSHADOWMAP_DEBUGMATERIAL = 0,
VXSHADOWMAP_HWSHADOWMAP24S8,
VXSHADOWMAP_HWSHADOWMAP16,
VXSHADOWMAP_FLOAT32WBUFFER,
VXSHADOWMAP_FLOAT16WBUFFER,
VXSHADOWMAP_FORMATCOUNT,
VXSHADOWMAP_UNKNOWNFORMAT = VXSHADOWMAP_FORMATCOUNT
}

Texture format used by shadow maps

Members

VXSHADOWMAP_DEBUGMATERIAL | For debug : Display Triangles / Objects where shadows are received
VXSHADOWMAP_FLOAT16WBUFFER | Float16 shadow map (Depth written in R component) with no PCF (Need filtering in the shader)
VXSHADOWMAP_FLOAT32WBUFFER | Float32 shadow map with no PCF (Need filtering in the shader)
VXSHADOWMAP_FORMATCOUNT |
VXSHADOWMAP_HWSHADOWMAP16 | Hardware shadow map -> supports PCF in hardware (GeForce 3 or more)
VXSHADOWMAP_HWSHADOWMAP24S8 | Hardware shadow map with 24 bits depth buffer
VXSHADOWMAP_UNKNOWNFORMAT |


Structures

List of structures definitions

Structure CKAttributeVal | Storage of couple (Attribute,Parameter)
Class CKBehaviorContext | Structure passed to behavior execution and callback functions
Structure CKFileInfo | Structure containing informations about a .cmo or .nmo file.
Class CKFileObject | Description of a loaded/saved object.
Structure CKFilePluginDependencies | List of Plugins guids used by a file.
Class CKFloorPoint | Returned Information about a nearest floor
Class CKListenerSettings | To Document Listener Settings
Structure CKOperationDesc | Description of an available parametric operation.
Class CKParameterTypeDesc | Description of a parameter type.
Class CKPatch | Structure holding the details of a patch
Structure CKPatchEdge | Structure holding the details of the edge of a patch
Structure CKStats | Profiling Statistics.
Class CKStreamWriter | Handle the saving of .cmo/.nmo files in stream (memory,file,etc..).
Structure CKTVPatch | Structure holding the texture coordinates details of a patch
Class CKUICallbackStruct | Typedef of the context callback structure.
Structure CKVideoInfo | Information on a video file
Structure CKWaveFormat | To Document
Class CKWaveSound3DSettings | To Document 3D Sound settings
Class CKWaveSoundSettings |
Structure ImpactDesc | Returned Information about a collision
Structure Vx2DCapsDesc | 2D Capabilities of a render driver
Structure Vx3DCapsDesc | 3D Capabilities of a render driver
Structure VxDirectXData | DirectX specific data.
Structure VxDisplayMode | Display Mode Description
Class VxDrawPrimitiveDataSimple | The VxDrawPrimitiveData is used by CKRenderContext::DrawPrimitive to describe the vertices to render.
Structure VxDriverDesc | Render Driver description
Structure VxIntersectionDesc | Intersection description.
Structure VxSpriteRenderOptions | Sprite rendering options structure
Structure VxStats | Rendering Profiling results.
Structure VxTransformData | Vertices to transform to screen coordinates
Class VxUV | Texture Coordinates structure.

See Also

Virtools SDK Reference


CKAttributeVal

Structure CKAttributeVal

struct CKAttributeVal {
CKAttributeType AttribType;
CK_ID Parameter;
}

Storage of couple (Attribute,Parameter)

Members

AttribType | Type of Attribute
Parameter | ID of the associated parameter

Remarks

This structure is used to gain acces to the list of attribute on a CKBeObject through the function CKBeObject::GetAttributeList.

See Also

CKBeObject::GetAttributeList,CKAttributeManager


CKBehaviorContext

Class CKBehaviorContext

Structure passed to behavior execution and callback functions

Remarks

The execution function of a behavior is given this structure as a argument to have acces to frequently used global objects (context,level,manager,etc...) the callback function is also passed this structure in which the reason for callback is given in CallbackMessage.

Groups

Data Members
Member Variable AttributeManager | A Pointer to the AttributeManager
Member Variable Behavior | Pointer to executed behavior
Member Variable CallbackMessage | Specific to behavior callbck function, reason for
Member Variable Context | The CKContext this behavior belongs to.
Member Variable CurrentLevel | A Pointer to the current CKLevel
Member Variable CurrentRenderContext | A Pointer to the main CKRenderContext
Member Variable CurrentScene | A Pointer to the current CKScene
Member Variable DeltaTime | Last Delta-Time in milliseconds since previous frame.
Member Variable MessageManager | A Pointer to the MessageManager
Member Variable ParameterManager | A Pointer to the ParameterManager
Member Variable PreviousScene | A Pointer to the previous CKScene if available
Member Variable TimeManager | A Pointer to the TimeManager
Constructors
Method CKBehaviorContext | Description: Builds an instance of the object This builds an instance of the object out of its parameters.

See Also

Writing the Execution Function,Writing the Behavior Callback Function,CKBehavior::SetCallbackFunction


CKBehaviorContext::AttributeManager

Member Variable CKBehaviorContext::AttributeManager

CKAttributeManager* CKBehaviorContext::AttributeManager

Remarks

A Pointer to the AttributeManager


CKBehaviorContext::Behavior

Member Variable CKBehaviorContext::Behavior

CKBehavior* CKBehaviorContext::Behavior

Remarks

Pointer to executed behavior


CKBehaviorContext::CallbackMessage

Member Variable CKBehaviorContext::CallbackMessage

CKDWORD CKBehaviorContext::CallbackMessage

Remarks

Specific to behavior callbck function, reason for


CKBehaviorContext::Context

Member Variable CKBehaviorContext::Context

CKContext* CKBehaviorContext::Context

Remarks

The CKContext this behavior belongs to.


CKBehaviorContext::CurrentLevel

Member Variable CKBehaviorContext::CurrentLevel

CKLevel* CKBehaviorContext::CurrentLevel

Remarks

A Pointer to the current CKLevel


CKBehaviorContext::CurrentRenderContext

Member Variable CKBehaviorContext::CurrentRenderContext

CKRenderContext* CKBehaviorContext::CurrentRenderContext

Remarks

A Pointer to the main CKRenderContext


CKBehaviorContext::CurrentScene

Member Variable CKBehaviorContext::CurrentScene

CKScene* CKBehaviorContext::CurrentScene

Remarks

A Pointer to the current CKScene


CKBehaviorContext::DeltaTime

Member Variable CKBehaviorContext::DeltaTime

float CKBehaviorContext::DeltaTime

Remarks

Last Delta-Time in milliseconds since previous frame.


CKBehaviorContext::MessageManager

Member Variable CKBehaviorContext::MessageManager

CKMessageManager* CKBehaviorContext::MessageManager

Remarks

A Pointer to the MessageManager


CKBehaviorContext::ParameterManager

Member Variable CKBehaviorContext::ParameterManager

CKParameterManager* CKBehaviorContext::ParameterManager

Remarks

A Pointer to the ParameterManager


CKBehaviorContext::PreviousScene

Member Variable CKBehaviorContext::PreviousScene

CKScene* CKBehaviorContext::PreviousScene

Remarks

A Pointer to the previous CKScene if available


CKBehaviorContext::TimeManager

Member Variable CKBehaviorContext::TimeManager

CKTimeManager* CKBehaviorContext::TimeManager

Remarks

A Pointer to the TimeManager


CKBehaviorContext::CKBehaviorContext

Method CKBehaviorContext::CKBehaviorContext

CKBehaviorContext::CKBehaviorContext()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKFileInfo

Structure CKFileInfo

struct CKFileInfo
{
CKDWORD ProductVersion;
CKDWORD ProductBuild;
CKDWORD FileWriteMode;
CKDWORD FileVersion;
CKDWORD CKVersion;
CKDWORD FileSize;
CKDWORD ObjectCount;
CKDWORD ManagerCount;
CKDWORD MaxIDSaved;
CKDWORD Crc;
CKDWORD Hdr1PackSize;
CKDWORD Hdr1UnPackSize;
CKDWORD DataPackSize;
CKDWORD DataUnPackSize;
}

Structure containing informations about a .cmo or .nmo file.

Members

CKVersion | Version of CK when file was saved.
Crc | Crc of data
DataPackSize | Reserved
DataUnPackSize | Reserved
FileSize | Size of file in bytes.
FileVersion | Version of file format when file was saved.
FileWriteMode | Options used to save this file. (CK_FILE_WRITEMODE)
Hdr1PackSize | Reserved
Hdr1UnPackSize | Reserved
ManagerCount | Number of managers which saved data in the file.
MaxIDSaved | Maximum Object identifier saved
ObjectCount | Number of objects stored in the file.
ProductBuild | Virtools Build Number.
ProductVersion | Virtools Version (Dev/Creation). (CK_VIRTOOLS_VERSION)

Remarks

The CKContext::GetFileInfo returns this structure about a given file giving size,compression and version info.

See Also

CKContext::GetFileInfo


CKFileObject

Class CKFileObject

Description of a loaded/saved object.

Remarks

When saving or loading a file, each object is assigned a description that can be used by managers to do remapping or data modification.

Groups

Data Members
Member Variable CreatedObject | ID of the object being created
Member Variable Data | A CKStateChunk that contains object information
Member Variable FileIndex | Position of the object data inside uncompressed file buffer
Member Variable Name | Name of the Object
Member Variable Object | ID of the object being load/saved (as it will be/was saved in the file)
Member Variable ObjectCid | Class Identifier of the object
Member Variable ObjPtr | A pointer to the object itself (as CreatedObject when loading)
Member Variable Options | When loading an object it may be renamed , use to replace another object
Member Variable PostPackSize | When compressed chunk by chunk : size of Data after compression
Member Variable PrePackSize | When compressed chunk by chunk : size of Data before compression
Member Variable SaveFlags | Flags used when this object was saved.
Type Definitions
Enumerated Type CK_FO_OPTIONS | Options that will be used to create this object...

See Also

CKObject::Save,CKObject::Load


CKFileObject::CreatedObject

Member Variable CKFileObject::CreatedObject

CK_ID CKFileObject::CreatedObject

Remarks

ID of the object being created


CKFileObject::Data

Member Variable CKFileObject::Data

CKStateChunk* CKFileObject::Data

Remarks

A CKStateChunk that contains object information


CKFileObject::FileIndex

Member Variable CKFileObject::FileIndex

int CKFileObject::FileIndex

Remarks

Position of the object data inside uncompressed file buffer


CKFileObject::Name

Member Variable CKFileObject::Name

CKSTRING CKFileObject::Name

Remarks

Name of the Object


CKFileObject::Object

Member Variable CKFileObject::Object

CK_ID CKFileObject::Object

Remarks

ID of the object being load/saved (as it will be/was saved in the file)


CKFileObject::ObjectCid

Member Variable CKFileObject::ObjectCid

CK_CLASSID CKFileObject::ObjectCid

Remarks

Class Identifier of the object


CKFileObject::ObjPtr

Member Variable CKFileObject::ObjPtr

CKObject* CKFileObject::ObjPtr

Remarks

A pointer to the object itself (as CreatedObject when loading)


CKFileObject::Options

Member Variable CKFileObject::Options

CK_FO_OPTIONS CKFileObject::Options

Remarks

When loading an object it may be renamed , use to replace another object


CKFileObject::PostPackSize

Member Variable CKFileObject::PostPackSize

int CKFileObject::PostPackSize

Remarks

When compressed chunk by chunk : size of Data after compression


CKFileObject::PrePackSize

Member Variable CKFileObject::PrePackSize

int CKFileObject::PrePackSize

Remarks

When compressed chunk by chunk : size of Data before compression


CKFileObject::SaveFlags

Member Variable CKFileObject::SaveFlags

CKDWORD CKFileObject::SaveFlags

Remarks

Flags used when this object was saved.


CKFileObject::CK_FO_OPTIONS

Enumerated Type CKFileObject::CK_FO_OPTIONS

enum CK_FO_OPTIONS {
CK_FO_DEFAULT = 0,
CK_FO_RENAMEOBJECT,
CK_FO_REPLACEOBJECT,
CK_FO_DONTLOADOBJECT,
}

Members

CK_FO_DEFAULT | Default behavior : a new object will be created with the name stored in CKFileObject
CK_FO_DONTLOADOBJECT | Object chunk will not be read either because it is a reference or because the loaded object already exist in the current level and the user choose to keep the existing one.
CK_FO_RENAMEOBJECT | Renaming : a new object will be created with the name stored in CKFileObject + a integer value XXX to ensure its uniqueness
CK_FO_REPLACEOBJECT | Do not create a new object, instead use an existing one which CK_ID is given by CreatedObject to load the chunk on

Remarks

Options that will be used to create this object...


CKFilePluginDependencies

Structure CKFilePluginDependencies

class CKFilePluginDependencies {
public:
int m_PluginCategory;
XArray<CKGUID> m_Guids;
XBitArray ValidGuids;
}

List of Plugins guids used by a file.

Members

m_Guids
m_PluginCategory
ValidGuids

Remarks

When saving a file, a list of the plugins needed

See Also

CKFile::GetMissingPlugins


CKFloorPoint

Class CKFloorPoint

Returned Information about a nearest floor

Remarks

This structure will be filled when calling CKFloorManager::GetNearestFloors with the details about floor entities that are below and above the requested position.

class CKFloorPoint {
public:
    CK_ID       m_UpFloor;
    int         m_UpFaceIndex;
    VxVector    m_UpNormal;
    float       m_UpDistance;

    CK_ID       m_DownFloor;
    int         m_DownFaceIndex;
    VxVector    m_DownNormal;
    float       m_DownDistance;
};

Groups

Data Members
Member Variable m_DownDistance | Distance from point to lower floor.
Member Variable m_DownFaceIndex | Index of the face below the point.
Member Variable m_DownFloor | CK_ID of the 3dEntity below the point
Member Variable m_DownNormal | Normal vector
Member Variable m_UpDistance | Distance from point to upper floor.
Member Variable m_UpFaceIndex | Index of the face above the point.
Member Variable m_UpFloor | CK_ID of the 3dEntity above the point
Member Variable m_UpNormal | Normal vector

See Also

CKFloorManager,CKFloorManager::GetNearestFloors


CKFloorPoint::m_DownDistance

Member Variable CKFloorPoint::m_DownDistance

float CKFloorPoint::m_DownDistance

Remarks

Distance from point to lower floor.


CKFloorPoint::m_DownFaceIndex

Member Variable CKFloorPoint::m_DownFaceIndex

int CKFloorPoint::m_DownFaceIndex

Remarks

Index of the face below the point.


CKFloorPoint::m_DownFloor

Member Variable CKFloorPoint::m_DownFloor

CK_ID CKFloorPoint::m_DownFloor

Remarks

CK_ID of the 3dEntity below the point


CKFloorPoint::m_DownNormal

Member Variable CKFloorPoint::m_DownNormal

VxVector CKFloorPoint::m_DownNormal

Remarks

Normal vector


CKFloorPoint::m_UpDistance

Member Variable CKFloorPoint::m_UpDistance

float CKFloorPoint::m_UpDistance

Remarks

Distance from point to upper floor.


CKFloorPoint::m_UpFaceIndex

Member Variable CKFloorPoint::m_UpFaceIndex

int CKFloorPoint::m_UpFaceIndex

Remarks

Index of the face above the point.


CKFloorPoint::m_UpFloor

Member Variable CKFloorPoint::m_UpFloor

CK_ID CKFloorPoint::m_UpFloor

Remarks

CK_ID of the 3dEntity above the point


CKFloorPoint::m_UpNormal

Member Variable CKFloorPoint::m_UpNormal

VxVector CKFloorPoint::m_UpNormal

Remarks

Normal vector


CKListenerSettings

Class CKListenerSettings

To Document Listener Settings

Groups

Data Members
Member Variable m_DistanceFactor |
Member Variable m_DopplerFactor |
Member Variable m_GlobalGain |
Member Variable m_PriorityBias |
Member Variable m_RollOff |
Member Variable m_SoftwareSources |
Constructors
Method CKListenerSettings | Description: Builds an instance of the object This builds an instance of the object out of its parameters.


CKListenerSettings::m_DistanceFactor

Member Variable CKListenerSettings::m_DistanceFactor

float CKListenerSettings::m_DistanceFactor


CKListenerSettings::m_DopplerFactor

Member Variable CKListenerSettings::m_DopplerFactor

float CKListenerSettings::m_DopplerFactor


CKListenerSettings::m_GlobalGain

Member Variable CKListenerSettings::m_GlobalGain

float CKListenerSettings::m_GlobalGain


CKListenerSettings::m_PriorityBias

Member Variable CKListenerSettings::m_PriorityBias

float CKListenerSettings::m_PriorityBias


CKListenerSettings::m_RollOff

Member Variable CKListenerSettings::m_RollOff

float CKListenerSettings::m_RollOff


CKListenerSettings::m_SoftwareSources

Member Variable CKListenerSettings::m_SoftwareSources

unsigned int CKListenerSettings::m_SoftwareSources


CKListenerSettings::CKListenerSettings

Method CKListenerSettings::CKListenerSettings

CKListenerSettings::CKListenerSettings()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKOperationDesc

Structure CKOperationDesc

struct CKOperationDesc {
CKGUID OpGuid;
CKGUID P1Guid;
CKGUID P2Guid;
CKGUID ResGuid;
CK_PARAMETEROPERATION Fct;
}

Description of an available parametric operation.

Members

Fct | Function to call to process the operation.
OpGuid | Operation GUID
P1Guid | Input Parameter 1 GUID
P2Guid | Input Parameter 2 GUID
ResGuid | Output Parameter GUID

Remarks

The CKParameterManager::GetAvailableOperationsDesc fills an array of this structure according to search criteria. The 4 CKGUID defines the parameter operation and the Fct member is the function the engine will call to process the operation.

See Also

CKParameterManager::GetAvailableOperationsDesc


CKParameterTypeDesc

Class CKParameterTypeDesc

Description of a parameter type.

Remarks

This structure is used to register a new parameter type or can be retrieve later with the CKParameterManager::GetParameterTypeDescription to get the description of an existing parameter type. Members marked as (used internally) are read only If used to create a new parameter type at least Guid,TypeName and DefaultSize must be given (See Creating New Parameter Types papers for sample usages ) The only thing that can be changed on a parameter type after its creation is its dwFlags member

Callback function prototypes:

typedef CKERROR (*CK_PARAMETERCREATEDEFAULTFUNCTION)(CKParameter*);
typedef void    (*CK_PARAMETERDELETEFUNCTION)(CKParameter*);
typedef void    (*CK_PARAMETERCHECKFUNCTION)(CKParameter*);
typedef void    (*CK_PARAMETERREMAPFUNCTION)(CKParameter*,CKDependenciesContext&);
typedef void    (*CK_PARAMETERCOPYFUNCTION)(CKParameter*,CKParameter*);
typedef void    (*CK_PARAMETERSAVELOADFUNCTION)(CKParameter* param,CKStateChunk **chunk,CKBOOL load);
typedef int     (*CK_PARAMETERSTRINGFUNCTION)(CKParameter* param,CKSTRING ValueString,CKBOOL ReadFromString);
typedef WIN_HANDLE  (*CK_PARAMETERUICREATORFUNCTION)(CKParameter* param,WIN_HANDLE ParentWindow,CKRECT *rect);

struct CKParameterTypeDesc {
    CKParameterType     Index;
    CKGUID              Guid;
    CKGUID              DerivedFrom;
    XString             TypeName;
    int                 Valid;
    int                 DefaultSize;
    CK_PARAMETERCREATEDEFAULTFUNCTION   CreateDefaultFunction;
    CK_PARAMETERDELETEFUNCTION          DeleteFunction;
    CK_PARAMETERSAVELOADFUNCTION        SaveLoadFunction;
    CK_PARAMETERCHECKFUNCTION           CheckFunction;
    CK_PARAMETERCOPYFUNCTION            CopyFunction;
    CK_PARAMETERSTRINGFUNCTION          StringFunction;
    CK_PARAMETERUICREATORFUNCTION       UICreatorFunction;
    CKPluginEntry*      CreatorDll;
    CKDWORD             dwParam;
    CKDWORD             dwFlags;
    CKDWORD             Cid;
    XBitArray           DerivationMask;
    CKGUID              Saver_Manager;
};

Groups

Data Members
Member Variable CheckFunction | Function use to check parameters for object utilisation
Member Variable Cid | Special case for parameter types that refer to CKObjects => corresponding class ID of the object
Member Variable CopyFunction | Function use to copy the value from a parameter to another (Optionnal).
Member Variable CreateDefaultFunction | Creation function called each time a parameter of this type is created.
Member Variable CreatorDll | An index to the registred Dlls from which this type was declared (used internally)
Member Variable DefaultSize | Default size (in bytes) of parameters ofthis type
Member Variable DeleteFunction | Deletion function called each time a parameter of this type is deleted.
Member Variable DerivationMask | Updated by parameter manager...: Bitmask for all class this type can be derived from directly or indirectly (used internally)
Member Variable DerivedFrom | GUID of the parameter type from which this type is derivated
Member Variable dwFlags | Flags specifying special settings for this parameter type (CK_PARAMETERTYPE_FLAGS)
Member Variable dwParam | An application reserved DWORD for placing parameter type specific data.
Member Variable GetCustomObjectFunction | for custom parameters, in use with CustomObjectParameterDialog if iIndex<0 || oObjec==0, the function shall return object count otherwise, shall return 0 if failed, 1 otherwise, adress of an existing instance of CKCustomParameter should be given
Member Variable Guid | Glocal Unique identifier to identify this type
Member Variable Index | Index in the parameter array (used internally)
Member Variable SaveLoadFunction | Function use to save or load parameters of this type. Only needed if special processing should be done during load and save operations.
Member Variable Saver_Manager | Int Manager GUID
Member Variable StringFunction | Function to convert a parameter to or from a string.
Member Variable TypeName | Name of this type
Member Variable UICreatorFunction | Function called to create the dialog box when editing this type of parameter.
Member Variable Valid | (used internally)

See Also

Creating New Parameter Types,CKParameterManager::RegisterParameterType,Pre-Registred Parameter Types


CKParameterTypeDesc::CheckFunction

Member Variable CKParameterTypeDesc::CheckFunction

CK_PARAMETERCHECKFUNCTION CKParameterTypeDesc::CheckFunction

Remarks

Function use to check parameters for object utilisation


CKParameterTypeDesc::Cid

Member Variable CKParameterTypeDesc::Cid

CKDWORD CKParameterTypeDesc::Cid

Remarks

Special case for parameter types that refer to CKObjects => corresponding class ID of the object


CKParameterTypeDesc::CopyFunction

Member Variable CKParameterTypeDesc::CopyFunction

CK_PARAMETERCOPYFUNCTION CKParameterTypeDesc::CopyFunction

Remarks

Function use to copy the value from a parameter to another (Optionnal).


CKParameterTypeDesc::CreateDefaultFunction

Member Variable CKParameterTypeDesc::CreateDefaultFunction

CK_PARAMETERCREATEDEFAULTFUNCTION CKParameterTypeDesc::CreateDefaultFunction

Remarks

Creation function called each time a parameter of this type is created.


CKParameterTypeDesc::CreatorDll

Member Variable CKParameterTypeDesc::CreatorDll

CKPluginEntry* CKParameterTypeDesc::CreatorDll

Remarks

An index to the registred Dlls from which this type was declared (used internally)


CKParameterTypeDesc::DefaultSize

Member Variable CKParameterTypeDesc::DefaultSize

int CKParameterTypeDesc::DefaultSize

Remarks

Default size (in bytes) of parameters ofthis type


CKParameterTypeDesc::DeleteFunction

Member Variable CKParameterTypeDesc::DeleteFunction

CK_PARAMETERDELETEFUNCTION CKParameterTypeDesc::DeleteFunction

Remarks

Deletion function called each time a parameter of this type is deleted.


CKParameterTypeDesc::DerivationMask

Member Variable CKParameterTypeDesc::DerivationMask

XBitArray CKParameterTypeDesc::DerivationMask

Remarks

Updated by parameter manager...: Bitmask for all class this type can be derived from directly or indirectly (used internally)


CKParameterTypeDesc::DerivedFrom

Member Variable CKParameterTypeDesc::DerivedFrom

CKGUID CKParameterTypeDesc::DerivedFrom

Remarks

GUID of the parameter type from which this type is derivated


CKParameterTypeDesc::dwFlags

Member Variable CKParameterTypeDesc::dwFlags

CKDWORD CKParameterTypeDesc::dwFlags

Remarks

Flags specifying special settings for this parameter type (CK_PARAMETERTYPE_FLAGS)


CKParameterTypeDesc::dwParam

Member Variable CKParameterTypeDesc::dwParam

CKDWORD CKParameterTypeDesc::dwParam

Remarks

An application reserved DWORD for placing parameter type specific data.


CKParameterTypeDesc::GetCustomObjectFunction

Member Variable CKParameterTypeDesc::GetCustomObjectFunction

CK_PARAMETERGETCUSTOMOBJECTFUNCTION CKParameterTypeDesc::GetCustomObjectFunction

Remarks

for custom parameters, in use with CustomObjectParameterDialog if iIndex<0 || oObjec==0, the function shall return object count otherwise, shall return 0 if failed, 1 otherwise, adress of an existing instance of CKCustomParameter should be given


CKParameterTypeDesc::Guid

Member Variable CKParameterTypeDesc::Guid

CKGUID CKParameterTypeDesc::Guid

Remarks

Glocal Unique identifier to identify this type


CKParameterTypeDesc::Index

Member Variable CKParameterTypeDesc::Index

CKParameterType CKParameterTypeDesc::Index

Remarks

Index in the parameter array (used internally)


CKParameterTypeDesc::SaveLoadFunction

Member Variable CKParameterTypeDesc::SaveLoadFunction

CK_PARAMETERSAVELOADFUNCTION CKParameterTypeDesc::SaveLoadFunction

Remarks

Function use to save or load parameters of this type. Only needed if special processing should be done during load and save operations.


CKParameterTypeDesc::Saver_Manager

Member Variable CKParameterTypeDesc::Saver_Manager

CKGUID CKParameterTypeDesc::Saver_Manager

Remarks

Int Manager GUID


CKParameterTypeDesc::StringFunction

Member Variable CKParameterTypeDesc::StringFunction

CK_PARAMETERSTRINGFUNCTION CKParameterTypeDesc::StringFunction

Remarks

Function to convert a parameter to or from a string.


CKParameterTypeDesc::TypeName

Member Variable CKParameterTypeDesc::TypeName

XString CKParameterTypeDesc::TypeName

Remarks

Name of this type


CKParameterTypeDesc::UICreatorFunction

Member Variable CKParameterTypeDesc::UICreatorFunction

CK_PARAMETERUICREATORFUNCTION CKParameterTypeDesc::UICreatorFunction

Remarks

Function called to create the dialog box when editing this type of parameter.


CKParameterTypeDesc::Valid

Member Variable CKParameterTypeDesc::Valid

int CKParameterTypeDesc::Valid

Remarks

(used internally)


CKPatch

Class CKPatch

Structure holding the details of a patch

Remarks

This structure carries the details associated with patch, such as type, smoothing group, edges, vertices, vectors, material. The corner control points of a patch are called verts. The edge control points and interiors are called vecs Interior points are automatically computed when tesselating a patch but the result is stored inside the vecs array. The smoothing group is a DWORD mask, if the binary AND of the smoothing group value of two adjacent patches is not 0 then they are smoothed together otherwise there is a sharp edge between the two patches. The default value of a patch smoothing group is 0xFFFFFFFF which means all patches are smoothed together.

Groups

Data Members
Member Variable edge | Indices of the 3 or 4 edges of this patches
Member Variable interior | Can have three or four interior vecs.
Member Variable Material | Material CK_ID for this patch. (CKPatchMesh::SetPatchMaterial)
Member Variable SmoothingGroup | Smoothing group of this patch,
Member Variable type | CK_PATCH_FLAGS ( 3 for a tri patch , 4 for a quad patch)
Member Variable v | 3 or 4 indices of the corner verts.
Member Variable vec | 6 or 8 indices of the edge vecs.
Constructors
Method CKPatch | Description: Builds an instance of the object This builds an instance of the object out of its parameters.

See Also

CKPatchMesh,CKPatchEdge,CKTVPatch


CKPatch::edge

Member Variable CKPatch::edge

short int CKPatch::edge[4]

Remarks

Indices of the 3 or 4 edges of this patches


CKPatch::interior

Member Variable CKPatch::interior

short int CKPatch::interior[4]

Remarks

Can have three or four interior vecs.


CKPatch::Material

Member Variable CKPatch::Material

CK_ID CKPatch::Material

Remarks

Material CK_ID for this patch. (CKPatchMesh::SetPatchMaterial)


CKPatch::SmoothingGroup

Member Variable CKPatch::SmoothingGroup

CKDWORD CKPatch::SmoothingGroup

Remarks

Smoothing group of this patch,


CKPatch::type

Member Variable CKPatch::type

CKDWORD CKPatch::type

Remarks

CK_PATCH_FLAGS ( 3 for a tri patch , 4 for a quad patch)


CKPatch::v

Member Variable CKPatch::v

short int CKPatch::v[4]

Remarks

3 or 4 indices of the corner verts.


CKPatch::vec

Member Variable CKPatch::vec

short int CKPatch::vec[8]

Remarks

6 or 8 indices of the edge vecs.


CKPatch::CKPatch

Method CKPatch::CKPatch

CKPatch::CKPatch()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKPatchEdge

Structure CKPatchEdge

struct CKPatchEdge {
short int v1;
short int vec12;
short int vec21;
short int v2;
short int patch1;
short int patch2;
}

Structure holding the details of the edge of a patch

Members

patch1 | Index of first patch
patch2 | Index of second patch
v1 | Index of first corner vert
v2 | Index of second corner vert
vec12 | First vec between v1 and v2
vec21 | Second vec between v1 and v2

Remarks

A patch edge holds the index of the verts and vecs it is made of. It also contains the two patches that share this edge (patch2 is -1) when this edge belongs to only one patch.

See Also

CKPatchMesh,CKPatch,CKTVPatch.


CKStats

Structure CKStats

#define MAX_USER_PROFILE 8
struct CKStats {
float TotalFrameTime;
float EstimatedInterfaceTime;
float ProcessTime;
float RenderTime;
float ParametricOperations;
float TotalBehaviorExecution;
float AnimationManagement;
float IKManagement;
float BehaviorCodeExecution;

int ActiveObjectsExecuted;
int BehaviorsExecuted;
int BuildingBlockExecuted;
int BehaviorLinksParsed;
int BehaviorDelayedLinks;

float UserProfiles[MAX_USER_PROFILE];
}

Profiling Statistics.

Members

ActiveObjectsExecuted | Number of Objects executed last frame
AnimationManagement | During Behavior Execution time : Time taken in character animations processing
BehaviorCodeExecution | During Behavior Execution time : Time taken in by code execution of behaviors
BehaviorDelayedLinks | Total number of BehaviorLinks that have been stored as active in N frame
BehaviorLinksParsed | Total number of BehaviorLinks Parsed
BehaviorsExecuted | TotalBehaviorExecuted last frame
BuildingBlockExecuted | TotalBuildingBlock last frame
EstimatedInterfaceTime | Estimated time for windows and interface (TotalFrameTime - (ProcessTime+RenderTime))
IKManagement | During Behavior Execution time : Time taken in IK solving
ParametricOperations | Time taken by parametric operations last frame
ProcessTime | Time during last call to CKProcess
RenderTime | Time for rendering last scene
TotalBehaviorExecution | Total behavior Execution time
TotalFrameTime | Time elapsed since last frame
UserProfiles |

Remarks

The CKContext::GetProfileStats method can be called in order to retrieve statistic about last frame processing. Times are store in milliseconds.

See Also

CKContext::EnableProfiling,CKContext::GetProfileStats,CKContext::UserProfileStart,CKContext::UserProfileEnd


CKStreamWriter

Class CKStreamWriter

Handle the saving of .cmo/.nmo files in stream (memory,file,etc..).

Remarks

A CMO,NMO or NMS is saved using a standard file by default but this the save operation can made in any stream (memory , file) provided that a instance of this class is given to handle the different operation. The various method of this class should be overriden if a inheritated class and will be called by the framework when trying to save a file.

Groups

Operations
Pure Virtual Method Method Close | Called by the framework when the stream can be closed.
Pure Virtual Method Method IsValid | Called by the framework when starting to save a composition.
Pure Virtual Method Method Open | Called by the framework when opening a stream to write to
Pure Virtual Method Method Write | Called by the framework to write data to the stream.
Destructors
Virtual Method Method ~CKStreamWriter | Description: Destroys the object This destroys all the subordinate objects for this object.

Example

//The default file saver for a CKFile
struct CKFileStreamWriter : public CKStreamWriter {
    CKFileStreamWriter() {
        m_Filename = NULL;
    }
    virtual ~CKFileStreamWriter() {
    }
    virtual XBOOL Open(CKSTRING filename) {
        m_Filename = filename;
        return m_File.Open(filename,VxFile::WRITEONLY);
    }
    virtual XDWORD Write(const void* iBuffer,XDWORD iSize) {
        return m_File.Write(iBuffer,iSize);
    }
    virtual XBOOL Close() {
        m_Filename = NULL;
        return m_File.Close();
    }
    virtual XBOOL IsValid(CKSTRING filename) {
        if (!m_File.Open(filename,VxFile::APPEND)) {
            return FALSE;
        }
        m_File.Close();
        return TRUE;
    }
    CKSTRING m_Filename;
    VxFile   m_File;
};

//A writer to a memory buffer
struct CKMemoryStreamWriter : public CKStreamWriter {
    CKMemoryStreamWriter() {
    }
    virtual ~CKMemoryStreamWriter() {
    }
    virtual XBOOL Open(CKSTRING filename) {
        m_Buffer.Resize(0);
    }
    virtual XDWORD Write(const void* iBuffer,XDWORD iSize) {
        XDWORD OldSize = m_Buffer.Size();
        m_Buffer.Resize(OldSize + iSize);
        memcpy(m_Buffer.Begin()+OldSize, iBuffer, iSize);
    }
    virtual XBOOL Close() {
    }
    virtual XBOOL IsValid(CKSTRING filename) {
        return TRUE;
    }
    XArray<BYTE> m_Buffer;
};

//Usage example
//Saving a content in memory

CKObjectArray* objectToSave;
CKStreamWriter* myWriter = new CKMemoryStreamWriter;

//Install our writer
g_Context->SetStreamWriter(myWriter);

//Save Data : No file will be created instead we will call
//the writer methods
g_Context->Save("testFile.cmo",objectToSave);

//Restore default saving behavior
g_Context->SetStreamWriter(NULL);
//And free our saving object
delete myWriter;

See Also

CKContext::SetStreamWriter


CKStreamWriter::Close

Pure Virtual Method Method CKStreamWriter::Close

virtual XBOOL CKStreamWriter::Close()

Called by the framework when the stream can be closed.


CKStreamWriter::IsValid

Pure Virtual Method Method CKStreamWriter::IsValid

virtual XBOOL CKStreamWriter::IsValid(CKSTRING filename)

Called by the framework when starting to save a composition.

Remarks

This method is called to ensure that the save operation can continue. For example to check that a file can be written. The filename that given in argument is only useful if this writer handles writing to a file otherwise it can be ignored. It should return TRUE if the save operation can continue.


CKStreamWriter::Open

Pure Virtual Method Method CKStreamWriter::Open

virtual XBOOL CKStreamWriter::Open(CKSTRING filename)

Called by the framework when opening a stream to write to

Remarks

The filename that given in argument is only useful if this writer handles writing to a file otherwise it can be ignored.


CKStreamWriter::Write

Pure Virtual Method Method CKStreamWriter::Write

virtual XDWORD CKStreamWriter::Write(const void* iBuffer,XDWORD iSize)

Called by the framework to write data to the stream.

Remarks

This method should return the number of bytes actually written.


CKStreamWriter::~CKStreamWriter

Virtual Method Method CKStreamWriter::~CKStreamWriter

virtual CKStreamWriter::~CKStreamWriter()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


CKTVPatch

Structure CKTVPatch

struct CKTVPatch {
short int tv[4];
}

Structure holding the texture coordinates details of a patch

Members

tv

Index of textures coordinates

Remarks

The CKTVPatch structure holds the 3 or 4 indices of the texture coordinates of the corner points of a patch.

See Also

CKPatch,CKPatchMesh


CKUICallbackStruct

Class CKUICallbackStruct

Typedef of the context callback structure.

Remarks

If installed through the CKContext::SetInterfaceMode function, a callback function can be called for each of the following event (Reason)

The interpretation of this structure is then dependent on the received Reason and is up to the callback function

Groups

Data Members
Member Variable Param3
Member Variable Reason
CKUIM_LOADSAVEPROGRES | 1, This message is sent by the framework when loading a cmo/nmo/vmo file param.NbObjetsLoaded: current number of loaded objects param.NbObjetsToLoad: total number of objects to load
CKUIM_OUTTOCONSOLE | 3, param.DoBeep : TRUE/FALSE is a sound should be emitted when the message is displayed param.ConsoleString: String to output in a console
CKUIM_OUTTOINFOBAR | 4, param.ConsoleString: String to output in a info bar
CKUIM_SCENEADDEDTOLEVEL | 12, param.ObjectID: CK_ID of the scene that have been added to the level...
CKUIM_PROGRESSDIALOG | 19, Used when a lengthly process is operating and would like to provide the user with a visual feedback param.param1: current number of iteration (0xFFFFFFFF when starting , 0xFFFFFFFE for ending) param.param2: total number of iterations
Constructors
Method CKUICallbackStruct

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.

See Also

CKContext::SetInterfaceMode,CKUICALLBACKFCT


CKUICallbackStruct::Param3

Member Variable CKUICallbackStruct::Param3

CKDWORD CKUICallbackStruct::Param3


CKUICallbackStruct::Reason

Member Variable CKUICallbackStruct::Reason

CKDWORD CKUICallbackStruct::Reason

Remarks

CKUIM_LOADSAVEPROGRES | 1, This message is sent by the framework when loading a cmo/nmo/vmo file param.NbObjetsLoaded: current number of loaded objects param.NbObjetsToLoad: total number of objects to load
CKUIM_OUTTOCONSOLE | 3, param.DoBeep : TRUE/FALSE is a sound should be emitted when the message is displayed param.ConsoleString: String to output in a console
CKUIM_OUTTOINFOBAR | 4, param.ConsoleString: String to output in a info bar
CKUIM_SCENEADDEDTOLEVEL | 12, param.ObjectID: CK_ID of the scene that have been added to the level...
CKUIM_PROGRESSDIALOG | 19, Used when a lengthly process is operating and would like to provide the user with a visual feedback param.param1: current number of iteration (0xFFFFFFFF when starting , 0xFFFFFFFE for ending) param.param2: total number of iterations


CKUICallbackStruct::CKUICallbackStruct

Method CKUICallbackStruct::CKUICallbackStruct

CKUICallbackStruct::CKUICallbackStruct()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKVideoInfo

Structure CKVideoInfo

struct CKVideoInfo
{
float m_Duration;

int m_Width;
int m_Height;
CKBOOL m_IsInterlaced;
float m_ImagePerSec;
XString m_VideoFormat;

int m_AudioChannel;
int m_SamplingRate;
int m_SamplingSize;
XString m_AudioFormat;

CKBOOL m_IsValid;

int m_VideoInputFormatID;
}

Information on a video file

Members

m_AudioChannel | Sound Specific
m_AudioFormat | Readable Sound Format (Compression)
m_Duration |
m_Height | Image Height
m_ImagePerSec | Number of Images per second
m_IsInterlaced | Is the video interlaced
m_IsValid | Are the current info valid ?
m_SamplingRate | Number of Samples per second
m_SamplingSize | AvgBytesPerSec
m_VideoFormat | Readable Video Format (Compression)
m_VideoInputFormatID | Format actually used for video input.
m_Width | Video Specific

See Also

CKVideo


CKWaveFormat

Structure CKWaveFormat

struct CKWaveFormat
{
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
WORD wBitsPerSample;
WORD cbSize;
}

To Document

Members

cbSize
nAvgBytesPerSec
nBlockAlign
nChannels
nSamplesPerSec
wBitsPerSample
wFormatTag


CKWaveSound3DSettings

Class CKWaveSound3DSettings

To Document 3D Sound settings

Groups

Data Members
Member Variable m_HeadRelative |
Member Variable m_InAngle |
Member Variable m_MaxDistance |
Member Variable m_MinDistance |
Member Variable m_MuteAfterMax |
Member Variable m_OrientationDir |
Member Variable m_OrientationUp |
Member Variable m_OutAngle |
Member Variable m_OutsideGain |
Member Variable m_Position |
Member Variable m_Velocity |
Constructors
Method CKWaveSound3DSettings | Description: Builds an instance of the object This builds an instance of the object out of its parameters.


CKWaveSound3DSettings::m_HeadRelative

Member Variable CKWaveSound3DSettings::m_HeadRelative

CKWORD CKWaveSound3DSettings::m_HeadRelative


CKWaveSound3DSettings::m_InAngle

Member Variable CKWaveSound3DSettings::m_InAngle

float CKWaveSound3DSettings::m_InAngle


CKWaveSound3DSettings::m_MaxDistance

Member Variable CKWaveSound3DSettings::m_MaxDistance

float CKWaveSound3DSettings::m_MaxDistance


CKWaveSound3DSettings::m_MinDistance

Member Variable CKWaveSound3DSettings::m_MinDistance

float CKWaveSound3DSettings::m_MinDistance


CKWaveSound3DSettings::m_MuteAfterMax

Member Variable CKWaveSound3DSettings::m_MuteAfterMax

CKWORD CKWaveSound3DSettings::m_MuteAfterMax


CKWaveSound3DSettings::m_OrientationDir

Member Variable CKWaveSound3DSettings::m_OrientationDir

VxVector CKWaveSound3DSettings::m_OrientationDir


CKWaveSound3DSettings::m_OrientationUp

Member Variable CKWaveSound3DSettings::m_OrientationUp

VxVector CKWaveSound3DSettings::m_OrientationUp


CKWaveSound3DSettings::m_OutAngle

Member Variable CKWaveSound3DSettings::m_OutAngle

float CKWaveSound3DSettings::m_OutAngle


CKWaveSound3DSettings::m_OutsideGain

Member Variable CKWaveSound3DSettings::m_OutsideGain

float CKWaveSound3DSettings::m_OutsideGain


CKWaveSound3DSettings::m_Position

Member Variable CKWaveSound3DSettings::m_Position

VxVector CKWaveSound3DSettings::m_Position


CKWaveSound3DSettings::m_Velocity

Member Variable CKWaveSound3DSettings::m_Velocity

VxVector CKWaveSound3DSettings::m_Velocity


CKWaveSound3DSettings::CKWaveSound3DSettings

Method CKWaveSound3DSettings::CKWaveSound3DSettings

CKWaveSound3DSettings::CKWaveSound3DSettings()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


CKWaveSoundSettings

Class CKWaveSoundSettings

Groups

Data Members
Member Variable m_Eq | Sets the tonal equalization of a source. 0....1.0
Member Variable m_Gain | Sets and gets the playback gain of a sourc. 0.....1.0
Member Variable m_Pan | Sets the gains for multi-channel, non-spatialized sources. -1.0....1.0 default(0.0)
Member Variable m_Pitch | Sets and gets the playback pitch bend of a source. 0.5....2.0
Member Variable m_Priority | Sets and gets the playback pitch bend of a source. 0.0....1.0
Constructors
Method CKWaveSoundSettings | Description: Builds an instance of the object This builds an instance of the object out of its parameters.


CKWaveSoundSettings::m_Eq

Member Variable CKWaveSoundSettings::m_Eq

float CKWaveSoundSettings::m_Eq

Remarks

Sets the tonal equalization of a source. 0....1.0


CKWaveSoundSettings::m_Gain

Member Variable CKWaveSoundSettings::m_Gain

float CKWaveSoundSettings::m_Gain

Remarks

Sets and gets the playback gain of a sourc. 0.....1.0


CKWaveSoundSettings::m_Pan

Member Variable CKWaveSoundSettings::m_Pan

float CKWaveSoundSettings::m_Pan

Remarks

Sets the gains for multi-channel, non-spatialized sources. -1.0....1.0 default(0.0)


CKWaveSoundSettings::m_Pitch

Member Variable CKWaveSoundSettings::m_Pitch

float CKWaveSoundSettings::m_Pitch

Remarks

Sets and gets the playback pitch bend of a source. 0.5....2.0


CKWaveSoundSettings::m_Priority

Member Variable CKWaveSoundSettings::m_Priority

float CKWaveSoundSettings::m_Priority

Remarks

Sets and gets the playback pitch bend of a source. 0.0....1.0


CKWaveSoundSettings::CKWaveSoundSettings

Method CKWaveSoundSettings::CKWaveSoundSettings

CKWaveSoundSettings::CKWaveSoundSettings()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


ImpactDesc

Structure ImpactDesc

struct ImpactDesc {
CK_ID m_OwnerEntity;
CK_ID m_ObstacleTouched;
CK_ID m_SubObstacleTouched;
int m_TouchedVertex;
int m_TouchingVertex;
int m_TouchedFace;
int m_TouchingFace;
VxMatrix m_ImpactWorldMatrix;
VxVector m_ImpactPoint;
VxVector m_ImpactNormal;
CK_ID m_Entity;
}

Returned Information about a collision

Members

m_Entity | object tested that actually is in collision
m_ImpactNormal | Not Used Yet
m_ImpactPoint | Not Used Yet
m_ImpactWorldMatrix | World Matrix of the tested object before the collision occurs (the matrix of the previous frame if it can't find anything better.)
m_ObstacleTouched | Object with an attribute obstacle touched
m_OwnerEntity | Child (if any) of the object tested that actually is in collision (can be the body part of a character)
m_SubObstacleTouched | Child of the object touched that actually is in collision
m_TouchedFace | Nearest Face of the obstacle when the collision occurs
m_TouchedVertex | Nearest Vertex of the obstacle when the collision occurs
m_TouchingFace | Nearest Face of the tested object when the collision occurs
m_TouchingVertex | Nearest Vertex of the tested object when the collision occurs

Remarks

This structure will be filled according to the specified CK_IMPACTINFO flags when calling CollisionManager::DetectCollision

See Also

CollisionManager,CollisionManager::DetectCollision


Vx2DCapsDesc

Structure Vx2DCapsDesc

enum CKRST_RSTFAMILY {
CKRST_DIRECTX = 0UL,
CKRST_OPENGL = 1UL,
CKRST_SOFT = 3UL,
CKRST_ALCHEMY = 5UL,
CKRST_UNKNOWN = 4UL
}
struct Vx2DCapsDesc
{
CKRST_RSTFAMILY Family;
DWORD MaxVideoMemory;
DWORD AvailableVideoMemory;
DWORD Caps;
}

2D Capabilities of a render driver

Members

AvailableVideoMemory | Available video memory
Caps | General Caps
CKRST_ALCHEMY |
CKRST_DIRECTX |
CKRST_OPENGL |
CKRST_SOFT |
CKRST_UNKNOWN |
Family | Precises the type of driver implementation : CKRST_DIRECTX,CKRST_OPENGL,CKRST_SOFT or CKRST_UNKNOWN
MaxVideoMemory | Maximum video memory (Minus size already allocated for current display)

See Also

VxDriverDesc,CKRenderManager::GetRenderDriverDescription


Vx3DCapsDesc

Structure Vx3DCapsDesc

struct Vx3DCapsDesc
{
DWORD DevCaps;
DWORD RenderBpps;
DWORD ZBufferBpps;
DWORD StencilBpps;
DWORD StencilCaps;
DWORD MinTextureWidth;
DWORD MinTextureHeight;
DWORD MaxTextureWidth;
DWORD MaxTextureHeight;
DWORD MaxClipPlanes;
DWORD VertexCaps;
DWORD MaxActiveLights;
DWORD MaxNumberBlendStage;
DWORD MaxNumberTextureStage;
DWORD MaxTextureRatio;

DWORD TextureFilterCaps;
DWORD TextureAddressCaps;
DWORD TextureCaps;
DWORD MiscCaps;
DWORD AlphaCmpCaps;
DWORD ZCmpCaps;
DWORD RasterCaps;
DWORD SrcBlendCaps;
DWORD DestBlendCaps;
DWORD CKRasterizerSpecificCaps;
DWORD MaxIndexedBlendMatrices;
DWORD MaxVertexCountPerCall;
BOOL StretchRectSupport;
}

3D Capabilities of a render driver

Members

AlphaCmpCaps | Alpha compare function caps CKRST_CMPCAPS
CKRasterizerSpecificCaps | Specific to CKRasterizers CKRST_SPECIFICCAPS
DestBlendCaps | Destination Blend Caps CKRST_BLENDCAPS
DevCaps | Unused
MaxActiveLights | Max simulteanous active lights
MaxClipPlanes | Max number of clip planes
MaxIndexedBlendMatrices | Number of indexed Matrices
MaxNumberBlendStage | Max number of blend Stages
MaxNumberTextureStage | Max simulteanous textures
MaxTextureHeight | Max Height allowed for a texture
MaxTextureRatio | Max W/H ratio
MaxTextureWidth | Max Width allowed for a texture
MaxVertexCountPerCall | Max Number of vertex that can be stored in a vertex buffer
MinTextureHeight | Min Height allowed for a texture
MinTextureWidth | Min Width allowed for a texture
MiscCaps | Misc Caps CKRST_MISCCAPS
RasterCaps | Rasterization Caps CKRST_RASTERCAPS
RenderBpps | Supported pixel formats for a 3D device (combination of VxBpps)
SrcBlendCaps | Source Blend Caps CKRST_BLENDCAPS
StencilBpps | Supported pixel format for Stencil buffer (combination of VxBpps)
StencilCaps | Stencil Caps CKRST_STENCILCAPS
StretchRectSupport | Is StretchRect supported by rasterizer ?
TextureAddressCaps | Texture Addressing Caps CKRST_TADDRESSCAPS
TextureCaps | Texture Caps CKRST_TEXTURECAPS
TextureFilterCaps | Texture Filtering Caps CKRST_TFILTERCAPS
VertexCaps | Vertex Processing Caps : CKRST_VTXCAPS
ZBufferBpps | Supported pixel format for Zbuffer (combination of VxBpps)
ZCmpCaps | Z compare function caps CKRST_CMPCAPS

Remarks

+The Vx3DCapsDesc contains the 3D capabilities of a render driver. +3D Capabilities concerns texture size limitations, texture filtering capabilities, blending capabilities, monopass multi-texturing capabilities,etc. +The StencilBpps member is 0 for all render drivers except Directx7 and OpenGL based ones

See Also

VxDriverDesc,CKRenderManager::GetRenderDriverDescription,CKRenderManager::CreateRenderContext


VxDirectXData

Structure VxDirectXData

struct VxDirectXData {
void* DDBackBuffer;
void* DDPrimaryBuffer;
void* DDZBuffer;
void* DirectDraw;
void* Direct3D;
void* DDClipper;
void* D3DDevice;
void* D3DViewport;
DWORD DxVersion;
}

DirectX specific data.

Members

D3DDevice | Pointer to the IDirect3DDevice object
D3DViewport | Pointer to the IDirect3DViewport object
DDBackBuffer | Pointer to the back buffer surface
DDClipper | Pointer to the clipper object
DDPrimaryBuffer | Pointer to the front buffer (primary) surface
DDZBuffer | Pointer to the depth buffer surface
Direct3D | Pointer to the IDirect3D object
DirectDraw | Pointer to the IDirectDraw object
DxVersion | DirectX Version (0x0500 for DirectX 5.0 , 0x0700 for DirectX 7, etc..)

Remarks

The data stored in the structure are only available when using a DirectX based rasterizer (CKDX8Rasterizer,CKDX7Rasterizer or CKDX5Rasterizer) The type and version of objects depends on the version of the rasterizer used.

+CKDX9Rasterizer:

DDBackBuffer | LPDIRECT3DSURFACE9
DDPrimaryBuffer | NULL
DDZBuffer | LPDIRECT3DSURFACE9
DirectDraw | NULL
Direct3D | LPDIRECT3D9
DDClipper | NULL
D3DDevice | LPDIRECT3DDEVICE9
D3DViewport | NULL
DxVersion | 0x0900

+CKDX8Rasterizer:

DDBackBuffer | LPDIRECT3DSURFACE8
DDPrimaryBuffer | NULL
DDZBuffer | LPDIRECT3DSURFACE8
DirectDraw | NULL
Direct3D | LPDIRECT3D8
DDClipper | NULL
D3DDevice | LPDIRECT3DDEVICE8
D3DViewport | NULL
DxVersion | 0x0801

+CKDX7Rasterizer:

DDBackBuffer | LPDIRECTDRAWSURFACE7
DDPrimaryBuffer | LPDIRECTDRAWSURFACE7
DDZBuffer | LPDIRECTDRAWSURFACE7
DirectDraw | LPDIRECTDRAW7
Direct3D | LPDIRECT3D7
DDClipper | LPDIRECTDRAWCLIPPER
D3DDevice | LPDIRECT3DDEVICE7
D3DViewport | NULL
DxVersion | 0x0700

+CKDX5Rasterizer:

DDBackBuffer | LPDIRECTDRAWSURFACE3
DDPrimaryBuffer | LPDIRECTDRAWSURFACE3
DDZBuffer | LPDIRECTDRAWSURFACE3
DirectDraw | LPDIRECTDRAW2
Direct3D | LPDIRECT3D2
DDClipper | LPDIRECTDRAWCLIPPER
D3DDevice | LPDIRECT3DDEVICE2
D3DViewport | LPDIRECT3DVIEWPORT2
DxVersion | 0x0500

See Also

CKRenderContext::GetDirectXInfo


VxDisplayMode

Structure VxDisplayMode

struct VxDisplayMode
{
int Width;
int Height;
int Bpp;
int RefreshRate;
}

Display Mode Description

Members

Bpp | Number of bits per pixel.
Height | Height in pixel of the display mode.
RefreshRate | Refresh rate in Hertz.
Width | Width in pixel of the display mode.

Remarks

The VxDisplayMode contains the description of a fullscreen display mode.

See Also

CKRenderManager::GetRenderDriverDescription,CKRenderManager::GetRenderDriverCount,VxDriverDesc


VxDrawPrimitiveDataSimple

Class VxDrawPrimitiveDataSimple

The VxDrawPrimitiveData is used by CKRenderContext::DrawPrimitive to describe the vertices to render.

Subclasses

VxDrawPrimitiveData

Remarks

If the vertices are already transformed, they should be provided in a VxVector4 form in order the rasterizer to have all information about the vertices(x,y,z,rhw) to draw (rhw = Reciprocal homogenous w used for texture correction).

The flags member precises which vertex data is available (see CKRST_DP_VBUFFER in CKRST_DPFLAGS) how vertices should be processed.

This structure can also points to a vertex buffer (see CKRST_DPFLAGS

Groups

Data Members
Member Variable Colors |
Member Variable Flags | CKRST_DPFLAGS
Member Variable MatIndex |
Member Variable Normals |
Member Variable Positions |
Member Variable SpecularColors |
Member Variable TexCoord |
Member Variable TexCoords |
Member Variable VertexCount | Number of vertices to draw
Member Variable Weights |

See Also

CKRST_DPFLAGS,CKRenderContext::DrawPrimitive,CKRenderContext::GetDrawPrimitiveStructure


VxDrawPrimitiveDataSimple::Colors

Member Variable VxDrawPrimitiveDataSimple::Colors

XPtrStrided<DWORD> VxDrawPrimitiveDataSimple::Colors


VxDrawPrimitiveDataSimple::Flags

Member Variable VxDrawPrimitiveDataSimple::Flags

unsigned int VxDrawPrimitiveDataSimple::Flags

Remarks

CKRST_DPFLAGS


VxDrawPrimitiveData::MatIndex

Member Variable VxDrawPrimitiveData::MatIndex

XPtrStrided<DWORD> VxDrawPrimitiveData::MatIndex


VxDrawPrimitiveDataSimple::Normals

Member Variable VxDrawPrimitiveDataSimple::Normals

XPtrStrided<VxVector> VxDrawPrimitiveDataSimple::Normals


VxDrawPrimitiveDataSimple::Positions

Member Variable VxDrawPrimitiveDataSimple::Positions

XPtrStrided<VxVector4> VxDrawPrimitiveDataSimple::Positions


VxDrawPrimitiveDataSimple::SpecularColors

Member Variable VxDrawPrimitiveDataSimple::SpecularColors

XPtrStrided<DWORD> VxDrawPrimitiveDataSimple::SpecularColors


VxDrawPrimitiveDataSimple::TexCoord

Member Variable VxDrawPrimitiveDataSimple::TexCoord

XPtrStrided<VxUV> VxDrawPrimitiveDataSimple::TexCoord


VxDrawPrimitiveData::TexCoords

Member Variable VxDrawPrimitiveData::TexCoords

XPtrStrided<VxUV> VxDrawPrimitiveData::TexCoords[CKRST_MAX_STAGES-1]


VxDrawPrimitiveDataSimple::VertexCount

Member Variable VxDrawPrimitiveDataSimple::VertexCount

int VxDrawPrimitiveDataSimple::VertexCount

Remarks

Number of vertices to draw


VxDrawPrimitiveData::Weights

Member Variable VxDrawPrimitiveData::Weights

XPtrStrided<void*> VxDrawPrimitiveData::Weights


VxDriverDesc

Structure VxDriverDesc

struct VxDriverDesc
{
XString DriverDesc;
XString DriverName;
BOOL IsHardware;

XArray<VxDisplayMode> DisplayModes;
XSArray<VxImageDescEx> TextureFormats;

Vx2DCapsDesc Caps2D;
Vx3DCapsDesc Caps3D;
}

Render Driver description

Members

Caps2D | 2d Capabilities
Caps3D | 3d Capabilities
DisplayModes | Fullscreen display modes supported ( see VxDisplayMode)
DriverDesc | Driver Description
DriverName | Driver Name
IsHardware | Is Driver Hardware
TextureFormats | Texture formats supported by the driver (see VxImageDescEx)

Remarks

The VxDriverDesc contains the description of a render driver. A render engine may provide several drivers according to the installed video cards. Each driver supports differents pixel formats for the textures (TextureFormats) and display modes for fullscreen rendering (Modes). Caps2D & Caps3D members expose the different capabilities of the driver to perform 3D and2D rendering (see Vx2DCapsDesc & Vx3DCapsDesc)

See Also

CKRenderManager::GetRenderDriverDescription,CKRenderManager::GetRenderDriverCount


VxIntersectionDesc

Structure VxIntersectionDesc

struct VxIntersectionDesc
{
CK3dEntity* Object;
CK2dEntity* Sprite;
VxVector IntersectionPoint;
VxVector IntersectionNormal;
float TexU;
float TexV;
float Distance;
int FaceIndex;
}

Intersection description.

Members

Distance |
FaceIndex | Index of the face intersecting with ray or picking
IntersectionNormal | Normal at the intersection point
IntersectionPoint | Intersection point in local coordinates
Object | Object intersected
Sprite | Sprite intersected
TexU | U texture coordinate at intersection point
TexV | V texture coordinate at intersection point

Remarks

This structure is filled by the CK3dEntity::RayIntersection and the CKRenderContext::Pick to give the details of the intersection between a ray and a mesh. Sprite is only relevant as a result of a pick. The returned distance is the distance between the point of intersection and the point of origin of the ray (in the referential given in CK3dEntity::RayIntersection)

See Also

CK3dEntity::RayIntersection, CKRenderContext::Pick


VxSpriteRenderOptions

Structure VxSpriteRenderOptions

struct VxSpriteRenderOptions {
DWORD ModulateColor;
DWORD Options : 4;
VXCMPFUNC AlphaTestFunc : 4;
VXBLEND_MODE SrcBlendMode : 4;
DWORD Options2 : 4;
DWORD DstBlendMode : 8;
DWORD AlphaRefValue : 8;
}

Sprite rendering options structure

Members

AlphaRefValue | If alpha test is enabled (VXSPRITE_ALPHATEST), reference value
AlphaTestFunc | if VXSPRITE_ALPHATEST is enabled, the alpha test function.
DstBlendMode | If blending is enabled (VXSPRITE_BLEND), destination blend mode
ModulateColor | A DWORD ARGB Color to use if VXSPRITE_MODULATE is enabled to multiply the sprite pixel
Options | A combinaison of VXSPRITE_RENDEROPTIONS used to render the sprite
Options2 | A combinaison of VXSPRITE_RENDEROPTIONS2 used to render the sprite
SrcBlendMode | If blending is enabled (VXSPRITE_BLEND), source blend mode

Remarks

The default rendering of a sprite does not perform any blending, filtering or color modulation. As for a CKMaterial some options can be controlled with the CKSprite::SetRenderOptions method using the VxSpriteRenderOptions structure to describe the special settings

See Also

VXSPRITE_RENDEROPTIONS,CKSprite::SetRenderOptions,CKSprite::GetRenderOptions


VxStats

Structure VxStats

struct VxStats
{
int NbTrianglesDrawn;
int NbPointsDrawn;
int NbLinesDrawn;
int NbVerticesProcessed;
int NbObjectDrawn;
float SmoothedFps;
int RenderStateCacheHit;
int RenderStateCacheMiss;
float DevicePreCallbacks;
float SceneTraversalTime;
float TransparentObjectsSortTime;
float ObjectsRenderTime;
float ObjectsCallbacksTime;
float SkinTime;
float SpriteTime;
float SpriteCallbacksTime;
float DevicePostCallbacks;
float BackToFrontTime;
float ClearTime;
DWORD Reserved1;
}

Rendering Profiling results.

Members

BackToFrontTime | Time taken to perfom the back buffer presentation on screen. It can be longer due to 3d objects asynchornous drawing(see ObjectsRenderTime)
ClearTime | Time taken by clear back,z,(stencil) buffers
DevicePostCallbacks | Time taken by render context post render callbacks
DevicePreCallbacks | Time taken by render context pre render callbacks
NbLinesDrawn | Number of lines primitives sent to rasterizer during one frame.
NbObjectDrawn | Number of objects drawn during one frame
NbPointsDrawn | Number of points primitives sent to rasterizer during one frame.
NbTrianglesDrawn | Number of triangle primitives sent to rasterizer during one frame.
NbVerticesProcessed | Number of vertices transformed during one frame
ObjectsCallbacksTime | Time taken by 3D objects pre and post render callbacks
ObjectsRenderTime | Time taken to draw 3D Objects (this time can be very short (especially with T&L cards) as it does not reflect the real rendering time , but time taken to send the commands to the card...
RenderStateCacheHit | Number of render state changes that hit the cache (redondant state)
RenderStateCacheMiss | Number of render state changes that missed the cache
SceneTraversalTime | Time taken to iterate the hierarchy and perform culling
SkinTime | Time taken to compute skins
SmoothedFps | Frame Per Second average.
SpriteCallbacksTime | Time taken by 2D entities pre and post render callbacks
SpriteTime | Time taken to render 2D Entities
TransparentObjectsSortTime | Time taken to sort transparent 3d objects

Remarks

The VxStats structure is updated each frame with the number of primitives drawn and the differents time taken by is used by CKRenderContext::GetStats to monitor the number of primitives processed.

See Also

CKRenderContext::GetStats


VxTransformData

Structure VxTransformData

struct VxTransformData
{
void* InVertices;
unsigned int InStride;
void* OutVertices;
unsigned int OutStride;
void* ScreenVertices;
unsigned int ScreenStride;
unsigned int *ClipFlags;
CKRECT m_2dExtents;
unsigned int m_Offscreen;
}

Vertices to transform to screen coordinates

Members

ClipFlags | Array of DWORD containing a combination of clipping flags (see VXCLIP_FLAGS )
InStride | Amount in bytes separating two vertices in InVertices array
InVertices | VxVector (x,y,z) in model coordinate space
m_2dExtents | Obsolete
m_Offscreen | And combination of all the clipping flags : if !=0 all vertices are clipped by at least one clipping plane.
OutStride | Amount in bytes separating two vertices in OutVertices array
OutVertices | VxVector4 Homogenous coordinates (xh,yh,zh,wh)
ScreenStride | Amount in bytes separating two vertices in ScreenVetices array
ScreenVertices | VxVector4 Screen coordinates (xs,ys,zs,rhw)

Remarks

o The VxTransformData structure is used by CKRenderContext::TransformVertices function to specify vertices to transform and 2 arrays that will received the tranformed homogenous vertices and the screen coordinates of these vertices.

o All members except InVertices are optionnal.

o The ClipFlags member is an array of DWORD (VXCLIP_FLAGS) containing the clipping flags for each vertex: if one of the flags is set the vertex is outside the viewing frustrum.

See Also

CKRenderContext::TransformVertices,VXCLIP_FLAGS


VxUV

Class VxUV

Texture Coordinates structure.

Remarks

Textures coordinates determine which texel (Texture pixel) is assigned to a specific vertex.

class VxUV  {
    float u;
    float v;
};

Groups

Constructors
Method VxUV | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Assignment
Method operator*= | Description: Multiply-Equals Operator This sets the current object to the product of the original value of this object and the value on the right.
Method operator+= | Description: Plus-Equals Operator This sets the current object to the sum of the original value of this object and the value on the right.
Method operator-= | Description: Minus-Equals Operator This sets the current object to the difference between the original value of this object and the value on the right.
Method operator/= | Description: Divide-Equals Operator This sets the current object to the result of dividing the original value of this object by the value on the right.
Operations
Method Set |

See Also

CKPatchMesh::GetTVs


VxUV::VxUV

Method VxUV::VxUV

VxUV::VxUV(float _u=0,float _v=0)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxUV::operator*=

Method VxUV::operator*=

VxUV& VxUV::operator*= (float s)

Returns

A reference to the current object.

Remarks

Description: Multiply-Equals Operator

This sets the current object to the product of the original value of this object and the value on the right.


VxUV::operator+=

Method VxUV::operator+=

VxUV& VxUV::operator+= (const VxUV& uv)

Returns

A reference to the current object.

Remarks

Description: Plus-Equals Operator

This sets the current object to the sum of the original value of this object and the value on the right.


VxUV::operator-=

Method VxUV::operator-=

VxUV& VxUV::operator-= (const VxUV& uv)

Returns

A reference to the current object.

Remarks

Description: Minus-Equals Operator

This sets the current object to the difference between the original value of this object and the value on the right.


VxUV::operator/=

Method VxUV::operator/=

VxUV& VxUV::operator/= (float s)

Returns

A reference to the current object.

Remarks

Description: Divide-Equals Operator

This sets the current object to the result of dividing the original value of this object by the value on the right.


VxUV::Set

Method VxUV::Set

void VxUV::Set(float _u,float _v)


Callback Functions prototypes

Callback functions prototypes definitions

Type Definition CK_EFFECTCALLBACK | Material effect callback function.
Type Definition CK_INITINSTANCEFCT | Plugins initialization function
Type Definition CK_MESHRENDERCALLBACK | Mesh rendering callback function.
Type Definition CK_PARAMETEROPERATION | Parameter operation evaluation function
Type Definition CK_RENDERCALLBACK | Render context rendering callback function.
Type Definition CK_RENDEROBJECT_CALLBACK | 3D or 2D entity rendering callback function
Type Definition CKATTRIBUTECALLBACK | Function called when an attribute is set or removed on an object.
Type Definition CKBEHAVIORCALLBACKFCT | Behavior message callbacks function.
Type Definition CKBEHAVIORFCT | Behavior execution function.
Type Definition CKDLL_CREATEPROTOFUNCTION | Function creating a behavior prototype
Type Definition CKDLL_OBJECTDECLARATIONFUNCTION | Function filling a array of behaviors present in a DLL
Type Definition CKPluginGetInfoCountFunction | Plugin declaration count function prototype
Type Definition CKPluginGetInfoFunction | Plugin declaration function prototype
Type Definition CKReaderGetReaderFunction | Reader plugin creation function prototype
Type Definition CKRRCALLBACKFCT | Callback for customized reference resolution when loading a file.
Type Definition CKUICALLBACKFCT | Typedef of the context callback function.

See Also

Virtools SDK Reference


CK_EFFECTCALLBACK

Type Definition CK_EFFECTCALLBACK

typedef VX_EFFECTCALLBACK_RETVAL (*CK_EFFECTCALLBACK)(CKRenderContext *Dev,CKMaterial* mat,int Stage,void *Argument)

Material effect callback function.

Remarks

A function can be called each time a material is set as current on a rendering context to set up a special effect. The return value of this callback determines if other render states or texture stages should be set by the material

See Also

CKMaterial::SetEffect,VxEffectDescription,The Virtools Render Loop,VX_EFFECTCALLBACK_RETVAL


CK_INITINSTANCEFCT

Type Definition CK_INITINSTANCEFCT

typedef CKERROR (*CK_INITINSTANCEFCT) (CKContext* context)
typedef CK_INITINSTANCEFCT CK_EXITINSTANCEFCT

Plugins initialization function

Remarks

+Some plugins (especially those implementing managers) may have to perform some initializations when a CKContext is created (for example to create a manager or register new parameter types). +In this case they should declare and implement the CKPluginInfo::m_InitInstanceFct pointer.

See Also

CKPluginInfo,CKPluginManager


CK_MESHRENDERCALLBACK

Type Definition CK_MESHRENDERCALLBACK

typedef void (*CK_MESHRENDERCALLBACK)(CKRenderContext *Dev,CK3dEntity* Mov,CKMesh *Object,void *Argument)

Mesh rendering callback function.

Remarks

A function can be called before and after the rendering of an object mesh occurs. It can also be used to replace the default rendering function.

See Also

CKMesh::SetRenderCallBack,CKMesh::AddPreRenderCallBack,,CKMesh::AddPostRenderCallBack,The Virtools Render Loop


CK_PARAMETEROPERATION

Type Definition CK_PARAMETEROPERATION

typedef void (*CK_PARAMETEROPERATION) (CKContext* context,CKParameterOut *Res,CKParameterIn *p1,CKParameterIn *p2)

Parameter operation evaluation function

See Also

Creation of new Parameter Operations


CK_RENDERCALLBACK

Type Definition CK_RENDERCALLBACK

typedef void (*CK_RENDERCALLBACK)(CKRenderContext *context,void *Argument)

Render context rendering callback function.

Remarks

A function can be called before and after the rendering of a scene occurs.

See Also

CKRenderContext::AddPreRenderCallBack,CKRenderContext::AddPostRenderCallBack,The Virtools Render Loop


CK_RENDEROBJECT_CALLBACK

Type Definition CK_RENDEROBJECT_CALLBACK

typedef CKBOOL (*CK_RENDEROBJECT_CALLBACK)(CKRenderContext *Dev,CKRenderObject* ent,void *Argument)

3D or 2D entity rendering callback function

Remarks

Both 2D and 3D entities can have fuctions called before and/or after their rendering occurs.

See Also

CKRenderObject::AddPreRenderCallBack,CKRenderObject::AddPostRenderCallBack


CKATTRIBUTECALLBACK

Type Definition CKATTRIBUTECALLBACK

typedef void (*CKATTRIBUTECALLBACK) (CKAttributeType AttribType,CKBOOL Set,CKBeObject *obj,void *arg)

Function called when an attribute is set or removed on an object.

Remarks

+A callback function can be set for a given attribute type with CKAttributeManager::SetAttributeCallbackFunction. +This function will be called each time an attribute with the given type is set (with Set = TRUE) or removed (with Set = FALSE) on an object.

See Also

CKAttributeManager::SetAttributeCallbackFunction,Using Attributes


CKBEHAVIORCALLBACKFCT

Type Definition CKBEHAVIORCALLBACKFCT

typedef CKERROR (*CKBEHAVIORCALLBACKFCT) (const CKBehaviorContext& context)

Behavior message callbacks function.

See Also

, Writing the Behavior Callback Function,CKBEHAVIORFCT


CKBEHAVIORFCT

Type Definition CKBEHAVIORFCT

typedef int (*CKBEHAVIORFCT) (const CKBehaviorContext& context)

Behavior execution function.

See Also

, Writing the Execution Function,CKBEHAVIORCALLBACKFCT


CKDLL_CREATEPROTOFUNCTION

Type Definition CKDLL_CREATEPROTOFUNCTION

typedef CKERROR (*CKDLL_CREATEPROTOFUNCTION) (CKBehaviorPrototype **)

Function creating a behavior prototype

See Also

Behavior Prototype Creation,CKBehaviorPrototype


CKDLL_OBJECTDECLARATIONFUNCTION

Type Definition CKDLL_OBJECTDECLARATIONFUNCTION

typedef void (*CKDLL_OBJECTDECLARATIONFUNCTION) (XObjectDeclarationArray *)

Function filling a array of behaviors present in a DLL

Remarks

When creating additional behaviors DLLs, a function named “RegisterBehaviorDeclarations” must be present and exported to declare the behaviors that may be created using this Dll. See the Creating Building Blocks and samples behaviors given in this SDK to see how to declare a behavior XObjectDeclarationArray is defined as a XArray<CKObjectDeclaration*>

See Also

Creating Building Blocks,CKObjectDeclaration


CKPluginGetInfoCountFunction

Type Definition CKPluginGetInfoCountFunction

typedef int (*CKPluginGetInfoCountFunction)()

Plugin declaration count function prototype

See Also

Creating New Plugins


CKPluginGetInfoFunction

Type Definition CKPluginGetInfoFunction

typedef CKPluginInfo* (*CKPluginGetInfoFunction)(int Index)

Plugin declaration function prototype

See Also

Creating New Plugins


CKReaderGetReaderFunction

Type Definition CKReaderGetReaderFunction

typedef CKDataReader *(*CKReaderGetReaderFunction)(int)

Reader plugin creation function prototype

See Also

Creating New Plugins


CKRRCALLBACKFCT

Type Definition CKRRCALLBACKFCT

typedef CKObject* (*CKRRCALLBACKFCT) (CKFileObject* iFileObject)

Callback for customized reference resolution when loading a file.

See Also

CKFile::SetResolveReferenceCallback


CKUICALLBACKFCT

Type Definition CKUICALLBACKFCT

typedef CKERROR (*CKUICALLBACKFCT)(CKUICallbackStruct& param,void *data)

Typedef of the context callback function.

Remarks

If installed through the CKContext::SetInterfaceMode function, a callback function can be called for each of the following event (param.Reason): (The interpretation of the param structure is dependent on the received message)

CKUIM_LOADSAVEPROGRESS | 1, This message is sent by the framework when loading a cmo/nmo/vmo file param.NbObjetsLoaded: current number of loaded objects param.NbObjetsToLoad: total number of objects to load
CKUIM_OUTTOCONSOLE | 3, param.DoBeep : TRUE/FALSE is a sound should be emitted when the message is displayed param.ConsoleString: String to output in a console
CKUIM_OUTTOINFOBAR | 4, param.ConsoleString: String to output in a info bar
CKUIM_SCENEADDEDTOLEVEL | 12, param.ObjectID: CK_ID of the scene that have been added to the level...
CKUIM_PROGRESSDIALOG | 19, Used when a lengthly process is operating and would like to provide the user with a visual feedback param.param1: current number of iteration (0xFFFFFFFF when starting , 0xFFFFFFFE for ending) param.param2: total number of iterations

The data input argument is the one that was specified to CKContext::SetInterfaceMode function

See Also

CKContext::SetInterfaceMode,CKUICallbackStruct


Macro definitions

List of SDK macro definitions

Macro CKOBJID | Returns the Unique Identifier for a CKObject or derivated.
Macro RegisterBehavior | Helper macro to register a behavior declaration

See Also

Virtools SDK Reference


CKOBJID

Macro CKOBJID

#define CKOBJID(x) (x ? x->GetID() : 0)

Returns the Unique Identifier for a CKObject or derivated.

Remarks

Each object derived from the CKObject class has a unique ID. This ID can be accessed through each instance of these classes, with the CKObject::GetID method or through this macro.

See Also

CKObject::GetID


RegisterBehavior

Macro RegisterBehavior

#define RegisterBehavior(reg,fct) CKObjectDeclaration *fct(); CKStoreDeclaration(reg,fct());

Helper macro to register a behavior declaration

Parameters

Input argument reg | A pointer to the XObjectDeclarationArray given in the RegisterBehaviorDeclarations function.
Input argument fct | A function that creates the behavior object declaration (CKObjectDeclaration) and returns it.

See Also

Main Steps of Building Block Creation


Types definitions

The Virtools SDK introduces and uses internally a set of types for common data types. These types serve as an interface layer relatively to the underlying plateform. Clients of the Virtools SDK are advised to use these types when dealing with the Virtools SDK, in order to simplify the porting of their client code on future plateforms.

typedef char* CKSTRING;          // string
typedef char CKCHAR;             // string character
typedef int CKBOOL               // BOOL
typedef unsigned char CKBYTE;    // BYTE
typedef unsigned long CKDWORD;   // DWORD
typedef unsigned short CKWORD,   // WORD
typedef long CKERROR;            // DWORD
typedef void* CKSOUNDHANDLE;
typedef int CKParameterType;     // See CKParameterManager
typedef int CKOperationType;     // See CKParameterManager
typedef int CKMessageType;       // See CKMessageManager
typedef int CKAttributeType;     // See CKAttributeManager
typedef int CKAttributeCategory; // See CKAttributeManager

Type Definition CK_CLASSID | Per Class Unique Identifier.
Type Definition CK_ID | Unique Identifier for all Objects instanciated in a given CKContext

See Also

Virtools SDK Reference


CK_CLASSID

Type Definition CK_CLASSID

typedef unsigned int CK_CLASSID

Per Class Unique Identifier.

Remarks

+Each class derived from the CKObject class has a unique class ID. +This ID can be accessed through each instance of these classes, with the CKObject::GetClassID method. +This class ID is used internally for various matching operations, like matching behaviors on objects, etc..

See Also

CKObject::GetClassID,CKIsChildClassOf,Class Identifiers


CK_ID

Type Definition CK_ID

typedef unsigned int CK_ID

Unique Identifier for all Objects instanciated in a given CKContext

Remarks

+Each instance of CKObject and derived classes are automatically given a global unique ID at creation time. This ID can be accessed through the CKObject::GetID method. It is safer, though a bit slower, to reference object through their global ID than through a direct pointer reference. In any case the referenced object may be deleted even though the client object has a ID for it.The client object should verify that the referenced object still exists when used with the CKGetObject function.

+The global ID for an instance remains unique and unchanged through a application session, but there is no garanty that this ID will be the same when a level is saved and loaded back again.

See Also

CKObject::GetID, CKContext::GetObject


Pre-Registred Parameter Types

Macro Pre-Registred Parameter Types

Here is the list of the parameter types that are registered by Virtools.

GUID                        Data Stored         Size(bytes)     Notes
__________________________________________________________________

CKPGUID_NONE                none                    0
CKPGUID_VOIDBUF             BYTE[]                  10+
CKPGUID_FLOAT               float                   4
CKPGUID_ANGLE               float(radians)          4
CKPGUID_PERCENTAGE          float(0..1)             4
CKPGUID_INT                 int                     4
CKPGUID_KEY                 CKKEYBOARD              4
CKPGUID_BOOL                CKBOOL                  4
CKPGUID_STRING              CKCHAR                  10+
CKPGUID_VECTOR              VxVector                12
CKPGUID_2DVECTOR            Vx2DVector              8
CKPGUID_MATRIX              VxMatrix                64
CKPGUID_COLOR               VxColor                 16
CKPGUID_BOX                 VxBbox                  24
CKPGUID_ID                  CK_ID                   4
CKPGUID_OBJECTARRAY         XObjectArray*           4
CKPGUID_STATECHUNK          CKStateChunk*           4
CKPGUID_POINTER             void*                   4
CKPGUID_MESSAGE             CKMessageType (int)     4   See CKMessageManager::AddMessageType
CKPGUID_ATTRIBUTE           CKAttributeType (int)   4   See CKAttributeManager::RegisterNewAttributeType
CKPGUID_BLENDMODE           VXTEXTURE_BLENDMODE     4
CKPGUID_FILTERMODE          VXTEXTURE_FILTERMODE    4
CKPGUID_BLENDFACTOR         VXBLEND_MODE            4
CKPGUID_FILLMODE            VXFILL_MODE             4
CKPGUID_LITMODE             VXMESH_LITMODE          4
CKPGUID_SHADEMODE           VXSHADE_MODE            4
CKPGUID_ADDRESSMODE         VXTEXTURE_ADDRESSMODE   4
CKPGUID_WRAPMODE            VXTEXTURE_WRAPMODE      4
CKPGUID_3DSPRITEMODE        VXSPRITE3D_TYPE         4
CKPGUID_FOGMODE             VXFOG_MODE              4
CKPGUID_LIGHTTYPE           VXLIGHT_TYPE            4
CKPGUID_SPRITEALIGN         CKSPRITETEXT_ALIGNMENT  4
CKPGUID_DIRECTION           int                     4   "X=1,-X=2,Y=3,-Y=4,Z=5,-Z=6"
CKPGUID_LAYERTYPE           int                     4   See CKGridManager::RegisterType
CKPGUID_COMPOPERATOR        int                     4   "Equal=1,Not Equal=2,Less than=3,Less or equal=4,Greater than=5,Greater or equal=6"
CKPGUID_BINARYOPERATOR      int                     4   "+=1,-=2,*=3,/=4"
CKPGUID_SETOPERATOR         int                     4   "Union=1,Intersection=2,Substraction=3"
CKPGUID_OBSTACLEPRECISION   int                     4   "BoundingBox=1,Faces=2,Optimized=4"
CKPGUID_OBSTACLEPRECISIONBEH int                    4   "Automatic=0,BoundingBox=1,Faces=2,Optimized=4"
CKPGUID_OBSTACLE            CK_ID[2]                8
CKPGUID_2DCURVE             CK2dCurve*              4   READ ONLY
The following parameter types all contain a CK_ID for a CKObject or derived class
CKPGUID_OBJECT              CK_ID                   4   CKCID_OBJECT
CKPGUID_BEOBJECT            CK_ID                   4   CKCID_BEOBJECT
CKPGUID_MESH                CK_ID                   4   CKCID_MESH
CKPGUID_PATCHMESH           CK_ID                   4   CKCID_PATCHMESH
CKPGUID_MATERIAL            CK_ID                   4   CKCID_MATERIAL
CKPGUID_TEXTURE             CK_ID                   4   CKCID_TEXTURE
CKPGUID_SPRITE              CK_ID                   4   CKCID_LIGHT
CKPGUID_3DENTITY            CK_ID                   4   CKCID_3DENTITY
CKPGUID_CURVEPOINT          CK_ID                   4   CKCID_CURVEPOINT
CKPGUID_LIGHT               CK_ID                   4   CKCID_LIGHT
CKPGUID_TARGETLIGHT         CK_ID                   4   CKCID_TARGETLIGHT
CKPGUID_CAMERA              CK_ID                   4   CKCID_CAMERA
CKPGUID_TARGETCAMERA        CK_ID                   4   CKCID_TARGETCAMERA
CKPGUID_SPRITE3D            CK_ID                   4   CKCID_SPRITE3D
CKPGUID_SCRIPT              CK_ID                   4   CKCID_BEHAVIOR
CKPGUID_OBJECT3D            CK_ID                   4   CKCID_3DOBJECT
CKPGUID_BODYPART            CK_ID                   4   CKCID_BODYPART
CKPGUID_CHARACTER           CK_ID                   4   CKCID_CHARACTER
CKPGUID_CURVE               CK_ID                   4   CKCID_CURVE
CKPGUID_LEVEL               CK_ID                   4   CKCID_LEVEL
CKPGUID_PLACE               CK_ID                   4   CKCID_PLACE
CKPGUID_GROUP               CK_ID                   4   CKCID_GROUP
CKPGUID_2DENTITY            CK_ID                   4   CKCID_2DENTITY
CKPGUID_SPRITETEXT          CK_ID                   4   CKCID_SPRITETEXT
CKPGUID_SOUND               CK_ID                   4   CKCID_SOUND
CKPGUID_WAVESOUND           CK_ID                   4   CKCID_WAVESOUND
CKPGUID_MIDISOUND           CK_ID                   4   CKCID_MIDISOUND
CKPGUID_OBJECTANIMATION     CK_ID                   4   CKCID_OBJECTANIMATION
CKPGUID_ANIMATION           CK_ID                   4   CKCID_ANIMATION
CKPGUID_KINEMATICCHAIN      CK_ID                   4   CKCID_KINEMATICCHAIN
CKPGUID_SCENE               CK_ID                   4   CKCID_SCENE
CKPGUID_BEHAVIOR            CK_ID                   4   CKCID_BEHAVIOR
CKPGUID_SYNCHRO             CK_ID                   4   CKCID_SYNCHRO
CKPGUID_CRITICALSECTION     CK_ID                   4   CKCID_CRITICALSECTION
CKPGUID_STATE               CK_ID                   4   CKCID_STATE
CKPGUID_DATAARRAY           CK_ID                   4   CKCID_DATAARRAY
CKPGUID_VIDEO               CK_ID                   4   CKCID_VIDEO
CKPGUID_SHADER              CKCHAR                  10+ (As CKPGUID_STRING it contains a string )
CKPGUID_TECHNIQUE           CKCHAR                  10+ (As CKPGUID_STRING it contains a string )
CKPGUID_PASS                CKCHAR                  10+ (As CKPGUID_STRING it contains a string )

See Also

Virtools SDK Reference


ParameterOperation Types

Here is the list of the parameter operations types that are registered by Virtools.

GUID                            Operation Name
__________________________________________________________________

CKOGUID_MODULO                  Modulo
CKOGUID_SQUAREROOT              Square Root
CKOGUID_SINUS                   Sine
CKOGUID_GETCURVEPOINT           Get Curve Point
CKOGUID_COSINUS                 Cose
CKOGUID_TAN                     Tangent
CKOGUID_ATAN                    Arc Tangent 2
CKOGUID_ASIN                    Arc Sine
CKOGUID_ACOS                    Arc Cosine
CKOGUID_ADD                     Addition
CKOGUID_SUBTRACT                Subtraction
CKOGUID_MULTIPLY                Multiplication
CKOGUID_SPHERICTOCART           Spheric To Cartesian
CKOGUID_DIVIDE                  Division
CKOGUID_INF                     Inferior
CKOGUID_INFEQUAL                Inferior or Equal
CKOGUID_MAX                     Maximum
CKOGUID_MIN                     Minimum
CKOGUID_EQUAL                   Equal
CKOGUID_NOTEQUAL                Not Equal
CKOGUID_SET                     Convert
CKOGUID_SETX                    Set X
CKOGUID_SETY                    Set Y
CKOGUID_SETZ                    Set Z
CKOGUID_SETW                    Set W
CKOGUID_SETWIDTH                Set Width
CKOGUID_SETHEIGHT               Set Height
CKOGUID_SETLEFT                 Set Left
CKOGUID_SETTOP                  Set Top
CKOGUID_SETRIGHT                Set Right
CKOGUID_SETBOTTOM               Set Bottom
CKOGUID_SETRED                  Set Red
CKOGUID_SETGREEN                Set Green
CKOGUID_SETBLUE                 Set Blue
CKOGUID_SETALPHA                Set Alpha
CKOGUID_SETCENTER               Set Geometric Center
CKOGUID_DEGTORAD                Degre To Radian
CKOGUID_RADTODEG                Radian To Degre
CKOGUID_GETX                    Get X
CKOGUID_GETY                    Get Y
CKOGUID_GETZ                    Get Z
CKOGUID_GETW                    Get W
CKOGUID_GETRED                  Get Red
CKOGUID_GETGREEN                Get Green
CKOGUID_GETBLUE                 Get Blue
CKOGUID_GETALPHA                Get Alpha
CKOGUID_RANDOM                  Random
CKOGUID_AND                     And
CKOGUID_OR                      Or
CKOGUID_XOR                     Xor
CKOGUID_NOT                     Not
CKOGUID_INVERSE                 Inverse
CKOGUID_GETNAME                 Get Name
CKOGUID_GETID                   Get ID
CKOGUID_GETVOLUME               Get Volume
CKOGUID_GETCOLUMNCOUNT          Get Column Count
CKOGUID_GETROWCOUNT             Get Row Count
CKOGUID_GETNAMEDOBJECT          Get Object By Name
CKOGUID_GETCENTER               Get Geometric Center
CKOGUID_GETBOX                  Get Bounding Box
CKOGUID_GETDIFFUSE              Get Diffuse Color
CKOGUID_GETAMBIENT              Get Ambient Color
CKOGUID_GETSPECULAR             Get Specular Color
CKOGUID_GETEMISSIVE             Get Emissive Color
CKOGUID_GETTEXTURE              Get Texture
CKOGUID_GETWIDTH                Get Width
CKOGUID_GETHEIGHT               Get Height
CKOGUID_GETSLOTCOUNT            Get Slot Count
CKOGUID_GETMATERIAL             Get Material
CKOGUID_GETPARENT               Get Parent
CKOGUID_GETCHILDREN             Get Children
CKOGUID_GETREFPLACE             Get Referentiel Place
CKOGUID_GETDISTANCE             Get Distance
CKOGUID_BOXCOLLISION            Is Collision
CKOGUID_GETWORLDMATRIX          Get World Matrix
CKOGUID_GETLOCALMATRIX          Get Local Matrix
CKOGUID_GETTARGET               Get Target
CKOGUID_WINDOWPICK              Pick Object
CKOGUID_GETRANGE                Get Range
CKOGUID_GETFOV                  Get Field Of View
CKOGUID_GETFRONTPLANE           Get Front Plane
CKOGUID_GETBACKPLANE            Get Back Plane
CKOGUID_GETZOOM                 Get Orthographic Zoom
CKOGUID_GETROLL                 Get Roll Angle
CKOGUID_GETCHARACTER            Get Character
CKOGUID_GETANIMATION            Get Animation
CKOGUID_GETROOT                 Get Root
CKOGUID_GETBODYPARTS            Get BodyParts
CKOGUID_GETKINEMATICCHAIN       Get Kinematic Chain
CKOGUID_GETLENGTH               Get Length
CKOGUID_GETCURVEPOS             Get Curve Position
CKOGUID_GETDIRECTION            Get Curve Tangent
CKOGUID_GETGROUPTYPE            Get Group Type
CKOGUID_GETTEXT                 Get Text
CKOGUID_GETSIZE                 Get Size
CKOGUID_GETTYPE                 Get Type
CKOGUID_GETCOLOR                Get Color
CKOGUID_GETFREQUENCY            Get Pitch
CKOGUID_GETVOLUME               Get Volume
CKOGUID_GETPOSITION             Get Position
CKOGUID_GETMATRIX               Get Matrix
CKOGUID_GETDIR                  Get Dir
CKOGUID_GETUP                   Get Up
CKOGUID_GETRIGHT                Get Right
CKOGUID_GETELEMENT              Get Element
CKOGUID_GETRADIUS               Get Radius
CKOGUID_GETCOUNT                Get Count
CKOGUID_CROSSPRODUCT            Cross Product
CKOGUID_DOTPRODUCT              Dot Product
CKOGUID_GETSCREENORIGIN         Get Screen Origin
CKOGUID_SUP                     Superior
CKOGUID_SUPEQUAL                Superior or Equal
CKOGUID_DERIVEDFROM             Is Derived From
CKOGUID_ISVISIBLE               Is Visible
CKOGUID_OPPOSITE                Opposite
CKOGUID_RAINBOWCOLOR            Rainbow Color
CKOGUID_GETANGLE                Get Angle
CKOGUID_NORMALIZE               Normalize
CKOGUID_REFLECT                 Reflect
CKOGUID_ABSOLUTE                Absolute Value
CKOGUID_ISVECTORINBBOX          Is Vector in Bbox
CKOGUID_GETCURRENT              Get Current
CKOGUID_GETMAGNITUDE            Get Magnitude
CKOGUID_GETSCALE                Get Scale
CKOGUID_GETBODYPARTBYINCLUDEDNAME Get BodyPart
CKOGUID_CONTAINSTRING           Contain String
CKOGUID_GETSCRIPTCOUNT          Get Script Count
CKOGUID_GETSCRIPT               Get Script
CKOGUID_GETVIEWRECT             Get View Rect
CKOGUID_ISCHILDOF               Is Child Of
CKOGUID_ISBODYPARTOF            Is Body Part Of
CKOGUID_TRANSFORM               Transform
CKOGUID_TRANSFORMVECTOR         Transform Vector
CKOGUID_INVERSETRANSFORM        Inverse Transform
CKOGUID_INVERSETRANSFORMVECTOR  Inverse Transform Vector
CKOGUID_CAST                    Dynamic Cast
CKOGUID_SYMMETRY                Symmetry
CKOGUID_GETMATERIALLIST         Get Material List
CKOGUID_GETASPECTRATIO          Get Aspect Ratio
CKOGUID_GETVERTEXCOUNT          Get Vertex Count
CKOGUID_GETVERTEXCOLOR          Get Vertex Color
CKOGUID_GETVERTEXPOSITION       Get Vertex Position
CKOGUID_GETVERTEXSPECULARCOLOR  Get Vertex Specular Color
CKOGUID_GETVERTEXNORMAL         Get Vertex Normal
CKOGUID_GETVERTEXUVS            Get Vertex UVs
CKOGUID_GETMATERIALCOUNT        Get Material Count
CKOGUID_GETCHANNELCOUNT         Get Channel Count
CKOGUID_GETCHANNELBYMATERIAL    Get Channel By Material
CKOGUID_GETFACECOUNT            Get Face Count
CKOGUID_GETFACEMATERIAL         Get Face Material
CKOGUID_GETFACENORMAL           Get Face Normal
CKOGUID_GETFACEINDICES          Get Face Vertex Indices
CKOGUID_GETVERTEXWEIGHT         Get Vertex Weight
CKOGUID_GETPLAYPOSITION         Get Play Position
CKOGUID_SQUAREROOT          Square Root
CKOGUID_SINUS               Sinus
CKOGUID_GETREFSCENE         Get Referentiel Scene
CKOGUID_GETCURVEPOINT       Get Curve Point
CKOGUID_COSINUS             Cosinus
CKOGUID_TAN                 Tangente
CKOGUID_ATAN                Arc Tangente
CKOGUID_ADD                 Addition
CKOGUID_SUBTRACT            Substraction
CKOGUID_MULTIPLY            Multiplication
CKOGUID_SPHERICTOCART       Spheric To Cartesian
CKOGUID_DIVIDE              Division
CKOGUID_INF                 Inferior
CKOGUID_INFEQUAL            Inferior or Equal
CKOGUID_MAX                 Maximum
CKOGUID_MIN                 Minimum
CKOGUID_EQUAL               Equal
CKOGUID_NOTEQUAL            Not Equal
CKOGUID_SET                 Set Value
CKOGUID_RANDOM              Random
CKOGUID_AND                 And
CKOGUID_OR                  Or
CKOGUID_XOR                 Xor
CKOGUID_NOT                 Not
CKOGUID_INVERSE             Inverse
CKOGUID_GETNAME             Get Name
CKOGUID_GETID               Get ID
CKOGUID_ISOBJECTUSED        Is Object USed
CKOGUID_GETSOUND            Get Sound
CKOGUID_GETNAMEDOBJECT      Get Object By Name
CKOGUID_GETCENTER           Get Geometric Center
CKOGUID_GETBOX              Get Bounding Box
CKOGUID_GETDIFFUSE          Get Diffuse Color
CKOGUID_GETAMBIENT          Get Ambient Color
CKOGUID_GETSPECULAR         Get Specular Color
CKOGUID_GETEMISSIVE         Get Emissive Color
CKOGUID_GETTEXTURE          Get Texture
CKOGUID_GETWIDTH            Get Width
CKOGUID_GETHEIGHT           Get Height
CKOGUID_GETSLOTCOUNT        Get Slot Count
CKOGUID_GETMATERIAL         Get Material
CKOGUID_GETPARENT           Get Parent
CKOGUID_GETCHILDREN         Get Children
CKOGUID_GETREFPLACE         Get Referentiel Place
CKOGUID_GETDISTANCE         Get Distance
CKOGUID_BOXCOLLISION        Is Collision
CKOGUID_GETWORLDMATRIX      Get World Matrix
CKOGUID_GETLOCALMATRIX      Get Local Matrix
CKOGUID_GETOBJECTSINBOX     Get Objects in Box
CKOGUID_GETTARGET           Get Target
CKOGUID_WINDOWPICK          Pick Object
CKOGUID_GETRANGE            Get Range
CKOGUID_GETFOV              Get Field Of View
CKOGUID_GETROLL             Get Roll Angle
CKOGUID_ISFLOOR             Is a Floor
CKOGUID_ISWALL              Is a Wall
CKOGUID_ISOBSTACLE          Is an Obstacle
CKOGUID_GETCHARACTER        Get Character
CKOGUID_GETANIMATION        Get Animation
CKOGUID_GETROOT             Get Root
CKOGUID_GETBODYPARTS        Get BodyParts
CKOGUID_GETKINEMATICCHAIN   Get Kinematic Chain
CKOGUID_GETLENGTH           Get Length
CKOGUID_GETCURVEPOS         Get Curve Position
CKOGUID_GETDIRECTION        Get Curve Direction
CKOGUID_ISCLOSED            Is Curve Closed
CKOGUID_GETLEVELLIST        Get Levels List
CKOGUID_GETGLOBALCHARACTERS Get Clobal Characters
CKOGUID_GETGLOBALOBJECTS    Get Global Objects
CKOGUID_GETPLACELIST        Get Places List
CKOGUID_GETSCENELIST        Get Scenes List
CKOGUID_GETDEFAULTCAMERA    Get Default Camera
CKOGUID_GETGROUPTYPE        Get Group Type
CKOGUID_GETXPOS             Get X Position
CKOGUID_GETYPOS             Get Y Position
CKOGUID_GETZPOS             Get Z Position
CKOGUID_GETTEXT             Get Text
CKOGUID_GETSIZE             Get Size
CKOGUID_GETTYPE             Get Type
CKOGUID_GETCOLOR            Get Color
CKOGUID_ISPLAYING           Is Playing
CKOGUID_GETFREQUENCY        Get frequency
CKOGUID_GETVOLUME           Get Volume
CKOGUID_GETPOSITION         Get Position
CKOGUID_GETMATRIX           Get Matrix
CKOGUID_GETXMATRIX          GetX Matrix
CKOGUID_GETYMATRIX          GetY Matrix
CKOGUID_GETZMATRIX          GetZ Matrix
CKOGUID_GETDIR              Get Direction
CKOGUID_GETUP               Get Up Vector
CKOGUID_GETRIGHT            Get Right Vector
CKOGUID_GETELEMENT          Get Element
CKOGUID_GETRADIUS           Get Radius
CKOGUID_GETCOUNT            Get Count
CKOGUID_CROSSPRODUCT        Cross Product
CKOGUID_DOTPRODUCT          Dot Product
CKOGUID_GETMOUSEPOS         Get Mouse Position
CKOGUID_GETMOUSEX           Get Mouse X
CKOGUID_GETMOUSEY           Get Mouse Y
CKOGUID_GETSCREENORIGIN     Get Screen Origin
CKOGUID_SUP                 Superior
CKOGUID_SUPEQUAL            Superior or Equal
CKOGUID_DERIVEDFROM         Is Derived From
CKOGUID_ISVISIBLE           Is Visible
CKOGUID_OPPOSITE            Opposite
CKOGUID_SETRED              Set Red
CKOGUID_SETGREEN            Set Green
CKOGUID_SETBLUE             Set Blue
CKOGUID_SETALPHA            Set Alpha
CKOGUID_RAINBOWCOLOR        Rainbow Color
CKOGUID_GETANGLE            Get Angle
CKOGUID_NORMALIZE           Normalize
CKOGUID_REFLECT             Reflect
CKOGUID_ABSOLUTE            Absolute Value
CKOGUID_ISVECTORINBBOX      Is Vector in Bbox
CKOGUID_GETCURRENT          Get Current
CKOGUID_GETMAGNITUDE        Get Magnitude
CKOGUID_GETPOSFROMMATRIX    Get Pos From Matrix
CKOGUID_GETSCALEFROMMATRIX  Get Scale From Matrix
CKOGUID_GETSCALE            Get Scale
CKOGUID_GETBODYPARTBYINCLUDEDNAME  Get BodyPart
CKOGUID_CONTAINSTRING       Contain String
CKOGUID_GETSCRIPTCOUNT      Get Script Count
CKOGUID_GETSCRIPT           Get Script
CKOGUID_ISCHILDOF           Is Child Of
CKOGUID_ISBODYPARTOF        Is Body Part Of
CKOGUID_TRANSFORM           Transform
CKOGUID_TRANSFORMVECTOR     Transform Vector
CKOGUID_INVERSETRANSFORM    Inverse Transform
CKOGUID_INVERSETRANSFORMVECTOR  Inverse Transform Vector
CKOGUID_CAST                Dynamic Cast
CKOGUID_GETMATERIALLIST     GetMaterialList

See Also

Virtools SDK Reference


Object Dependencies Options

When copying or deleting objects you can control which dependencies of these objects should also be taken by the operation. The following image shows the most common dependencies between existing CKObjects (for example when copying a CK3dEntity you can choose to copy its mesh)

Here is a list of dependencies options as it can be found in CKDependenciesConstants.h and can be used in CKDependencies::ModifyOptions :

// Destroy Dependencies
// Defines which dependencies of an object  should also be destroyed
#define CK_DEPENDENCIES_DESTROY_BEOBJECT_SCRIPTS        1   // Destroy Object scripts, Default : On
#define CK_DEPENDENCIES_DESTROY_MATERIAL_TEXTURE        1   // Destroy Material texture, Default : Off
#define CK_DEPENDENCIES_DESTROY_MESH_MATERIAL           1   // Destroy Mesh materials, Default : Off
#define CK_DEPENDENCIES_DESTROY_3DENTITY_MESH           1   // Destroy 3DEntity meshes, Default : Off
#define CK_DEPENDENCIES_DESTROY_3DENTITY_CHILDREN       2   // Destroy 3DEntity hierarchy, Default : Off
#define CK_DEPENDENCIES_DESTROY_3DENTITY_ANIMATIONS     4   // Destroy 3DEntity animations, Default : On
#define CK_DEPENDENCIES_DESTROY_DATAARRAY_OBJECTS       1   // Destroy objects referenced by a DataArray, Default: Off
#define CK_DEPENDENCIES_DESTROY_PLACE_PORTALS           1   // Destroy portals referenced by a Plane, Default : Off
#define CK_DEPENDENCIES_DESTROY_SPRITE3D_MATERIAL       1   // Destroy Sprite3D material, Default : Off
#define CK_DEPENDENCIES_DESTROY_TARGETLIGHT_TARGET      1   // Destroy TargetLight target 3DEntity, Default : Off
#define CK_DEPENDENCIES_DESTROY_TARGETCAMERA_TARGET     1   // Destroy TargetCamera target 3DEntity, Default : Off
#define CK_DEPENDENCIES_DESTROY_GROUP_OBJECTS           1   // Destroy every objects referenced by the Group, Default : Off
// Copy Dependencies
// Defines which dependencies of an object should also be copied
#define CK_DEPENDENCIES_COPY_OBJECT_NAME            1       // Copy object name, Default : On
#define CK_DEPENDENCIES_COPY_OBJECT_UNIQUENAME      2       // Ensure name uniqueness when copying, Default : On
#define CK_DEPENDENCIES_COPY_SCENEOBJECT_SCENES     1       // Add copy to every scenes the source was belonging to, Default : On
#define CK_DEPENDENCIES_COPY_BEOBJECT_SCRIPTS       1       // Copy BeObject scripts, Default : On
#define CK_DEPENDENCIES_COPY_BEOBJECT_ATTRIBUTES    2       // Copy BeObject attributes, Default : On
#define CK_DEPENDENCIES_COPY_BEOBJECT_GROUPS        4       // If BeObject belongs to a group, adds its copy to the group, Default : On
#define CK_DEPENDENCIES_COPY_MATERIAL_TEXTURE       1       // Copy Material texture, Default : Off
#define CK_DEPENDENCIES_COPY_MESH_MATERIAL          1       // Copy Mesh materials, Default : Off
#define CK_DEPENDENCIES_COPY_3DENTITY_MESH          1       // Copy 3DEntity meshes, Default : On
#define CK_DEPENDENCIES_COPY_3DENTITY_CHILDREN      2       // Copy 3DEntity hierarchy, Default : On
#define CK_DEPENDENCIES_COPY_3DENTITY_ANIMATIONS    4       // Copy 3DEntity animation, Default : On
#define CK_DEPENDENCIES_COPY_CHARACTER_SHAREANIMS   1       // When copying a character shares its animation data, Default : On
#define CK_DEPENDENCIES_COPY_DATAARRAY_OBJECTS      1       // When copying a DataArray, this options also copies the objects referenced, Default : Off
#define CK_DEPENDENCIES_COPY_DATAARRAY_DATA         2       // Copy DataArray contents, Default : On
#define CK_DEPENDENCIES_COPY_PLACE_PORTALS          1       // Copy portals referenced by a Plane, Default : On
#define CK_DEPENDENCIES_COPY_SPRITE_SHAREBITMAP     1       // Sprite copy will share its bitmap data with the source sprite, Default : On
#define CK_DEPENDENCIES_COPY_SPRITE3D_MATERIAL      1       // Copy Sprite3D material, Default : On
#define CK_DEPENDENCIES_COPY_TARGETLIGHT_TARGET     1       // Copy TargetLight target 3DEntity, Default : On
#define CK_DEPENDENCIES_COPY_TARGETCAMERA_TARGET    1       // Copy TargetCamera target 3DEntity, Default : On
#define CK_DEPENDENCIES_COPY_GROUP_OBJECTS          1       // Copy every objects referenced by the Group, Default : On
#define CK_DEPENDENCIES_COPY_GRID_LAYERS            1       // Copy Grid layers, Default : On
#define CK_DEPENDENCIES_COPY_GRIDLAYER_DATA         1       // Copy Layer Data, Default : On
// Save Dependencies
// Defines which dependencies of an object should also be saved
#define CK_DEPENDENCIES_SAVE_OBJECT_NAME            1       // Save Object name, Default : On
#define CK_DEPENDENCIES_SAVE_BEOBJECT_SCRIPTS       1       // Save BeObject scripts, Default : On
#define CK_DEPENDENCIES_SAVE_BEOBJECT_ATTRIBUTES    2       // Save BeObject attributes, Default : On
#define CK_DEPENDENCIES_SAVE_BEOBJECT_GROUPS        4       // Save groups this object belongs to, Default : On
#define CK_DEPENDENCIES_SAVE_MATERIAL_TEXTURE       1       // Save Material texture, Default : On
#define CK_DEPENDENCIES_SAVE_MESH_MATERIAL          1       // Save Mesh materials, Default : On
#define CK_DEPENDENCIES_SAVE_3DENTITY_MESH          1       // Save 3DEntity meshes, Default : On
#define CK_DEPENDENCIES_SAVE_3DENTITY_CHILDREN      2       // Save 3DEntity children, Default : On
#define CK_DEPENDENCIES_SAVE_3DENTITY_ANIMATIONS    4       // Save 3DEntity animations, Default : On
#define CK_DEPENDENCIES_SAVE_PLACE_PORTALS          1       // Save portals referenced by a Plane, Default : On
#define CK_DEPENDENCIES_SAVE_SPRITE3D_MATERIAL      1       // Save Sprite3D material, Default : On
#define CK_DEPENDENCIES_SAVE_TARGETLIGHT_TARGET     1       // Save TargetLight target 3DEntity, Default : On
#define CK_DEPENDENCIES_SAVE_TARGETCAMERA_TARGET    1       // Save TargetCamera target 3DEntity, Default : On
#define CK_DEPENDENCIES_SAVE_GROUP_OBJECTS          1       // Save every objects referenced by the Group, Default : On

See Also

Virtools SDK Reference, CKDependencies,CKDependenciesContext,CKContext::DestroObjects,CKContext::CopyObjects


Class Identifiers

Macro Class Identifiers

Here is the list of the class which derive from CKObject and their class identifiers. The class identifier is used when creating objects with CKContext::CreateObject. The maximum class identifier is CKCID_MAXCLASSID.

CLASS                   Class Identifier
_____________________________________________
CKObject                CKCID_OBJECT
CKParameter             CKCID_PARAMETER
CKParameterIn           CKCID_PARAMETERIN
CKParameterOut          CKCID_PARAMETEROUT
CKParameterLocal        CKCID_PARAMETERLOCAL
CKParameterOperation    CKCID_PARAMETEROPERATION

CKBehavior              CKCID_BEHAVIOR
CKBehaviorLink          CKCID_BEHAVIORLINK
CKBehaviorIO            CKCID_BEHAVIORIO

CKSceneObject           CKCID_SCENEOBJECT
CKBeObject              CKCID_BEOBJECT
CKScene                 CKCID_SCENE
CKLevel                 CKCID_LEVEL
CKGroup                 CKCID_GROUP
CKDataArray             CKCID_DATAARRAY

CKRenderContext         CKCID_RENDERCONTEXT
CKRenderObject          CKCID_RENDEROBJECT
CKPlace                 CKCID_PLACE
CK2dEntity              CKCID_2DENTITY
CKSprite                CKCID_SPRITE
CKSpriteText            CKCID_SPRITETEXT
CKMaterial              CKCID_MATERIAL
CKTexture               CKCID_TEXTURE
CKMesh                  CKCID_MESH
CKPatchMesh             CKCID_PATCHMESH
CK3dEntity              CKCID_3DENTITY
CKCamera                CKCID_CAMERA
CKTargetCamera          CKCID_TARGETCAMERA
CKCurvePoint            CKCID_CURVEPOINT
CKSprite3D              CKCID_SPRITE3D
CKLight                 CKCID_LIGHT
CKTargetLight           CKCID_TARGETLIGHT
CKCharacter             CKCID_CHARACTER
CK3dObject              CKCID_3DOBJECT
CKBodyPart              CKCID_BODYPART
CKCurve                 CKCID_CURVE
CKGrid                  CKCID_GRID
CKLayer                 CKCID_LAYER
CKKinematicChain        CKCID_KINEMATICCHAIN
CKObjectAnimation       CKCID_OBJECTANIMATION
CKAnimation             CKCID_ANIMATION
CKKeyedAnimation        CKCID_KEYEDANIMATION

CKSound                 CKCID_SOUND
CKWaveSound             CKCID_WAVESOUND
CKMidiSound             CKCID_MIDISOUND

CKSynchroObject         CKCID_SYNCHRO
CKCriticalSectionObject CKCID_CRITICALSECTION
CKStateObject           CKCID_STATE

CK3dPointCloud          CKCID_3DPOINTCLOUD
CKVideo                 CKCID_VIDEO

See Also

Virtools SDK Reference, CK_CLASSID,CKContext::CreateObject


Error Codes

Macro Error Codes

Here is the list of potential error codes:

Code                            Meaning
__________________________________________________________________

CK_OK                           No error (0).
CKERR_INVALIDPARAMETER          One of the parameter passed to the function was invalid
CKERR_INVALIDPARAMETERTYPE      One of the parameter passed to the function was invalid
CKERR_INVALIDSIZE               The parameter size was invalid
CKERR_INVALIDOPERATION          The operation type didn't exist
CKERR_OPERATIONNOTIMPLEMENTED   The function used to execute the operation is not yet implemented
CKERR_OUTOFMEMORY               There was not enough memory to perform the action
CKERR_NOTIMPLEMENTED            The function  is not yet implemented
CKERR_NOTFOUND                  There was an attempt to remove something not present
CKERR_NOLEVEL                   There is no level currently created
CKERR_ALREADYPRESENT            Attempt to add an item that was already present
CKERR_INVALIDRENDERCONTEXT      The render context is not valid
CKERR_RENDERCONTEXTINACTIVE     The render context is not activated for rendering
CKERR_NOLOADPLUGINS             There was no plugins to load this kind of file
CKERR_NOSAVEPLUGINS             There was no plugins to save this kind of file
CKERR_INVALIDFILE               Attempt to load an invalid file
CKERR_INVALIDPLUGIN             Attempt to load with an invalid plugin
CKERR_NOTINITIALIZED            Attempt use an object that wasnt initialized
CKERR_INVALIDMESSAGE            Attempt use a message type that wasn't registred
CKERR_INVALIDPROTOTYPE          Attempt use an invalid prototype
CKERR_NODLLFOUND                No dll file found in the parse directory
CKERR_ALREADYREGISTREDDLL       This dll has already been registred
CKERR_INVALIDDLL                The dll can not be loaded
CKERR_INVALIDOBJECT             Invalid Object (attempt to Get an object from an invalid CK_ID)
CKERR_INVALIDCONDSOLEWINDOW     Invalid window was provided as console window
CKERR_INVALIDKINEMATICCHAIN     Invalid kinematic chain ( end and start effector may not be part of the same hierarchy )
CKERR_NOKEYBOARD                Keyboard not attached or not working properly
CKERR_NOMOUSE                   Mouse not attached or not working properly
CKERR_NOJOYSTICK                Joystick not attached or not working properly
CKERR_INCOMPATIBLEPARAMETERS    Attempt to link imcompatible parameters
CKERR_NORENDERENGINE            There is no render engine dll
CKERR_NOCURRENTLEVEL            There is no current level (use CKContext::SetCurrentLevel )
CKERR_SOUNDDISABLED             Sound Management has been disabled
CKERR_DINPUTDISABLED            DirectInput Management has been disabled
CKERR_INVALIDGUID               Guid is already in use or invalid
CKERR_NOTENOUGHDISKPLACE        There was no more free space on disk when trying to save a file
CKERR_CANTWRITETOFILE           Impossible to write to file (write-protection ?)
CKERR_BEHAVIORADDDENIEDBYCB     The behavior cannnot be added to this entity
CKERR_INCOMPATIBLECLASSID       The behavior cannnot be added to this entity due to incompatible class identifiers
CKERR_MANAGERALREADYEXISTS      A manager was registered more than once
CKERR_NOTIFICATIONNOTHANDLED    The notification message was not used
CKERR_PAUSED                    CKprocess or TimeManager process while CK is paused will fail
CKERR_NOANIMATIONKEY            There were no animation key at the given index
CKERR_INVALIDINDEX              Attemp to acces an animation key with an invalid index
CKERR_INVALIDANIMATION          The animation is invalid (no entity associated or zero length)

See Also

Virtools SDK Reference, CKErrorToString,Creation of new Parameter Operations


VxMath Reference

Math Utilities
System Utilities
Graphic Utilities
Macros
Overloaded Operators
Misc Utilities
Containers
Memory
Type definitions

See Also

Virtools SDK Reference


Math Utilities

Class VxBbox | Class representation of a Bounding Box
External Function VxProjectBoxZExtents | Computes the extents of a box along the Z axis.
External Function VxTransformBox2D | Tests a box against a view frustrum and computes the extents of a box projected on screen.
External Function XCos |
External Function XSin |
Vectors |
Matrix |
Quaternions |
Intersections |

See Also

VxMath Reference


VxBbox

Class VxBbox

Class representation of a Bounding Box

Remarks

The VxBbox structure contains two VxVector Min and Max to represents the Minimum and Maximum coordinates of the corners of a box.

A VxBbox is defined as:

typedef struct VxBbox {
    union {
        struct {
                VxVector Max;
                VxVector Min;
                }
        };
        float v[6];
    };
}

Groups

Data Members
Member Variable Max | Maximum corner of the box
Member Variable Min | Minimum corner of the box
Constructors
Method VxBbox | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method Classify | Returns on which side a box is compared to point
Method ClassifyVertices | classify an array of vertices against the box. An array of dword is filled with flags from the enum VXCLIP_BOXFLAGS
Method ClassifyVerticesOneAxis | classify an array of vertices against one axis of the box. An array of dword is filled with flags 0x01 if < min, 0x10 if > max
Method GetCenter |
Method GetCorners | Get this bbox corners
Method GetHalfSize |
Method GetSize |
Method Intersect | Intersects two boxes
Method IsBoxInside | Tests if a box is totally inside this box.
Method IsValid |
Method Merge | Merges a vector with a box
Method Outline | Outline bbox extent by the given radius
Method Reset | Resets the minimum and maximum values of the box
Method SetCenter |
Method SetCorners |
Method SetDimension |
Method TransformFrom | Recalculates the bounding box from another referential.
Method TransformTo | Calculates the 8 points of the box in a referential.
Method VectorIn | Tests if a point is inside the box.
Comparison Operators
Method operator== | Description: Equality Operator


VxBbox::Max

Member Variable VxBbox::Max

VxVector VxBbox::Max

Remarks

Maximum corner of the box


VxBbox::Min

Member Variable VxBbox::Min

VxVector VxBbox::Min

Remarks

Minimum corner of the box


VxBbox::VxBbox

Method VxBbox::VxBbox

VxBbox::VxBbox(VxVector iMin, VxVector iMax)
VxBbox::VxBbox( float value )

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxBbox::Classify

Method VxBbox::Classify

DWORD VxBbox::Classify(const VxVector& iPoint) const
DWORD VxBbox::Classify(const VxBbox& iBox) const
int VxBbox::Classify(const VxBbox& box2,const VxVector& pt) const

Returns on which side a box is compared to point

Returns

Value | Meaning
2 | If viewed from point pt the box box2 is on the opposite side of this box
1 | box2 is inside this box
0 | No idea where the box is


VxBbox::ClassifyVertices

Method VxBbox::ClassifyVertices

void
VxBbox::ClassifyVertices(const int iVcount, BYTE* iVertices, DWORD iStride, DWORD* oFlags) const

classify an array of vertices against the box. An array of dword is filled with flags from the enum VXCLIP_BOXFLAGS


VxBbox::ClassifyVerticesOneAxis

Method VxBbox::ClassifyVerticesOneAxis

void VxBbox::ClassifyVerticesOneAxis(const int iVcount, BYTE* iVertices, DWORD iStride, const int iAxis,DWORD* oFlags) const

classify an array of vertices against one axis of the box. An array of dword is filled with flags 0x01 if < min, 0x10 if > max


VxBbox::GetCenter

Method VxBbox::GetCenter

VxVector VxBbox::GetCenter() const


VxBbox::GetCorners

Method VxBbox::GetCorners

inline void VxBbox::GetCorners(VxVector corners[8]) const

Remarks

Get this bbox corners


VxBbox::GetHalfSize

Method VxBbox::GetHalfSize

VxVector VxBbox::GetHalfSize() const


VxBbox::GetSize

Method VxBbox::GetSize

VxVector VxBbox::GetSize() const


VxBbox::Intersect

Method VxBbox::Intersect

void VxBbox::Intersect(const VxBbox& v)

Intersects two boxes

Parameters

Input argument v

A VxBbox to intersect with this box

Remarks

The Intersect method calculates the new extents of this box so it only contains the intersection with the v Box


VxBbox::IsBoxInside

Method VxBbox::IsBoxInside

BOOL VxBbox::IsBoxInside(const VxBbox& b) const

Tests if a box is totally inside this box.

Parameters

Input argument b

A VxBbox to test if it is inside the box.

Returns

TRUE if b is inside this box, FALSE otherwise


VxBbox::IsValid

Method VxBbox::IsValid

BOOL VxBbox::IsValid() const


VxBbox::Merge

Method VxBbox::Merge

void VxBbox::Merge (const VxBbox& v)
void VxBbox::Merge (const VxVector& v)

Merges a vector with a box

Parameters

Input argument v

A VxBbox to merge to this box

Remarks

The Merge method calculates the new extents of this box so it contains the v point


VxBbox::Outline

Method VxBbox::Outline

void VxBbox::Outline(float radius)

Outline bbox extent by the given radius


VxBbox::Reset

Method VxBbox::Reset

void VxBbox::Reset()

Resets the minimum and maximum values of the box

Remarks

The Reset method sets the Minimum Value to (1E6,1E6,1E6) and maximum value to (-1E6,-1E6,-1E6)


VxBbox::SetCenter

Method VxBbox::SetCenter

void VxBbox::SetCenter(const VxVector& center,const VxVector& halfsize)


VxBbox::SetCorners

Method VxBbox::SetCorners

void VxBbox::SetCorners(const VxVector& min,const VxVector& max)


VxBbox::SetDimension

Method VxBbox::SetDimension

void VxBbox::SetDimension(const VxVector& position,const VxVector& size)


VxBbox::TransformFrom

Method VxBbox::TransformFrom

void VxBbox::TransformFrom(const VxBbox& sbox,const VxMatrix& Mat)

Recalculates the bounding box from another referential.

Parameters

Input argument sbox | The box that should be transformed. This methods transform sbox by matrix Mat and then recalulcates the extents of the newly generated box.
Input argument Mat | The world transformation matrix for box sbox.

See Also

VxBbox


VxBbox::TransformTo

Method VxBbox::TransformTo

void VxBbox::TransformTo(VxVector* pts,const VxMatrix& Mat) const

Calculates the 8 points of the box in a referential.

Parameters

Output argument pts | A pointer to an array of VxVector (mimimum 8 points). This methods calulcate the 8 points of the box with the orientation defined in matrix Mat.
Input argument Mat | The world transformation matrix for this box.

See Also

VxBbox


VxBbox::VectorIn

Method VxBbox::VectorIn

BOOL VxBbox::VectorIn(const VxVector& v) const

Tests if a point is inside the box.

Parameters

Input argument v

A VxVector to test if it is inside the box.

Returns

TRUE if v is inside this box, FALSE otherwise


VxBbox::operator==

Method VxBbox::operator==

bool VxBbox::operator== (const VxBbox& iBox) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


VxProjectBoxZExtents

External Function VxProjectBoxZExtents

void VxProjectBoxZExtents(const VxMatrix& World_ProjectionMat,const VxBbox& box,float& ZhMin,float& ZhMax)

Computes the extents of a box along the Z axis.

Remarks

This functions projects a VxBbox given a projection matrix World_ProjectionMat and returns the minimum and maximum z values.


VxTransformBox2D

External Function VxTransformBox2D

BOOL VxTransformBox2D(const VxMatrix& World_ProjectionMat,const VxBbox& box,VxRect* ScreenSize,VxRect* extents,VXCLIP_FLAGS& OrClipFlags,VXCLIP_FLAGS& AndClipFlags)

Tests a box against a view frustrum and computes the extents of a box projected on screen.

Parameters

Input argument World_ProjectionMat | A VxMatrix representing the transformation from local coordinates to screen.
Input argument box | A VxBbox that must be projected.
Input argument ScreenSize | A optionnal VxRect containing the extents of the screen on which should be projected the box, if NULL the extents of the box will not be updated, only the clipping flags.
Input argument extents | Result extents of the bounding box, pass NULL if not needed.
Input argument OrClipFlags | The OR combinaison of clipping flags for all 8 corners of the box.
Input argument AndClipFlags | The AND combinaison of clipping flags for all 8 corners of the box.

Remarks

If AndClipFlags is non 0 the bounding box is completly outside the view frustum. If OrClipFlags is 0 the box is completly inside the view frustrum. AndClipFlags and OrClipFlags can be test in detail to see which side of the view frustum the box intersects. Optimized for pentium III processors


XCos

External Function XCos

inline float XCos(float f)


XSin

External Function XSin

inline float XSin(float f)


Vectors

External Function Absolute | Calculates absolute value of a vector. v: A reference to a VxVector.
External Function CrossProduct | Calculates the cross product of two vectors.
External Function DotProduct | Calculates the dot product of two vectors.
External Function Interpolate | Constructs a vector representing the interpolation of two vectors.
External Function InterpolateFloatArray | Interpolates two arrays of float.
External Function InterpolateVectorArray | Interpolates two arrays of VxVector.
External Function InvMagnitude | Returns the inverse magnitude(length) of a vector.
External Function InvSquareMagnitude | Returns the inverse square magnitude(length) of a vector.
External Function Magnitude | Returns the magnitude(length) of a vector.
External Function Max | Calculates the maximum value among the elements of a vector.
External Function Maximize | Constructs a vector containing maximum values of two vectors.
External Function Min | Calculates the minimum value among the elements of a vector.
External Function Minimize | Constructs a vector containing minimum values of two vectors.
External Function MultiplyAdd | 'dest' is set to 'factor' * 'arg0' + 'arg1'
External Function MultiplyVectorArray | Multiplies an array of VxVector or VxVector4 by a constant factor.
External Function Normalize | Returns a normalized vector (length=1).
External Function Reflect | Returns the reflection of vector against a plane.
External Function Rotate | Rotates a vector around an axis given an angle.
External Function SquareMagnitude | Returns the square magnitude(length) of a vector.
Class Vx2DVector | Class representation of a Vector in 2 dimensions
Class VxCompressedVector | Class representation of a unit vector in 3 dimensions
Class VxVector | Class representation of a Vector in 3 dimensions
Class VxVector4 | Class representation of a Vector of 4 elements (x,y,z,w)

See Also

Math Utilities


Absolute

External Function Absolute

inline const VxVector Absolute (const VxVector& v)

Calculates absolute value of a vector.

v: A reference to a VxVector.

Returns

A VxVector with each element set to the absolute value of the corresponding element in v.

See Also

VxVector,


CrossProduct

External Function CrossProduct

inline const VxVector CrossProduct (const VxVector& Vect1, const VxVector& Vect2)

Calculates the cross product of two vectors.

Parameters

Input argument Vect1 | First source Vector.
Input argument Vect2 | Second source Vector.

Returns

A VxVector result of the cross product of Vect1^Vect2.

See Also

VxVector


DotProduct

External Function DotProduct

inline float DotProduct (const VxQuaternion& q1, const VxQuaternion& q2)
inline float DotProduct (const VxVector& v1, const VxVector& v2)

Calculates the dot product of two vectors.

Parameters

Vect1: First source Vector. Vect2: Second source Vector.

Returns

A float result of the dot product of Vect1.Vect2.

See Also

VxVector,Vx2DVector


Interpolate

External Function Interpolate

inline const VxVector Interpolate (float step, const VxVector& v1, const VxVector& v2)

Constructs a vector representing the interpolation of two vectors.

Parameters

Input argument step | The interpolation factor.
Input argument v1 | A reference to a VxVector.
Input argument v2 | A reference to a VxVector.

Returns

A VxVector .

See Also

VxVector


InterpolateFloatArray

External Function InterpolateFloatArray

void InterpolateFloatArray(void* Res,void* array1,void *array2,float factor,int count)

Interpolates two arrays of float.

Parameters

Output argument Res | A pointer to an array of float
Input argument array1 | A pointer to an array of float
Input argument array2 | A pointer to an array of float
Input argument factor | Interpolation coefficient.
Input argument count | Number of element to interpolate.

Remarks

This method computes a linear interpolation between each element according to the interpolation factor.

InterpolateFloatArray must be used only for arrays of float containing at least 4 elements

See Also

InterpolateVectorArray


InterpolateVectorArray

External Function InterpolateVectorArray

void InterpolateVectorArray(void* Res,void* Inarray1,void *Inarray2,float factor,int count,DWORD StrideRes,DWORD StrideIn)

Interpolates two arrays of VxVector.

Parameters

Output argument Res | A pointer to an array of VxVector
Input argument Inarray1 | A pointer to an array of VxVector
Input argument Inarray2 | A pointer to an array of VxVector
Input argument factor | Interpolation coefficient.
Input argument count | Number of element to interpolate.
Input argument StrideRes | Amount in byte between two consecutive VxVector in res array.
Input argument StrideIn | Amount in byte between two consecutive VxVector in Inarray1 and Inarray2 arrays.

Remarks

This method computes a linear interpolation between each element according to the interpolation factor.

InterpolateVectorArray must be used only for arrays of float containing at least 2 elements

See Also

InterpolateFloatArray


InvMagnitude

External Function InvMagnitude

inline float InvMagnitude (const VxVector& v)

Returns the inverse magnitude(length) of a vector.

Parameters

Input argument v

a pointer to a VxVector which inverse magnitude should be returned

Returns

Inverse magnitude of v

Remarks

This method returns the inverse magnitude (1/length) of the vector v. WARNING: Calling this function with a null vector (0,0,0) will return an indefinite value (constant NaN - not a number)

See Also

Magnitude


InvSquareMagnitude

External Function InvSquareMagnitude

inline float InvSquareMagnitude (const VxVector& v)

Returns the inverse square magnitude(length) of a vector.

Parameters

Input argument v

a pointer to a VxVector which inverse magnitude should be returned

Returns

Inverse Square magnitude of v

Remarks

This method returns the inverse square magnitude (1/(length*length)) of the vector v.

See Also

SquareMagnitude


Magnitude

External Function Magnitude

inline float Magnitude (const VxQuaternion& q)
inline float Magnitude (const VxVector& v)

Returns the magnitude(length) of a vector.

Parameters

Input argument v

a pointer to a VxVector which magnitude should be returned

Returns

Magnitude of v

Remarks

This method returns the length of the vector v. WARNING: Calling this function with a null vector (0,0,0) will return an indefinite value (constant NaN - not a number)

See Also

SquareMagnitude


Max

External Function Max

inline float Max (const VxVector& v)

Calculates the maximum value among the elements of a vector.

Parameters

Input argument v

A Vector.

Returns

A float value containing the maximum of the elements of v.

See Also

VxVector,Vx2DVector


Maximize

External Function Maximize

inline const VxVector Maximize (const VxVector& v1, const VxVector& v2)

Constructs a vector containing maximum values of two vectors.

Parameters

Input argument v1 | A reference to a VxVector.
Input argument v2 | A reference to a VxVector.

Returns

A VxVector containing with each element equal to the greatest element of v1 or v2.

See Also

VxVector


Min

External Function Min

inline float Min (const VxVector& v)

Calculates the minimum value among the elements of a vector.

Parameters

Input argument v

A Vector.

Returns

A float value containing the minimum of the elements of v.

See Also

VxVector,Vx2DVector


Minimize

External Function Minimize

inline const VxVector Minimize (const VxVector& v1, const VxVector& v2)

Constructs a vector containing minimum values of two vectors.

Parameters

Input argument v1 | A Vector.
Input argument v2 | A Vector.

Returns

A VxVector containing with each element equal to the smallest element of v1 or v2.

See Also

VxVector


MultiplyAdd

External Function MultiplyAdd

inline const void MultiplyAdd(VxVector& dest, float factor, const VxVector& arg0, const VxVector& arg1)

'dest' is set to 'factor' * 'arg0' + 'arg1'

Parameters

'dest': The target vector


MultiplyVectorArray

External Function MultiplyVectorArray

void MultiplyVectorArray(void* Res,void* Inarray1,const VxVector& factor,int count,DWORD StrideRes,DWORD StrideIn)
void MultiplyVector2Array(void* Res,void* Inarray1,const Vx2DVector& factor,int count,DWORD StrideRes,DWORD StrideIn)
void MultiplyVector4Array(void* Res,void* Inarray1,const VxVector4& factor,int count,DWORD StrideRes,DWORD StrideIn)
void MultiplyAddVectorArray(void* Res,void* Inarray1,const VxVector& factor,const VxVector& offset,int count,DWORD StrideRes,DWORD StrideIn)
void MultiplyAddVector4Array(void* Res,void* Inarray1,const VxVector4& factor,const VxVector4& offsetv,int count,DWORD StrideRes,DWORD StrideIn)

Multiplies an array of VxVector or VxVector4 by a constant factor.

Parameters

Output argument Res | A pointer to an array of VxVector
Input argument Inarray1 | A pointer to an array of VxVector
Input argument factor | VxVector to multiply each element of Inarray1 by
Input argument count | Number of element to interpolate. StrideIn1: Amount in byte between two consecutive VxVector in Inarray1 array.
Input argument StrideRes | Amount in byte between two consecutive VxVector in res array.

Remarks

This method computes the multiplication of each element of Inarray1 by factor and store the result in Res MultiplyVector4Array performs the multiplication on VxVector4 elements

See Also

InterpolateFloatArray,InterpolateVectorArray


Normalize

External Function Normalize

inline const VxVector Normalize (const VxVector& v)
inline const VxVector Normalize (const VxVector *vect)

Returns a normalized vector (length=1).

Parameters

Input argument v

Vector to normalize.

Returns

A Vector equal to Vect Normalized.

Remarks

This method returns a vector equal to Vect normalized to length 1.0. WARNING: Calling this function with a null vector (0,0,0) will return an indefinite vector (constant NaN - not a number). This function is more precise than VxVector::Normalize.

See Also

Magnitude,VxVector,Vx2DVector


Reflect

External Function Reflect

inline const VxVector Reflect(const VxVector& v1,const VxVector& Norm)

Returns the reflection of vector against a plane.

Parameters

Input argument v1 | A pointer to a VxVector giving the incident vector (pointing away from the plane)
Input argument Norm | A VxVector giving the normal point away from the plane of reflection.

Returns

A Vector equal to the reflection of v1.

Remarks

This method calculates the vector reflection of v1 against the plane described by normal Norm. using the following equation :

R

2*(V dot N)*N - V

It is expected that the incident vector v1 is pointing away from the plane. The resultant vector R will also be pointing away from the plane.

See Also

DotProduct


Rotate

External Function Rotate

const VxVector Rotate(const VxVector *Vect1, const VxVector *Vect2,float Angle)
const VxVector Rotate(const VxVector& Vect1, const VxVector& Vect2,float Angle)
const VxVector Rotate(const VxMatrix& Mat,const VxVector& Vect1)

Rotates a vector around an axis given an angle.

Parameters

Vect2 | a pointer or reference to a VxVector giving the axis of rotation
Angle | Amount in radians to rotate Vect1
Input argument Mat | Matrix to rotate the vector by.
Vect1 | a pointer or reference to a VxVector to be rotated

Returns

Vect1 rotated around Vect2 or by Mat

Remarks

This method rotates the vector Vect1 around the axis vector Vect2 by Angle radians.

See Also

VxVector::Rotate


SquareMagnitude

External Function SquareMagnitude

inline float SquareMagnitude (const VxVector& v)

Returns the square magnitude(length) of a vector.

Parameters

Input argument v

a pointer to a VxVector which magnitude should be returned

Returns

Square magnitude of v

Remarks

This method returns the square magnitude (length*length) of the vector v.

See Also

Magnitude


Vx2DVector

Class Vx2DVector

Class representation of a Vector in 2 dimensions

Remarks

A Vx2DVector is defined as:

struct Vx2DVector {
    union {
        struct {
            float x,y;
        };
    float v[2];
    };
}

Groups

Data Members | Constructors | Assignment | Operators | Comparison Operators | Vectors

Data Members
Member Variable x |
Member Variable y |
Constructors
Method Vx2DVector | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Assignment
Method operator*= | Description: Multiply-Equals Operator This sets the current object to the product of the original value of this object and the value on the right.
Method operator+= | Description: Plus-Equals Operator This sets the current object to the sum of the original value of this object and the value on the right.
Method operator-= | Description: Minus-Equals Operator This sets the current object to the difference between the original value of this object and the value on the right.
Method operator/= | Description: Divide-Equals Operator This sets the current object to the result of dividing the original value of this object by the value on the right.
Operators
Method operator* | Memberwise multiplication and division
Method operator+ | Addition and subtraction
Method operator- | Description: Negation Operator
Method operator/ | Description: Division Operator
Method operator[] | Access to the given index of a vector.
Comparison Operators
Method operator!= | Description: Not-Equals Operator
Method operator< | Vector dominance
Method operator<= | Description: Less-Than-Or-Equal Operator
Method operator== | Bitwise equality
Vectors
Method Cross | Calculates the cross vector.
Method Dot | Calculates the dot product of two 2D vectors.
Method Magnitude | Calculates the length of the vector.
Method Max | returns the Max of the two components of a vector.
Method Min | returns the Min of the two components of a vector.
Method Normalize | Normalize the vector (length=1).
Method Set | Initializes a Vx2DVector from 2 float (or int) components.
Method SquareMagnitude | Calculates the square length of the vector.


Vx2DVector::x

Member Variable Vx2DVector::x

float Vx2DVector::x,y;


Vx2DVector::y

Member Variable Vx2DVector::y

float x,Vx2DVector::y;


Vx2DVector::Vx2DVector

Method Vx2DVector::Vx2DVector

Vx2DVector::Vx2DVector()
Vx2DVector::Vx2DVector(float f)
Vx2DVector::Vx2DVector(float iX, float iY)
Vx2DVector::Vx2DVector(int iX, int iY)
Vx2DVector::Vx2DVector(const float f[2])

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


Vx2DVector::operator*=

Method Vx2DVector::operator*=

Vx2DVector& Vx2DVector::operator*= (const Vx2DVector& v)
Vx2DVector& Vx2DVector::operator*= (float s)

Returns

A reference to the current object.

Remarks

Description: Multiply-Equals Operator

This sets the current object to the product of the original value of this object and the value on the right.


Vx2DVector::operator+=

Method Vx2DVector::operator+=

Vx2DVector& Vx2DVector::operator+= (const Vx2DVector& v)

Returns

A reference to the current object.

Remarks

Description: Plus-Equals Operator

This sets the current object to the sum of the original value of this object and the value on the right.


Vx2DVector::operator-=

Method Vx2DVector::operator-=

Vx2DVector& Vx2DVector::operator-= (const Vx2DVector& v)

Returns

A reference to the current object.

Remarks

Description: Minus-Equals Operator

This sets the current object to the difference between the original value of this object and the value on the right.


Vx2DVector::operator/=

Method Vx2DVector::operator/=

Vx2DVector& Vx2DVector::operator/= (const Vx2DVector& v)
Vx2DVector& Vx2DVector::operator/= (float s)

Returns

A reference to the current object.

Remarks

Description: Divide-Equals Operator

This sets the current object to the result of dividing the original value of this object by the value on the right.


Vx2DVector::operator*

Method Vx2DVector::operator*

Vx2DVector Vx2DVector::operator* (const Vx2DVector& v) const
Vx2DVector Vx2DVector::operator* (float s) const

Returns

The result of multiplying the current object by the value of the object on the right.

Remarks

Memberwise multiplication and division


Vx2DVector::operator+

Method Vx2DVector::operator+

Vx2DVector Vx2DVector::operator+ () const
Vx2DVector Vx2DVector::operator+ (const Vx2DVector& v) const

Returns

The positive of the current object.

Remarks

Addition and subtraction


Vx2DVector::operator-

Method Vx2DVector::operator-

Vx2DVector Vx2DVector::operator- () const
Vx2DVector Vx2DVector::operator- (const Vx2DVector& v) const

Returns

The negation of the current object.

Remarks

Description: Negation Operator


Vx2DVector::operator/

Method Vx2DVector::operator/

Vx2DVector Vx2DVector::operator/ (const Vx2DVector& v) const
Vx2DVector Vx2DVector::operator/ (float s) const

Returns

The current object divided by the one on the right.

Remarks

Description: Division Operator


Vx2DVector::operator[]

Method Vx2DVector::operator[]

const float& Vx2DVector::operator[] (int i) const
float& Vx2DVector::operator[] (int i)

Access to the given index of a vector.

Parameters

i

index to access.

Returns

A reference to the component.

Remarks

  1. is x

  2. is y

See Also

Vx2DVector, Normalize


Vx2DVector::operator!=

Method Vx2DVector::operator!=

bool Vx2DVector::operator!= (const Vx2DVector& v) const

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


Vx2DVector::operator<

Method Vx2DVector::operator<

bool Vx2DVector::operator< (const Vx2DVector& v) const

Returns

This returns true if this object is less than the one on the right-hand-side of the operator.

Remarks

Vector dominance


Vx2DVector::operator<=

Method Vx2DVector::operator<=

bool Vx2DVector::operator<= (const Vx2DVector& v) const

Returns

This returns true if this object is not greater than the one on the right-hand-side of the operator.

Remarks

Description: Less-Than-Or-Equal Operator


Vx2DVector::operator==

Method Vx2DVector::operator==

bool Vx2DVector::operator== (const Vx2DVector& v) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Bitwise equality


Vx2DVector::Cross

Method Vx2DVector::Cross

Vx2DVector Vx2DVector::Cross() const

Calculates the cross vector.

See Also

Vx2DVector, Normalize


Vx2DVector::Dot

Method Vx2DVector::Dot

float Vx2DVector::Dot(const Vx2DVector& iV) const

Calculates the dot product of two 2D vectors.

Parameters

Input argument iV

vector to be multiplied by the calling vector.

Returns

Result of the dot product (this . iV).

Remarks

To calculates a distance from a point to a line using a dot product, the vector representing the line should be normalized.

See Also

Vx2DVector, Normalize


Vx2DVector::Magnitude

Method Vx2DVector::Magnitude

float Vx2DVector::Magnitude() const

Calculates the length of the vector.

Returns

The length of the vector.

Remarks

WARNING: Calling this function with a null vector (0,0,0) will return an indefinite length (constant NaN - not a number)

See Also

Normalize, SquareMagnitude


Vx2DVector::Max

Method Vx2DVector::Max

float Vx2DVector::Max() const

returns the Max of the two components of a vector.

Returns

Max component.

See Also

Vx2DVector, Normalize


Vx2DVector::Min

Method Vx2DVector::Min

float Vx2DVector::Min() const

returns the Min of the two components of a vector.

Returns

Min component.

See Also

Vx2DVector, Normalize


Vx2DVector::Normalize

Method Vx2DVector::Normalize

Vx2DVector& Vx2DVector::Normalize()

Normalize the vector (length=1).

Remarks

This method sets the magnitude of the vector to 1.0. WARNING: Calling this function with a null vector (0,0,0) will return an indefinite vector (constant NaN - not a number)

See Also

Magnitude


Vx2DVector::Set

Method Vx2DVector::Set

void Vx2DVector::Set(float iX, float iY)
void Vx2DVector::Set(int iX,int iY)

Initializes a Vx2DVector from 2 float (or int) components.

Parameters

iX,iY: floating point (or integer) components.

See Also

VxVector


Vx2DVector::SquareMagnitude

Method Vx2DVector::SquareMagnitude

float Vx2DVector::SquareMagnitude() const

Calculates the square length of the vector.

Returns

The length of the vector.

Remarks

WARNING: Calling this function with a null vector (0,0,0) will return an indefinite length (constant NaN - not a number)

See Also

Normalize, Magnitude


VxCompressedVector

Class VxCompressedVector

Class representation of a unit vector in 3 dimensions

Remarks

A VxCompressedVector is defined as:

typedef struct VxCompressedVector
{
    short int xa,ya
}

The xa and ya members are polar angles

This representation can be used to store normals or unit vectors using less memory than a conventionnal vector.

Groups

Data Members | Constructors | Operations | Overloaded Operators | Vectors

Data Members
Member Variable xa |
Member Variable ya | Polar Angles
Constructors
Method VxCompressedVector | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method Set |
Overloaded Operators
Method operator= | Description: Assignment Operator This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.
Vectors
Method Lerp | Linear interpolation of a compressed vector by the given amount. Because the vector is stored in polar coordinate, it will remains unit sized after the interpolation.
Method Slerp | Spherical linear interpolation of a compressed vector by the given amount. Contrary to Lerp, Angle variation is linear.


VxCompressedVector::xa

Member Variable VxCompressedVector::xa

short int VxCompressedVector::xa,ya;


VxCompressedVector::ya

Member Variable VxCompressedVector::ya

short int xa,VxCompressedVector::ya;

Remarks

Polar Angles


VxCompressedVector::VxCompressedVector

Method VxCompressedVector::VxCompressedVector

VxCompressedVector::VxCompressedVector()
VxCompressedVector::VxCompressedVector(float _x, float _y, float _z)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxCompressedVector::Set

Method VxCompressedVector::Set

void VxCompressedVector::Set(float X,float Y,float Z)


VxCompressedVector::operator=

Method VxCompressedVector::operator=

inline VxCompressedVector& VxCompressedVector::operator= (const VxVector& v)
inline VxCompressedVector& VxCompressedVector::operator= (const VxCompressedVectorOld& v)

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


VxCompressedVector::Lerp

Method VxCompressedVector::Lerp

inline void VxCompressedVector::Lerp(float step,VxCompressedVector &v1,VxCompressedVector &v2)

Linear interpolation of a compressed vector by the given amount. Because the vector is stored in polar coordinate, it will remains unit sized after the interpolation.

Parameters

Input argument step

Interpolation amount vx1: Vector we are interpolating from vx2: Vector we are interpolating to


VxCompressedVector::Slerp

Method VxCompressedVector::Slerp

inline void VxCompressedVector::Slerp(float step,VxCompressedVector &v1,VxCompressedVector &v2)

Spherical linear interpolation of a compressed vector by the given amount. Contrary to Lerp, Angle variation is linear.

Parameters

Input argument step

Interpolation amount vx1: Vector we are interpolating from vx2: Vector we are interpolating to


VxVector

Class VxVector

Class representation of a Vector in 3 dimensions

Subclasses

VxVector4

Remarks

A VxVector is defined as:

typedef struct VxVector {
    union {
            struct {
                float x,y,z;
            };
            float v[3];
    };
}

Elements can be accessed with x,y,z value or through the array v.

Groups

Data Members | Constructors | Assignment | Operators | Operations | Vectors

Data Members
Member Variable x |
Member Variable y |
Member Variable z |
Constructors
Method VxVector | Constructors
Assignment
Method operator*= | Description: Multiply-Equals Operator This sets the current object to the product of the original value of this object and the value on the right.
Method operator+= | Description: Plus-Equals Operator This sets the current object to the sum of the original value of this object and the value on the right.
Method operator-= | Description: Minus-Equals Operator This sets the current object to the difference between the original value of this object and the value on the right.
Method operator/= | Description: Divide-Equals Operator This sets the current object to the result of dividing the original value of this object by the value on the right.
Method operator= | Description: Assignment Operator This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.
Operators
Method operator+ | Description: Addition Operator
Method operator- | Description: Subtraction Operator
Method operator[] | Access grants
Operations
Method Absolute | Calculates absolute value of a vector. Each element is set to its absolute value.
Static Object Method axis0 | Return VxVector(0,0,0)
Static Object Method axis1 | Return VxVector(1,1,1)
Static Object Method axisX | Return VxVector(1,0,0)
Static Object Method axisY | Return VxVector(0,1,0)
Static Object Method axisZ | Return VxVector(0,0,1)
Method Dot |
Method Normalize | Normalizes this vector by making it of length 1. If you need precise normalization, use Normalize(const VxVector& v) or Normalize(const VxVector *vect)
Method Rotate | Rotates a vector given a matrix
Method Set | Initialization
Vectors
Method Interpolate | Constructs a vector representing the interpolation of two vectors.
Method Magnitude | Returns the magnitude(length) of a vector.
Method SquareMagnitude | Returns the square magnitude(length) of a vector.


VxVector::x

Member Variable VxVector::x

float VxVector::x,y,z;


VxVector::y

Member Variable VxVector::y

float x,VxVector::y,z;


VxVector::z

Member Variable VxVector::z

float x,y,VxVector::z;


VxVector::VxVector

Method VxVector::VxVector

VxVector::VxVector()
VxVector::VxVector(const VxCompressedVector& v)
inline VxVector::VxVector(float f)
inline VxVector::VxVector(float _x, float _y, float _z)
inline VxVector::VxVector(const float f[3])

Remarks

Constructors


VxVector::operator*=

Method VxVector::operator*=

inline VxVector& VxVector::operator*= (const VxVector& v)
inline VxVector& VxVector::operator*= (float s)

Returns

A reference to the current object.

Remarks

Description: Multiply-Equals Operator

This sets the current object to the product of the original value of this object and the value on the right.


VxVector::operator+=

Method VxVector::operator+=

inline VxVector& VxVector::operator+= (const VxVector& v)

Returns

A reference to the current object.

Remarks

Description: Plus-Equals Operator

This sets the current object to the sum of the original value of this object and the value on the right.


VxVector::operator-=

Method VxVector::operator-=

inline VxVector& VxVector::operator-= (const VxVector& v)

Returns

A reference to the current object.

Remarks

Description: Minus-Equals Operator

This sets the current object to the difference between the original value of this object and the value on the right.


VxVector::operator/=

Method VxVector::operator/=

inline VxVector& VxVector::operator/= (const VxVector& v)
inline VxVector& VxVector::operator/= (float s)

Returns

A reference to the current object.

Remarks

Description: Divide-Equals Operator

This sets the current object to the result of dividing the original value of this object by the value on the right.


VxVector::operator=

Method VxVector::operator=

VxVector& VxVector::operator= (const VxCompressedVector& v)

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


VxVector::operator+

Method VxVector::operator+

VxVector VxVector::operator+ (float s) const

Returns

The current object added with the value of the object on the right-hand-side of the operator.

Remarks

Description: Addition Operator


VxVector::operator-

Method VxVector::operator-

VxVector VxVector::operator- (float s) const

Returns

The result of subtracting the value of the object on the right from this object.

Remarks

Description: Subtraction Operator


VxVector::operator[]

Method VxVector::operator[]

const float& VxVector::operator[](int i) const
inline float& VxVector::operator[](int i)

Returns

The value that this object associates with the value of the object that is the parameter to this operator.

Remarks

Access grants


VxVector::Absolute

Method VxVector::Absolute

void inline VxVector::Absolute ()

Calculates absolute value of a vector.

Each element is set to its absolute value.

See Also

VxVector


VxVector::axis0

Static Object Method VxVector::axis0

const VxVector& VxVector::axis0()

Return VxVector(0,0,0)


VxVector::axis1

Static Object Method VxVector::axis1

const VxVector& VxVector::axis1()

Return VxVector(1,1,1)


VxVector::axisX

Static Object Method VxVector::axisX

const VxVector& VxVector::axisX()

Return VxVector(1,0,0)


VxVector::axisY

Static Object Method VxVector::axisY

const VxVector& VxVector::axisY()

Return VxVector(0,1,0)


VxVector::axisZ

Static Object Method VxVector::axisZ

const VxVector& VxVector::axisZ()

Return VxVector(0,0,1)


VxVector::Dot

Method VxVector::Dot

float VxVector::Dot(const VxVector& iV) const


VxVector::Normalize

Method VxVector::Normalize

void VxVector::Normalize()

Remarks

Normalizes this vector by making it of length 1. If you need precise normalization, use Normalize(const VxVector& v) or Normalize(const VxVector *vect)


VxVector::Rotate

Method VxVector::Rotate

void VxVector::Rotate(const VxMatrix& Mat)

Rotates a vector given a matrix

Parameters

Input argument Mat

A VxMatrix to rotate the vector by.

Remarks

This method rotates the vector by using the upper left 3x3 matrix in Mat.

See Also

Rotate


VxVector::Set

Method VxVector::Set

inline void VxVector::Set(float _x, float _y, float _z)

Remarks

Initialization


VxVector::Interpolate

Method VxVector::Interpolate

inline void VxVector::Interpolate(float amount, const VxVector& target)

Constructs a vector representing the interpolation of two vectors.

Parameters

Input argument amount | The interpolation factor.
Input argument target | The vector toward which this vector is interpolated

Returns

None.

See Also

VxVector


VxVector::Magnitude

Method VxVector::Magnitude

float VxVector::Magnitude () const

Returns the magnitude(length) of a vector.

Returns

Magnitude of the vector

Remarks

This method returns the length of the vector v. WARNING: Calling this function with a null vector (0,0,0) will return an indefinite value (constant NaN - not a number)

See Also

SquareMagnitude


VxVector::SquareMagnitude

Method VxVector::SquareMagnitude

float VxVector::SquareMagnitude () const

Returns the square magnitude(length) of a vector.

Returns

Square magnitude of the vector

Remarks

This method returns the square magnitude (length*length) of the vector v.

See Also

Magnitude


VxVector4

Class VxVector4

Class representation of a Vector of 4 elements (x,y,z,w)

VxVector
Show brief derivation trees

VxVector4

VxVector
Show full derivation trees

VxVector4

Remarks

VxVector4 is used for 3D Transformation when the w component is used for perspective information. Most of the methods available for a VxVector are also implemented for the VxVector4

A VxVector4 is defined as:

typedef struct VxVector4 {
    union {
            struct {
                float x,y,z,w;
            };
            float v[4];
    };
}

Groups

Data Members | Constructors | Assignment | Operators | Operations | Coercion Operators

Data Members
Member Variable w |
Member Variable x |
Member Variable y |
Member Variable z |
Constructors
Method VxVector4 | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Assignment
Method operator*= | Description: Multiply-Equals Operator This sets the current object to the product of the original value of this object and the value on the right.
Method operator+= | Description: Plus-Equals Operator This sets the current object to the sum of the original value of this object and the value on the right.
Method operator-= | Description: Minus-Equals Operator This sets the current object to the difference between the original value of this object and the value on the right.
Method operator/= | Description: Divide-Equals Operator This sets the current object to the result of dividing the original value of this object by the value on the right.
Method operator= | Description: Assignment Operator This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.
Operators
Method operator+ | Description: Addition Operator
Method operator- | Description: Subtraction Operator
Method operator[] | Access grants
Operations
Method Absolute | Calculates absolute value of a vector. Each element is set to its absolute value.
Static Object Method axis0 | Return VxVector(0,0,0)
Static Object Method axis1 | Return VxVector(1,1,1)
Static Object Method axisX | Return VxVector(1,0,0)
Static Object Method axisY | Return VxVector(0,1,0)
Static Object Method axisZ | Return VxVector(0,0,1)
Method Dot |
Method Normalize | Normalizes this vector by making it of length 1. If you need precise normalization, use Normalize(const VxVector& v) or Normalize(const VxVector *vect)
Method Rotate | Rotates a vector given a matrix
Method Set | Initialization
Coercion Operators
Method cast operator | Description: Converts to another type. This converts the current object to a particular type.


VxVector4::w

Member Variable VxVector4::w

float VxVector4::w


VxVector4::VxVector4

Method VxVector4::VxVector4

VxVector4::VxVector4()
VxVector4::VxVector4(float f)
VxVector4::VxVector4(float _x, float _y, float _z,float _w)
VxVector4::VxVector4(const float f[4])

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxVector4::operator*=

Method VxVector4::operator*=

inline VxVector4& VxVector4::operator*= (const VxVector4& v)
inline VxVector4& VxVector4::operator*= (const VxVector& v)
inline VxVector4& VxVector4::operator*= (float s)

Returns

A reference to the current object.

Remarks

Description: Multiply-Equals Operator

This sets the current object to the product of the original value of this object and the value on the right.


VxVector4::operator+=

Method VxVector4::operator+=

inline VxVector4& VxVector4::operator+= (const VxVector4& v)
inline VxVector4& VxVector4::operator+= (const VxVector& v)

Returns

A reference to the current object.

Remarks

Description: Plus-Equals Operator

This sets the current object to the sum of the original value of this object and the value on the right.


VxVector4::operator-=

Method VxVector4::operator-=

inline VxVector4& VxVector4::operator-= (const VxVector4& v)
inline VxVector4& VxVector4::operator-= (const VxVector& v)

Returns

A reference to the current object.

Remarks

Description: Minus-Equals Operator

This sets the current object to the difference between the original value of this object and the value on the right.


VxVector4::operator/=

Method VxVector4::operator/=

inline VxVector4& VxVector4::operator/= (const VxVector4& v)
inline VxVector4& VxVector4::operator/= (const VxVector& v)
inline VxVector4& VxVector4::operator/= (float s)

Returns

A reference to the current object.

Remarks

Description: Divide-Equals Operator

This sets the current object to the result of dividing the original value of this object by the value on the right.


VxVector4::operator=

Method VxVector4::operator=

VxVector4& VxVector4::operator= (const VxVector& v)

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


VxVector4::operator+

Method VxVector4::operator+

VxVector4 VxVector4::operator+ (float s) const

Returns

The current object added with the value of the object on the right-hand-side of the operator.

Remarks

Description: Addition Operator


VxVector4::operator-

Method VxVector4::operator-

VxVector4 VxVector4::operator- (float s) const

Returns

The result of subtracting the value of the object on the right from this object.

Remarks

Description: Subtraction Operator


VxVector4::operator[]

Method VxVector4::operator[]

const float&VxVector4::operator[](int i) const
inline float& VxVector4::operator[](int i)

Returns

The value that this object associates with the value of the object that is the parameter to this operator.

Remarks

Access grants


VxVector4::Dot

Method VxVector4::Dot

float VxVector4::Dot(const VxVector4& iV) const


VxVector4::Set

Method VxVector4::Set

void VxVector4::Set(float X,float Y,float Z,float W)
inline void VxVector4::Set(float _x, float _y, float _z)

Remarks

Initialization


VxVector4::cast operator

Method VxVector4::cast operator

VxVector4::operator float*() const

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


Matrix

External Function Vx3DDecomposeMatrix | Decomposes a matrix into quaternion,position and scale factors.
External Function Vx3DDecomposeMatrixTotal | Decomposes a matrix into quaternion,position,scale and off-axis scale factors.
External Function Vx3DInterpolateMatrix | Interpolates two matrices
External Function Vx3DInverseMatrix | Calculates the inverse of a Matrix
External Function Vx3DInverseMatrix44 | Calculates the inverse of a Matrix
External Function Vx3DMatrixDeterminant | Calculates the determinant of a Matrix
External Function Vx3DMatrixFromEulerAngles | Calculates the matrix given three angles around each axis.
External Function Vx3DMatrixFromRotation | Calculates the matrix given a rotation around an axis
External Function Vx3DMatrixFromRotationAndOrigin | Calculates the matrix given a rotation around an axis and a point.
External Function Vx3DMatrixIdentity | Sets a matrix to the identity matrix.
External Function Vx3DMatrixPolarDecomposition | Polar Decomposition of a MAtrix
External Function Vx3DMatrixSpectralDecomposition | Spectral Decomposition of a VxMatrix
External Function Vx3DMultiplyMatrix | Multiplies two matrices.
External Function Vx3DMultiplyMatrixVector | Multiplies a Vector by a Matrix.
External Function Vx3DMultiplyMatrixVector4 | Multiplies a VxVector4 by a Matrix.
External Function Vx3DRotateVector | Multiplies a Vector by a Matrix using only rotation part.
External Function Vx3DTransposeMatrix |
External Function VxInverseProject | Computes a 3D position given a 2D vector, Z value and projection matrix.
Class VxMatrix |

See Also

Math Utilities


Vx3DDecomposeMatrix

External Function Vx3DDecomposeMatrix

void Vx3DDecomposeMatrix(const VxMatrix& A, VxQuaternion &Quat,VxVector &Pos,VxVector &Scale)

Decomposes a matrix into quaternion,position and scale factors.

Parameters

Input argument A | The matrix to decompose
Output argument Quat | Result VxQuaternion for orientation
Output argument Pos | A VxVector giving the position information.
Output argument Scale | A VxVector giving the scale factors

Remarks

o Vx3DDecomposeMatrix uses a Polar decomposition to extract a Orientation and Scale matrix. The orientation matrix is then convert into a VxQuaternion and Scale factors are extract from Scale matrix.

See Also

Vx3DDecomposeMatrixTotal,Vx3DDecomposeMatrixTotalPtr,Vx3DMatrixPolarDecomposition


Vx3DDecomposeMatrixTotal

External Function Vx3DDecomposeMatrixTotal

float Vx3DDecomposeMatrixTotal(const VxMatrix& A, VxQuaternion &Quat,VxVector &Pos,VxVector &Scale,VxQuaternion &URot)
float Vx3DDecomposeMatrixTotalPtr(const VxMatrix& A, VxQuaternion *Quat,VxVector *Pos,VxVector *Scale,VxQuaternion *URot)

Decomposes a matrix into quaternion,position,scale and off-axis scale factors.

Parameters

Input argument A | The matrix to decompose
Output argument Quat | Result VxQuaternion for orientation
Output argument Pos | A VxVector giving the position information.
Output argument Scale | A VxVector giving the scale factors
Output argument URot | A VxQuaternion giving the off-axis scale orientation.

Returns

A float = 1 if determinant of the matrix is positive, -1 otherwise.

Remarks

o Vx3DDecomposeMatrixTotal uses a Polar decomposition to extract a Orientation and Scale matrix. The orientation matrix is then convert into a VxQuaternion. Scale matrix is then decomposed using a SpectraDecompostion to extract rotation (URot) for scale factors.

o Vx3DDecomposeMatrixTotalPtr is the same function that Vx3DDecomposeMatrixTotal except than it takes pointer for results. Value that are not needed may be discarded by passing NULL as argument.

Note: Decomposing a matrix with this method is a slow operation.

See Also

Vx3DDecomposeMatrix,Vx3DMatrixPolarDecomposition,Vx3DMatrixSpectralDecomposition


Vx3DInterpolateMatrix

External Function Vx3DInterpolateMatrix

void Vx3DInterpolateMatrix(float step,VxMatrix& Res,const VxMatrix& A, const VxMatrix& B)
void Vx3DInterpolateMatrixNoScale(float step,VxMatrix& Res,const VxMatrix& A, const VxMatrix& B)

Interpolates two matrices

Parameters

Input argument step | a float value in range [0..1] giving the amount of interpolation between A and B. A value of 0 gives A , a value of 1.0 gives B
Output argument Res | Result Matrix
Input argument A | First Matrix
Input argument B | second Matrix

Remarks

o Vx3DInterpolateMatrix calculates the interpolation between matrix A and B by decomposing them to quaternions,positions and scales. It then interpolates these value to reconstruct the matrix Res.

o Vx3DInterpolateMatrixNoScale function does not take scale information in the matrices into account during interpolation.

Note: Interpolating matrices using these functions may be very slow due to decomposition time.

See Also

VX3DDecomposeMatrix,VxQuaternion::Slerp


Vx3DInverseMatrix

External Function Vx3DInverseMatrix

void Vx3DInverseMatrix(VxMatrix& InverseMat,const VxMatrix& Mat)

Calculates the inverse of a Matrix

Parameters

Output argument InverseMat | Inverse matrix of Mat
Input argument Mat | Matrix to inverse.

Remarks

  • Calculates the inverse of matrix Mat and stores the result in InverseMat.

  • Mat and InverseMat must be two different matrices.

Note: The shape of Mat is presumed to be:

[ a b c 0 ]
[ d e f 0 ]
[ g h i 0 ]
[ j k l 1 ]

to inverse a 4x4 matrix that does not meet this constraint use Vx3DInverseMatrix44

See Also

Vx3DInverseMatrix44


Vx3DInverseMatrix44

External Function Vx3DInverseMatrix44

void Vx3DInverseMatrix44 (VxMatrix& InverseMat,const VxMatrix& Mat)

Calculates the inverse of a Matrix

Parameters

Output argument InverseMat | Inverse matrix of Mat
Input argument Mat | Matrix to inverse.

Remarks

  • Calculates the inverse of matrix Mat and stores the result in InverseMat.

  • Mat and InverseMat must be two different matrices.

Note: This version of inverse does not benefit from optimizations of special case matrices such as Vx3DInverseMatrix (Mat can be of any shape). For general purpose matrices (such as 3D entities matrices) use Vx3DInverseMatrix instead.

See Also

Vx3DInverseMatrix


Vx3DMatrixDeterminant

External Function Vx3DMatrixDeterminant

float Vx3DMatrixDeterminant(const VxMatrix& Mat)

Calculates the determinant of a Matrix

Parameters

Input argument Mat

the Matrix.

Returns

A float, the determinant of the matrix.


Vx3DMatrixFromEulerAngles

External Function Vx3DMatrixFromEulerAngles

void Vx3DMatrixFromEulerAngles(VxMatrix& Mat,float eax,float eay,float eaz)
void Vx3DMatrixToEulerAngles(const VxMatrix& Mat,float *eax,float* eay,float* eaz)

Calculates the matrix given three angles around each axis.

Parameters

Output argument Mat | A VxMatrix that wil store the resulting orientation
Input argument eax | Angle of rotation around X axis
Input argument eay | Angle of rotation around Y axis
Input argument eaz | Angle of rotation around Z axis

Remarks

  • Euler angles are used to represent an orientation in space. They are three angles around each axis X,Y,Z.

  • Vx3DMatrixFromEulerAngles creates the matrix from the Euler angles and

  • Vx3DMatrixToEulerAngles extract the Euler angles from the matrix.

Note: The full matrix is initialized by the Vx3DMatrixFromEulerAngles function.

See Also

Vx3DMatrixFromRotationAndOrigin,Vx3DMatrixFromRotation


Vx3DMatrixFromRotation

External Function Vx3DMatrixFromRotation

void Vx3DMatrixFromRotation(VxMatrix& ResultMat,const VxVector& Vector, float Angle)

Calculates the matrix given a rotation around an axis

Parameters

Output argument ResultMat | Result Matrix
Input argument Vector | Axis of Rotation
Input argument Angle | Angle of rotation in radians.

Remarks

Note: All elements of the matrix are initialized by this function.


Vx3DMatrixFromRotationAndOrigin

External Function Vx3DMatrixFromRotationAndOrigin

void Vx3DMatrixFromRotationAndOrigin(VxMatrix& ResultMat,const VxVector& Vector,const VxVector& Origin, float Angle)

Calculates the matrix given a rotation around an axis and a point.

Parameters

Output argument ResultMat | Result Matrix
Input argument Vector | Axis of Rotation
Input argument Origin | Origin of Rotation
Input argument Angle | Angle of rotation in radians.

Remarks

Note: All elements of the matrix are initialized by this function.

See Also

Vx3DMatrixFromEulerAngles,Vx3DMatrixFromRotation


Vx3DMatrixIdentity

External Function Vx3DMatrixIdentity

void Vx3DMatrixIdentity(VxMatrix& Mat)

Sets a matrix to the identity matrix.

Parameters

Output argument Mat

Matrix to set to the identity matrix.

Remarks

Sets Mat to

      [ 1 0 0 0]
Mat = [ 0 1 0 0]
      [ 0 0 1 0]
      [ 0 0 0 1]

See Also

VxMatrix,VxMatrix::Identity()


Vx3DMatrixPolarDecomposition

External Function Vx3DMatrixPolarDecomposition

float Vx3DMatrixPolarDecomposition(const VxMatrix& M, VxMatrix& Q, VxMatrix& S)

Polar Decomposition of a MAtrix

Remarks

Polar Decomposition of 3x3 matrix in 4x4 M = QS.

See Also

VX3DMatrixSpectralDecomposition


Vx3DMatrixSpectralDecomposition

External Function Vx3DMatrixSpectralDecomposition

VxVector Vx3DMatrixSpectralDecomposition(const VxMatrix& S, VxMatrix& U)

Spectral Decomposition of a VxMatrix

Parameters

Input argument S | VxMatrix to decompose.
Input argument U | VxMatrix that will contain rotation information.

Returns

A VxVector with the scale factors.

Remarks

o Compute the spectral decomposition of symmetric positive semi-definite S. Returns rotation in U and scale factors in result, so that if K is a diagonal matrix of the scale factors, then S = U K (U transpose). Uses Jacobi method.


Vx3DMultiplyMatrix

External Function Vx3DMultiplyMatrix

void Vx3DMultiplyMatrix(VxMatrix& ResultMat,const VxMatrix& MatA,const VxMatrix& MatB)
void Vx3DMultiplyMatrix4(VxMatrix& ResultMat,const VxMatrix& MatA,const VxMatrix& MatB)

Multiplies two matrices.

Parameters

Output argument ResultMat | A matrix to store result of A.B
Input argument MatA | First Matrix
Input argument MatB | second Matrix

Remarks

Multiplies the two matrices A and B and stores the result in ResultMat. Shape of matrices A and B is presumed to be:

[ a b c 0 ]
[ d e f 0 ]
[ g h i 0 ]
[ j k l 1 ]

If the matrices A or B are not construct this way you should use Vx3DMultiplyMatrix4 which multiplies every element of the two matrices.

Optimized for Pentium III processors

Note: Matrix ResultMat and Matrix A or B can be the same, the result will be correct.


Vx3DMultiplyMatrixVector

External Function Vx3DMultiplyMatrixVector

void Vx3DMultiplyMatrixVector(VxVector *ResultVector,const VxMatrix& Mat,const VxVector *Vector)
void Vx3DMultiplyMatrixVectorMany(VxVector *ResultVectors,const VxMatrix& Mat,const VxVector *Vectors,int count,int stride)
void Vx3DMultiplyMatrixVectorStrided(VxStridedData* Dest,VxStridedData* Src,const VxMatrix& Mat,int count)

Multiplies a Vector by a Matrix.

Parameters

Output argument ResultVector | Result of Mat.Vector ResultVectors: An array of Result of Mat.Vector
Input argument Mat | A VxMatrix to multiply Vector by.
Input argument Vector | A VxVector to multiply by Mat. Vectors: A pointer to an array of VxVector to transform count: Number of VxVector to transform stride: Number of byte between two Vectors in the Source and destination pointers. For a standard array of VxVector the stride will be sizeof(VxVector).

Remarks

o This function calculates the product Mat.Vector and stores the result in ResultVector. o The Vx3DMultiplyMatrixVectorMany functions multiplies an array of VxVector by matrix Mat and stores them in the array specified in ResultVectors. The stride specified is used for both source and destination array. o Optimized for Pentium III processors

Note: ResultVector and Vector can be the same pointer.

See Also

Vx3DRotateVector,Vx3DRotateVectorMany,Vx3DMultiplyMatrixVector4


Vx3DMultiplyMatrixVector4

External Function Vx3DMultiplyMatrixVector4

void Vx3DMultiplyMatrixVector4(VxVector4 *ResultVector,const VxMatrix& Mat,const VxVector *Vector)
void Vx3DMultiplyMatrixVector4(VxVector4 *ResultVector,const VxMatrix& Mat,const VxVector4 *Vector)
void Vx3DMultiplyMatrixVector4Strided(VxStridedData* Dest,VxStridedData* Src,const VxMatrix& Mat,int count)

Multiplies a VxVector4 by a Matrix.

Parameters

ResultVector | Result of Mat.Vector
Mat | A VxMatrix to multiply Vector by.
Vector | A VxVector or VxVector4 to multiply by Mat.

Remarks

This function calculates the product Mat.Vector and stores the result in ResultVector. It Differs from Vx3DMultiplyMatrixVector in that it takes the fourth element of a vector (w) into account instead of assuming it to be 1.

Optimized for Pentium III processors

Note: ResultVector and Vector must NOT be the same pointer otherwise result will be incorrect.

See Also

Vx3DMultiplyMatrixVector


Vx3DRotateVector

External Function Vx3DRotateVector

void Vx3DRotateVector(VxVector *ResultVector,const VxMatrix& Mat,const VxVector *Vector)
void Vx3DRotateVectorMany(VxVector *ResultVector,const VxMatrix& Mat,const VxVector *Vector,int count,int stride)
void Vx3DRotateVectorStrided(VxStridedData* Dest,VxStridedData* Src,const VxMatrix& Mat,int count)

Multiplies a Vector by a Matrix using only rotation part.

Parameters

Output argument ResultVector | Result of Mat.Vector ResultVectors: An array of Result of Mat.Vector
Input argument Mat | A VxMatrix to multiply Vector by.
Input argument Vector | A VxVector to multiply by Mat. Vectors: A pointer to an array of VxVector to transform count: Number of VxVector to transform stride: Number of byte between two Vectors in the Source and destination pointers. For a standard array of VxVector the stride will be sizeof(VxVector)

Remarks

This function calculates the product Mat.Vector and stores the result in ResultVector. Only the rotation part of the matrix (upper left 3x3 matrix) is used during this operation.

The Vx3DRotateVectorMany functions multiplies an array of VxVector by matrix Mat and stores them in the array specified in ResultVectors. The stride specified is used for both source and destination array.

Optimized for Pentium III processors

Note: ResultVector and Vector can be the same pointers.

See Also

Vx3DMultiplyMatrixVector,Vx3DMultiplyMatrixVectorMany,Vx3DMultiplyMatrixVector4


Vx3DTransposeMatrix

External Function Vx3DTransposeMatrix

void Vx3DTransposeMatrix(VxMatrix& Result,const VxMatrix& A)


VxInverseProject

External Function VxInverseProject

void
VxInverseProject(const VxMatrix& iProjection, const Vx2DVector& i2D, const float iZ, VxVector* o3D)

Computes a 3D position given a 2D vector, Z value and projection matrix.

Parameters

Input argument iProjection | The projection matrix
Input argument i2D | 2D Vector to get the 3D position of.
Input argument iZ | Z value
Output argument o3D | Result position.


VxMatrix

Class VxMatrix

Groups

Constructors | Assignment | Operators | Operations | Coercion Operators | Comparison Operators | Matrix

Constructors
Method VxMatrix | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Assignment
Method operator*= | Description: Multiply-Equals Operator This sets the current object to the product of the original value of this object and the value on the right.
Method operator= | Description: Assignment Operator This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.
Operators
Method operator* | Description: Multiplication Operator
Method operator[] | operators
Operations
Method Clear | Matrix construction
Method Compare |
Static Object Method Identity |
Method Orthographic |
Method OrthographicRect |
Method Perspective |
Method PerspectiveRect |
Method SetIdentity |
Coercion Operators
Method cast operator | Description: Converts to another type. This converts the current object to a particular type.
Comparison Operators
Method operator!= | Description: Not-Equals Operator
Method operator== | Description: Equality Operator
Matrix
Method RecomposeMatrix | Creates a matrix from a position,rotation and scale.


VxMatrix::VxMatrix

Method VxMatrix::VxMatrix

VxMatrix::VxMatrix()
VxMatrix::VxMatrix(const float m[4][4])
VxMatrix::VxMatrix(const VxMatrix& src)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxMatrix::operator*=

Method VxMatrix::operator*=

VxMatrix& VxMatrix::operator*= (const VxMatrix& mat)

Returns

A reference to the current object.

Remarks

Description: Multiply-Equals Operator

This sets the current object to the product of the original value of this object and the value on the right.


VxMatrix::operator=

Method VxMatrix::operator=

VxMatrix& VxMatrix::operator= (const VxMatrix& src)

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


VxMatrix::operator*

Method VxMatrix::operator*

VxMatrix VxMatrix::operator* (const VxMatrix& iMat) const

Returns

The result of multiplying the current object by the value of the object on the right.

Remarks

Description: Multiplication Operator


VxMatrix::operator[]

Method VxMatrix::operator[]

const VxVector4& VxMatrix::operator[] (int i) const
VxVector4& VxMatrix::operator[] (int i)

Returns

The value that this object associates with the value of the object that is the parameter to this operator.

Remarks

operators


VxMatrix::Clear

Method VxMatrix::Clear

void VxMatrix::Clear()

Remarks

Matrix construction


VxMatrix::Compare

Method VxMatrix::Compare

XBOOL VxMatrix::Compare(const VxMatrix &mat) const


VxMatrix::Identity

Static Object Method VxMatrix::Identity

const static VxMatrix& VxMatrix::Identity()


VxMatrix::Orthographic

Method VxMatrix::Orthographic

void VxMatrix::Orthographic(float Zoom,float Aspect,float Near_plane,float Far_plane)


VxMatrix::OrthographicRect

Method VxMatrix::OrthographicRect

void VxMatrix::OrthographicRect(float Left,float Right,float Top,float Bottom,float Near_plane,float Far_plane)


VxMatrix::Perspective

Method VxMatrix::Perspective

void VxMatrix::Perspective(float Fov,float Aspect,float Near_plane,float Far_plane)


VxMatrix::PerspectiveRect

Method VxMatrix::PerspectiveRect

void VxMatrix::PerspectiveRect(float Left,float Right,float Top,float Bottom,float Near_plane,float Far_plane)


VxMatrix::SetIdentity

Method VxMatrix::SetIdentity

void VxMatrix::SetIdentity()


VxMatrix::cast operator

Method VxMatrix::cast operator

VxMatrix::operator const void* () const
VxMatrix::operator void* ()

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


VxMatrix::operator!=

Method VxMatrix::operator!=

BOOL VxMatrix::operator!= (const VxMatrix& mat) const

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


VxMatrix::operator==

Method VxMatrix::operator==

BOOL VxMatrix::operator== (const VxMatrix& mat) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


VxMatrix::RecomposeMatrix

Method VxMatrix::RecomposeMatrix

void VxMatrix::RecomposeMatrix(const VxVector *Pos, const VxVector *Scale, const VxQuaternion *Quat)
void VxMatrix::RecomposeMatrixEx(const VxVector *Pos,const VxVector *Scale,const VxQuaternion *Quat, const VxQuaternion *Shear, float Sign)

Creates a matrix from a position,rotation and scale.

Parameters

Output argument Pos | A VxVector giving the position information. Shear: A VxQuaternion giving the off-axis scale orientation.
Output argument Scale | A VxVector giving the scale factors
Output argument Quat | Result VxQuaternion for orientation


Quaternions

External Function Exp | Returns the exponentiate quaternion.
External Function Ln | Returns the logarithm of a quaternion.
External Function LnDif | Returns the logarithm of P/Q.
External Function Slerp | Interpolates two quaternions.
External Function Squad | Interpolates two quaternions.
External Function Vx3DQuaternionConjugate | Return conjugate(inverse) of VxQuaternion.
External Function Vx3DQuaternionDivide | Divides two quaternions
External Function Vx3DQuaternionFromMatrix | Constructs a Quaternion from a matrix.
External Function Vx3DQuaternionMultiply | Multiplies two quaternions
Class VxQuaternion | Class representation of a Quaternion

See Also

Math Utilities


Exp

External Function Exp

VxQuaternion Exp(const VxQuaternion& q)

Returns the exponentiate quaternion.

Remarks

The exponentiate of a quaternion (theta.v,0) is the unit quaternion(sin(theta)v,cos(theta)).


Ln

External Function Ln

VxQuaternion Ln(const VxQuaternion& q)

Returns the logarithm of a quaternion.

Remarks

The logarithm of an unit quaternion(sin(theta)v,cos(theta)) is the quaternion (theta.v,0).


LnDif

External Function LnDif

VxQuaternion LnDif(const VxQuaternion& P,const VxQuaternion& Q)

Returns the logarithm of P/Q.

Remarks

+This method is implemented as :

VxQuaternion    LnDif(const VxQuaternion& P,const VxQuaternion& Q)
{
    return Ln(Q/P);
}

See Also

Ln


Slerp

External Function Slerp

VxQuaternion Slerp(float Theta,const VxQuaternion& Quat1,const VxQuaternion& Quat2)

Interpolates two quaternions.

Parameters

Input argument Theta | a float in range [0..1] indicating the step between Quat1 and Quat2
Input argument Quat1 | A pointer to the starting Quaternion.
Input argument Quat2 | A pointer to the ending Quaternion.

Remarks

Return the quaternion to the interpolation between Quat1 and Quat2


Squad

External Function Squad

VxQuaternion Squad(float Theta,const VxQuaternion& Quat1,const VxQuaternion& Quat1Out,const VxQuaternion& Quat2In,const VxQuaternion& Quat2)

Interpolates two quaternions.

Remarks

Return the quaternion to the interpolation between Quat1 and Quat2


Vx3DQuaternionConjugate

External Function Vx3DQuaternionConjugate

VxQuaternion Vx3DQuaternionConjugate(const VxQuaternion& Quat)

Return conjugate(inverse) of VxQuaternion.

Parameters

Input argument Quat

Quaternion to return the conjugate of.

Returns

A quaternion result of conjugate(Quat).

Remarks

The conjugate of a quaternion(x,y,z,w) is the quaternion(-x,-y,-z,w).


Vx3DQuaternionDivide

External Function Vx3DQuaternionDivide

VxQuaternion Vx3DQuaternionDivide(const VxQuaternion& p, const VxQuaternion& q)

Divides two quaternions

Parameters

Input argument p | Left Quaternion in division.
Input argument q | Right Quaternion in division

Returns

A quaternion result of p/q = (q(-1).p)

Vx3DQuaternionDivide(p,q) = Vx3DQuaternionMultiply(Vx3DQuaternionConjugate(q),p);


Vx3DQuaternionFromMatrix

External Function Vx3DQuaternionFromMatrix

VxQuaternion Vx3DQuaternionFromMatrix(const VxMatrix& Mat)

Constructs a Quaternion from a matrix.

Parameters

Input argument Mat

Matrix to extract the orientation part.

Returns

A quaternion giving orientation store in Mat.

NOTE: Only the upper left 3x3 part of the matrix is used.

See Also

VxQuaternion::FromMatrix


Vx3DQuaternionMultiply

External Function Vx3DQuaternionMultiply

VxQuaternion Vx3DQuaternionMultiply(const VxQuaternion& p, const VxQuaternion& q)

Multiplies two quaternions

Parameters

QuatL: Left Quaternion in multiplication. QuatR: Right Quaternion in multiplication

Returns

A quaternion result of QuatL.QuatR.


VxQuaternion

Class VxQuaternion

Class representation of a Quaternion

Remarks

A Quaternion is defined by 4 floats and is used to represents an orientation in space. Its common usage is for interpolation between two orientations through the Slerp() method.

Quaternions can be converted to VxMatrix or Euler Angles.

A VxQuaternion is defined as:

typedef struct VxQuaternion {
    union {
            struct {
                float x,y,z,w;
            };
            float v[4];
    };
}

Elements can be accessed with x,y,z,w value or through the array v.

Groups

Data Members | Constructors | Assignment | Operators | Operations

Data Members
Member Variable x |
Member Variable y |
Member Variable z |
Constructors
Method VxQuaternion | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Assignment
Method operator*= | Description: Multiply-Equals Operator This sets the current object to the product of the original value of this object and the value on the right.
Operators
Method operator* | Description: Multiplication Operator
Method operator+ | Addition and subtraction
Method operator- | Description: Subtraction Operator
Method operator/ | Description: Division Operator
Method operator[] | Description: Indexing Operator
Operations
Method FromEulerAngles | Calculates the quaternion given three angles around each axis.
Method FromMatrix | Constructs a Quaternion from a matrix.
Method FromRotation | Calculates the quaternion given a rotation around an axis
Method Multiply | Multiplies two quaternion.
Method Normalize | Normalizes this VxQuaternion.
Method ToEulerAngles | Converts the quaternion to euler angles.
Method ToMatrix | Constructs a Matrix from a quaternion.
Method ToRotation |

See Also

VxMatrix,VxVector,Quaternions


VxQuaternion::x

Member Variable VxQuaternion::x

float VxQuaternion::x,y,z;


VxQuaternion::y

Member Variable VxQuaternion::y

float x,VxQuaternion::y,z;


VxQuaternion::z

Member Variable VxQuaternion::z

float x,y,VxQuaternion::z;


VxQuaternion::VxQuaternion

Method VxQuaternion::VxQuaternion

VxQuaternion::VxQuaternion()
VxQuaternion::VxQuaternion(const VxVector& Vector,float Angle)
VxQuaternion::VxQuaternion(float X,float Y,float Z,float W)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxQuaternion::operator*=

Method VxQuaternion::operator*=

VxQuaternion& VxQuaternion::operator*=(float s)

Returns

A reference to the current object.

Remarks

Description: Multiply-Equals Operator

This sets the current object to the product of the original value of this object and the value on the right.


VxQuaternion::operator*

Method VxQuaternion::operator*

VxQuaternion VxQuaternion::operator* (const VxQuaternion& q) const

Returns

The result of multiplying the current object by the value of the object on the right.

Remarks

Description: Multiplication Operator


VxQuaternion::operator+

Method VxQuaternion::operator+

VxQuaternion VxQuaternion::operator+ (const VxQuaternion& q) const
VxQuaternion VxQuaternion::operator+() const

Returns

The current object added with the value of the object on the right-hand-side of the operator.

Remarks

Addition and subtraction


VxQuaternion::operator-

Method VxQuaternion::operator-

VxQuaternion VxQuaternion::operator- (const VxQuaternion& q) const
VxQuaternion VxQuaternion::operator-() const

Returns

The result of subtracting the value of the object on the right from this object.

Remarks

Description: Subtraction Operator


VxQuaternion::operator/

Method VxQuaternion::operator/

VxQuaternion VxQuaternion::operator/ (const VxQuaternion& q) const

Returns

The current object divided by the one on the right.

Remarks

Description: Division Operator


VxQuaternion::operator[]

Method VxQuaternion::operator[]

inline const float& VxQuaternion::operator[](int i) const
inline float& VxQuaternion::operator[](int i)

Returns

The value that this object associates with the value of the object that is the parameter to this operator.

Remarks

Description: Indexing Operator


VxQuaternion::FromEulerAngles

Method VxQuaternion::FromEulerAngles

void VxQuaternion::FromEulerAngles(float eax,float eay,float eaz)

Calculates the quaternion given three angles around each axis.

Parameters

Input argument eax | Angle of rotation around X axis
Input argument eay | Angle of rotation around Y axis
Input argument eaz | Angle of rotation around Z axis

Remarks

Euler angles are used to represent an orientation in space. They are three angles around each axis X,Y,Z.

VxQuaternion::FromEulerAngles creates the quaternion from the Euler angles and VxQuaternion::ToEulerAngles extract the Euler angles from the quaternion.

See Also

VxQuaternion::ToEulerAngles


VxQuaternion::FromMatrix

Method VxQuaternion::FromMatrix

void VxQuaternion::FromMatrix(const VxMatrix& Mat, BOOL MatIsUnit, BOOL RestoreMat)

Constructs a Quaternion from a matrix.

Parameters

Input argument Mat

Matrix to extract the orientation part.

NOTE: Only the upper left 3x3 part of the matrix is used.

Remarks

Extracts the orientation from Mat and stores it into this quaternion.

See Also

Vx3DQuaternionFromMatrix


VxQuaternion::FromRotation

Method VxQuaternion::FromRotation

void VxQuaternion::FromRotation(const VxVector& Vector,float Angle)

Calculates the quaternion given a rotation around an axis

Parameters

Input argument Vector | Axis of Rotation
Input argument Angle | Angle of rotation in radians.

Remarks

Construct the quaternion so it represents the rotation around axis Vector by an angle Angle.


VxQuaternion::Multiply

Method VxQuaternion::Multiply

void VxQuaternion::Multiply(const VxQuaternion& Quat)

Multiplies two quaternion.

Parameters

Input argument Quat

Quaternion the will multiply this quaternion.

Remarks

Multiplies this quaternion by quaternion Quat.


VxQuaternion::Normalize

Method VxQuaternion::Normalize

void VxQuaternion::Normalize()

Normalizes this VxQuaternion.

Remarks

Sets this quaternion to length 1.0


VxQuaternion::ToEulerAngles

Method VxQuaternion::ToEulerAngles

void VxQuaternion::ToEulerAngles(float *eax,float *eay,float *eaz) const

Converts the quaternion to euler angles.

Parameters

Input argument eax | Pointer to the resulting angle of rotation around X axis (Must not be NULL)
Input argument eay | Pointer to the resulting angle of rotation around Y axis (Must not be NULL)
Input argument eaz | Pointer to the resulting angle of rotation around Z axis (Must not be NULL)

Remarks

Euler angles are used to represent an orientation in space. They are three angles around each axis X,Y,Z.

VxQuaternion::FromEulerAngles creates the quaternion from the Euler angles and VxQuaternion::ToEulerAngles extract the Euler angles from the quaternion.

See Also

VxQuaternion::FromEulerAngles


VxQuaternion::ToMatrix

Method VxQuaternion::ToMatrix

void VxQuaternion::ToMatrix(VxMatrix& Mat) const

Constructs a Matrix from a quaternion.

Parameters

Input argument Mat

Matrix to construct.

Remarks

Constructs matrix Mat so it contains orientation represented by this quaternion. All the element of the matrix are initialized. Optimized for pentium III processors.

See Also

Vx3DQuaternionFromMatrix,VxQuaternion::FromMatrix


VxQuaternion::ToRotation

Method VxQuaternion::ToRotation

void VxQuaternion::ToRotation(VxVector& Vector,float& Angle)


Intersections

Class VxCone | Class representation of a cone.
Class VxDistance | Static methods for Distance tests.
Class VxFrustum | Class representation of an Frustum (like the view Frustum for example).
Class VxIntersect | Static methods for intersection tests.
Class VxOBB | Class representation of a ray (an origin and a direction).
Class VxPlane | Class representation of an infinite plane.
Class VxRay | Class representation of a ray (an origin and a direction).

See Also

Math Utilities


VxCone

Class VxCone

Class representation of a cone.

Remarks

A cone is defined by an origin , a direction and an angle [0..pi/2]

A VxCone is defined as:

class VxCone
{
public:
    VxVector    m_Origin;
    VxVector    m_Direction;
    float       m_CosTheta,m_SinTheta;
};

Groups

Data Members
Member Variable m_CosTheta | Cosine and Sine of cone angle
Member Variable m_Direction | Direction of the ray (normalized)
Member Variable m_Origin | Origin of the ray
Member Variable m_SinTheta | Cosine and Sine of cone angle
Constructors
Method VxCone | Constructs a VxCone object
Operations
Method Distance | Returns the square distance from a point to this cone surface
Method GetDirection |
Method GetOrigin |
Method IsPointInside | Returns if a point is inside the cone
Method Transform | Transforms the cone into an other referential.
Comparison Operators
Method operator== | Description: Equality Operator

See Also

VxMatrix,VxVector


VxCone::m_CosTheta

Member Variable VxCone::m_CosTheta

float VxCone::m_CosTheta,m_SinTheta;

Remarks

Cosine and Sine of cone angle


VxCone::m_Direction

Member Variable VxCone::m_Direction

VxVector VxCone::m_Direction

Remarks

Direction of the ray (normalized)


VxCone::m_Origin

Member Variable VxCone::m_Origin

VxVector VxCone::m_Origin

Remarks

Origin of the ray


VxCone::m_SinTheta

Member Variable VxCone::m_SinTheta

float m_CosTheta,VxCone::m_SinTheta;

Remarks

Cosine and Sine of cone angle


VxCone::VxCone

Method VxCone::VxCone

VxCone::VxCone()
VxCone::VxCone(const VxVector& iOrigin,const VxVector& iDir,float iAngle)
VxCone::VxCone(const VxVector& iOrigin,const VxVector& iAxePoint,const VxVector& iSurfacePoint)

Constructs a VxCone object

Parameters

Input argument iDir | Direction vector of the cone (must be normalized)
Input argument iAngle | Angle in radian of the cone.
iOrigin | origin of the cone

Remarks

Ctors


VxCone::Distance

Method VxCone::Distance

float VxCone::Distance(const VxVector& p) const

Returns the square distance from a point to this cone surface

Parameters

Input argument p

A point in space.


VxCone::GetDirection

Method VxCone::GetDirection

const VxVector& VxCone::GetDirection() const
VxVector& VxCone::GetDirection()


VxCone::GetOrigin

Method VxCone::GetOrigin

const VxVector& VxCone::GetOrigin() const
VxVector& VxCone::GetOrigin()


VxCone::IsPointInside

Method VxCone::IsPointInside

XBOOL VxCone::IsPointInside(const VxVector& p) const

Returns if a point is inside the cone

Parameters

Input argument p

A point in space.


VxCone::Transform

Method VxCone::Transform

void VxCone::Transform(VxCone& dest,const VxMatrix& mat) const

Transforms the cone into an other referential.

Parameters

Output argument dest | The transformed VxCone.
Input argument mat | Transformation matrix to apply to the ray.


VxCone::operator==

Method VxCone::operator==

bool VxCone::operator== (const VxCone& iCone) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


VxDistance

Class VxDistance

Static methods for Distance tests.

Remarks

VxDistance class contains a list of static methods useful for miscellaneous Distance tests. Using these methods one can test Distance of ray,segment or line with a Box,infinite planes, triangle faces or Sphere.

Groups

Operations
Static Object Method LineLineDistance
Static Object Method LineLineSquareDistance
Static Object Method LineRayDistance
Static Object Method LineRaySquareDistance
Static Object Method LineSegmentDistance
Static Object Method LineSegmentSquareDistance
Static Object Method PointLineDistance
Static Object Method PointLineSquareDistance
Lin

Point distance
Static Object Method PointRayDistance
Static Object Method PointRaySquareDistance
Static Object Method PointSegmentDistance
Static Object Method PointSegmentSquareDistance
Static Object Method RayRayDistance
Static Object Method RayRaySquareDistance
Static Object Method RaySegmentDistance
Static Object Method RaySegmentSquareDistance
Static Object Method SegmentSegmentDistance
Static Object Method SegmentSegmentSquareDistance

See Also

VxPlane,VxRay,VxBbox,VxVector,Distances


VxDistance::LineLineDistance

Static Object Method VxDistance::LineLineDistance

static float VxDistance::LineLineDistance (const VxRay& line0, const VxRay& line1,float* t0 = NULL, float* t1 = NULL)


VxDistance::LineLineSquareDistance

Static Object Method VxDistance::LineLineSquareDistance

float VxDistance::LineLineSquareDistance (const VxRay& rkLine0, const VxRay& rkLine1,
float* pfLinP0, float* pfLinP1)


VxDistance::LineRayDistance

Static Object Method VxDistance::LineRayDistance

static float VxDistance::LineRayDistance (const VxRay& line, const VxRay& ray,float* t0 = NULL, float* t1 = NULL)


VxDistance::LineRaySquareDistance

Static Object Method VxDistance::LineRaySquareDistance

float VxDistance::LineRaySquareDistance (const VxRay& rkLine, const VxRay& rkRay,
float* pfLinP, float* pfRayP)


VxDistance::LineSegmentDistance

Static Object Method VxDistance::LineSegmentDistance

static float VxDistance::LineSegmentDistance (const VxRay& line, const VxRay& segment,float* t0 = NULL, float* t1 = NULL)


VxDistance::LineSegmentSquareDistance

Static Object Method VxDistance::LineSegmentSquareDistance

float VxDistance::LineSegmentSquareDistance (const VxRay& rkLine, const VxRay& rkSeg,
float* pfLinP, float* pfSegP)


VxDistance::PointLineDistance

Static Object Method VxDistance::PointLineDistance

static float VxDistance::PointLineDistance(const VxVector& point, const VxRay& line,float* t0 = NULL)


VxDistance::PointLineSquareDistance

Static Object Method VxDistance::PointLineSquareDistance

float
VxDistance::PointLineSquareDistance(const VxVector& rkPoint, const VxRay& rkLine, float* t0)

Remarks

Lin

Point distance


VxDistance::PointRayDistance

Static Object Method VxDistance::PointRayDistance

static float VxDistance::PointRayDistance(const VxVector& point, const VxRay& ray,float* t0 = NULL)


VxDistance::PointRaySquareDistance

Static Object Method VxDistance::PointRaySquareDistance

float VxDistance::PointRaySquareDistance(const VxVector& rkPoint, const VxRay& rkRay,float* t0)


VxDistance::PointSegmentDistance

Static Object Method VxDistance::PointSegmentDistance

static float VxDistance::PointSegmentDistance(const VxVector& point, const VxRay& segment,float* t0 = NULL)


VxDistance::PointSegmentSquareDistance

Static Object Method VxDistance::PointSegmentSquareDistance

float VxDistance::PointSegmentSquareDistance(const VxVector& rkPoint, const VxRay& rkSegment,float* t0)


VxDistance::RayRayDistance

Static Object Method VxDistance::RayRayDistance

static float VxDistance::RayRayDistance (const VxRay& ray0, const VxRay& ray1,float* t0 = NULL, float* t1 = NULL)


VxDistance::RayRaySquareDistance

Static Object Method VxDistance::RayRaySquareDistance

float VxDistance::RayRaySquareDistance (const VxRay& rkRay0, const VxRay& rkRay1,
float* pfRayP0, float* pfRayP1)


VxDistance::RaySegmentDistance

Static Object Method VxDistance::RaySegmentDistance

static float VxDistance::RaySegmentDistance (const VxRay& ray, const VxRay& segment,float* t0 = NULL, float* t1 = NULL)


VxDistance::RaySegmentSquareDistance

Static Object Method VxDistance::RaySegmentSquareDistance

float VxDistance::RaySegmentSquareDistance (const VxRay& rkRay, const VxRay& rkSeg,
float* pfRayP, float* pfSegP)


VxDistance::SegmentSegmentDistance

Static Object Method VxDistance::SegmentSegmentDistance

static float VxDistance::SegmentSegmentDistance (const VxRay& segment0, const VxRay& segment1,float* t0 = NULL, float* t1 = NULL)


VxDistance::SegmentSegmentSquareDistance

Static Object Method VxDistance::SegmentSegmentSquareDistance

float VxDistance::SegmentSegmentSquareDistance (const VxRay& rkSeg0, const VxRay& rkSeg1,
float* pfSegP0, float* pfSegP1)


VxFrustum

Class VxFrustum

Class representation of an Frustum (like the view Frustum for example).

Groups

Constructors
Method VxFrustum | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method Classify |
Method ComputeVertices |
Method GetBottomPlane |
Method GetDir |
Method GetDMax |
Method GetDMin |
Method GetDRatio |
Method GetFarPlane |
Method GetLeftPlane |
Method GetNearPlane |
Method GetOrigin |
Method GetRBound |
Method GetRF |
Method GetRight |
Method GetRightPlane |
Method GetUBound |
Method GetUF |
Method GetUp |
Method GetUpPlane |
Method IsInside |
Method Transform |
Method Update |
Comparison Operators
Method operator== | Description: Equality Operator

See Also

VxVector,VxRay,Intersections,VxIntersect


VxFrustum::VxFrustum

Method VxFrustum::VxFrustum

VxFrustum::VxFrustum()
VxFrustum::VxFrustum(const VxVector& origin,const VxVector& right,const VxVector& up,const VxVector& dir,float nearplane,float farplane,float fov,float aspectratio)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxFrustum::Classify

Method VxFrustum::Classify

DWORD VxFrustum::Classify(const VxVector& v) const
float VxFrustum::Classify(const VxBbox& v) const
float VxFrustum::Classify(const VxBbox& b, const VxMatrix& mat) const


VxFrustum::ComputeVertices

Method VxFrustum::ComputeVertices

void VxFrustum::ComputeVertices (VxVector vertices[8]) const


VxFrustum::GetBottomPlane

Method VxFrustum::GetBottomPlane

const VxPlane& VxFrustum::GetBottomPlane() const


VxFrustum::GetDir

Method VxFrustum::GetDir

VxVector& VxFrustum::GetDir()
const VxVector& VxFrustum::GetDir() const


VxFrustum::GetDMax

Method VxFrustum::GetDMax

float& VxFrustum::GetDMax ()
const float& VxFrustum::GetDMax () const


VxFrustum::GetDMin

Method VxFrustum::GetDMin

float& VxFrustum::GetDMin ()
const float& VxFrustum::GetDMin () const


VxFrustum::GetDRatio

Method VxFrustum::GetDRatio

float VxFrustum::GetDRatio() const


VxFrustum::GetFarPlane

Method VxFrustum::GetFarPlane

const VxPlane& VxFrustum::GetFarPlane() const


VxFrustum::GetLeftPlane

Method VxFrustum::GetLeftPlane

const VxPlane& VxFrustum::GetLeftPlane() const


VxFrustum::GetNearPlane

Method VxFrustum::GetNearPlane

const VxPlane& VxFrustum::GetNearPlane() const


VxFrustum::GetOrigin

Method VxFrustum::GetOrigin

VxVector& VxFrustum::GetOrigin()
const VxVector& VxFrustum::GetOrigin() const


VxFrustum::GetRBound

Method VxFrustum::GetRBound

float& VxFrustum::GetRBound ()
const float& VxFrustum::GetRBound () const


VxFrustum::GetRF

Method VxFrustum::GetRF

float VxFrustum::GetRF() const


VxFrustum::GetRight

Method VxFrustum::GetRight

VxVector& VxFrustum::GetRight()
const VxVector& VxFrustum::GetRight() const


VxFrustum::GetRightPlane

Method VxFrustum::GetRightPlane

const VxPlane& VxFrustum::GetRightPlane() const


VxFrustum::GetUBound

Method VxFrustum::GetUBound

float& VxFrustum::GetUBound ()
const float& VxFrustum::GetUBound () const


VxFrustum::GetUF

Method VxFrustum::GetUF

float VxFrustum::GetUF() const


VxFrustum::GetUp

Method VxFrustum::GetUp

VxVector& VxFrustum::GetUp()
const VxVector& VxFrustum::GetUp() const


VxFrustum::GetUpPlane

Method VxFrustum::GetUpPlane

const VxPlane& VxFrustum::GetUpPlane() const


VxFrustum::IsInside

Method VxFrustum::IsInside

BOOL VxFrustum::IsInside(const VxVector& v) const


VxFrustum::Transform

Method VxFrustum::Transform

void
VxFrustum::Transform(const VxMatrix& invworldmat)


VxFrustum::Update

Method VxFrustum::Update

void VxFrustum::Update ()


VxFrustum::operator==

Method VxFrustum::operator==

bool VxFrustum::operator== (const VxFrustum& iFrustum) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


VxIntersect

Class VxIntersect

Static methods for intersection tests.

Remarks

VxIntersect class contains a list of static methods useful for miscellaneous intersection tests. Using these methods one can test intersection of ray,segment or line with a Box,infinite planes, triangle faces or Sphere. Methods for box-box (Boxes) and plane-plane (Planes) intersction are also provided

Groups

Planes
Static Object Method BoxPlane | Intersection between a bounding box and a plane.
Static Object Method LinePlane | Intersection between an infinite line and a plane.
Static Object Method Planes | Intersection 3 planes.
Static Object Method RayPlane | Intersection between a ray and a plane.
Static Object Method SegmentPlane | Intersection between a segment and a plane.
Boxes
Static Object Method AABBAABB | Intersection between two boxes.
Static Object Method AABBFace | Intersection with an AABB and a Face.
Static Object Method AABBOBB | Intersection between two OBB.
Static Object Method LineBox | Intersection between an infinite line and a box
Static Object Method OBBOBB | Intersection between two OBB.
Static Object Method RayBox | Intersection between a ray and a box
Static Object Method SegmentBox | Intersection between a segment and a box
Faces
Static Object Method FaceFace | Intersection between two faces.
Static Object Method LineFace | Intersection between an infinite line and a triangle face.
Static Object Method PointInFace | Tests if a point is inside a triangle face.
Static Object Method RayFace | Intersection between a ray and a triangle face.
Static Object Method SegmentFace | Intersection between a segment and a triangle face.
Operations
Static Object Method FacePlane | Intersection Box - Plane
Static Object Method FrustumAABB | Intersection Ray - Face
Static Object Method FrustumBox | Intersection Frustum - Box
Static Object Method FrustumFace | Intersection Frustum - Face
Static Object Method FrustumOBB | Intersection Frustum - Box
Static Object Method GetPointCoefficients | Foe a given point inside a face return the coefficient for each face vertex to interpolate normal or uv data ( pt.uv = pt0.uv * V0Coef + pt1.uv * V1Coef + pt2.uv * V2Coef
Static Object Method RaySphere | Intersection Ray - Sphere
Static Object Method SegmentPlaneCulled |
Static Object Method SphereAABB | Intersection Ray - Sphere returns the number of intersection(s) of a ray on the sphere (0,1 or 2)
Static Object Method SphereSphere | Spheres

See Also

VxPlane,VxRay,VxBbox,VxVector,Intersections


VxIntersect::BoxPlane

Static Object Method VxIntersect::BoxPlane

BOOL VxIntersect::BoxPlane(const VxBbox& box,const VxPlane& plane)
BOOL VxIntersect::BoxPlane(const VxBbox& box,const VxMatrix& mat,const VxPlane& plane)

Intersection between a bounding box and a plane.

Parameters

Input argument box | The bounding box to test.
Input argument mat | referential in which the box is
Input argument plane | a VxPlane to test the intersection with.

Returns

TRUE if there is a valid intersection, FALSE otherwise ( line parallel to plane).

See Also

RayPlane,SegmentPlane


VxIntersect::LinePlane

Static Object Method VxIntersect::LinePlane

BOOL VxIntersect::LinePlane(const VxRay& ray,const VxPlane& plane,VxVector& point,float& dist)

Intersection between an infinite line and a plane.

Parameters

Input argument ray | Origin and End of the segment.
Input argument plane | a VxPlane to test the intersection with.
Output argument point | A VxVector giving the position of intersection if available.
Output argument dist | A float value giving the distance to the origin of the ray.

Returns

TRUE if there is a valid intersection, FALSE otherwise ( line parallel to plane).

Remarks

dist value is returned relative to the ray: point = ray.m_Origin + dist * ray.m_Direction

See Also

RayPlane,SegmentPlane


VxIntersect::Planes

Static Object Method VxIntersect::Planes

BOOL VxIntersect::Planes(const VxPlane& plane1,const VxPlane& plane2,const VxPlane& plane3,VxVector& p)

Intersection 3 planes.

Parameters

Output argument p

A VxVector giving the position of intersection if available.

Returns

TRUE if there is a valid intersection, FALSE otherwise ( at least two parallel planes).

See Also

RayPlane,SegmentPlane,LinePlane


VxIntersect::RayPlane

Static Object Method VxIntersect::RayPlane

BOOL VxIntersect::RayPlane(const VxRay& ray,const VxPlane& plane,VxVector& point,float& dist)
BOOL VxIntersect::RayPlaneCulled(const VxRay& ray,const VxPlane& plane,VxVector& point,float& dist)

Intersection between a ray and a plane.

Parameters

Input argument ray | Origin and direction of the ray.
Input argument plane | a VxPlane to test the intersection with.
Output argument point | A VxVector giving the position of intersection if available.
Output argument dist | A float value giving the distance to the origin of the ray.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

dist value is returned relative to the ray: point = ray.m_Origin + dist * ray.m_Direction;

See Also

SegmentPlane,LinePlane


VxIntersect::SegmentPlane

Static Object Method VxIntersect::SegmentPlane

BOOL VxIntersect::SegmentPlane(const VxRay& ray,const VxPlane& plane,VxVector& point,float& dist)

Intersection between a segment and a plane.

Parameters

Input argument ray | Origin and End of the segment.
Input argument plane | a VxPlane to test the intersection with.
Output argument point | A VxVector giving the position of intersection if available.
Output argument dist | A float value giving the distance to the origin of the ray.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

  • Dist value is returned relative to the ray: point = ray.m_Origin + dist * ray.m_Direction;

  • The difference with the RayPlane methods is that there is a valid intersection only if the point of intersection is between the origin and the end of the segment defined by ray (dist>=0 && dist<=1)

See Also

VxIntersect::RayPlane,VxIntersect::LinePlane


VxIntersect::AABBAABB

Static Object Method VxIntersect::AABBAABB

BOOL VxIntersect::AABBAABB(const VxBbox& box1, const VxBbox& box2)

Intersection between two boxes.

Parameters

box1,box2: Boxes to test the intersection of.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

See Also

RayBox,SegmentBox,LineBox


VxIntersect::AABBFace

Static Object Method VxIntersect::AABBFace

BOOL
VxIntersect::AABBFace(const VxBbox& box, const VxVector& A0,const VxVector& A1,const VxVector& A2,const VxVector& norm)

Intersection with an AABB and a Face.

Parameters

box1,box2: Boxes to test the intersection of.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

See Also

RayBox,SegmentBox,LineBox


VxIntersect::AABBOBB

Static Object Method VxIntersect::AABBOBB

BOOL
VxIntersect::AABBOBB(const VxBbox& box1, const VxOBB& box2)

Intersection between two OBB.

Parameters

box1,box2: Boxes to test the intersection of.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

See Also

RayBox,SegmentBox,LineBox


VxIntersect::LineBox

Static Object Method VxIntersect::LineBox

static BOOL VxIntersect::LineBox(const VxRay& ray,const VxBbox& box)
BOOL VxIntersect::LineBox(const VxRay& ray,const VxBbox& box,VxVector& inpoint,VxVector* outpoint,VxVector* innormal,VxVector* outnormal)

Intersection between an infinite line and a box

Parameters

Input argument ray | Origin and direction point of the ray.
Input argument box | a VxBbox to test the intersection with.
Output argument inpoint | A VxVector giving the position of first intersection with the box if available.
Output argument outpoint | A VxVector giving the position of second intersection with the box if available.
Output argument innormal | A VxVector giving the normal of the box face which was intersected at first.
Output argument outnormal | A VxVector giving the normal of the box face which was intersected in second.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

Intersection Line - Box

See Also

RayBox,SegmentBox


VxIntersect::OBBOBB

Static Object Method VxIntersect::OBBOBB

BOOL VxIntersect::OBBOBB(const VxOBB& box1, const VxOBB& box2)

Intersection between two OBB.

Parameters

box1,box2: Boxes to test the intersection of.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

See Also

RayBox,SegmentBox,LineBox


VxIntersect::RayBox

Static Object Method VxIntersect::RayBox

static BOOL VxIntersect::RayBox(const VxRay& ray,const VxBbox& box)
BOOL VxIntersect::RayBox(const VxRay& ray,const VxBbox& box,VxVector& inpoint,VxVector* outpoint,VxVector* innormal,VxVector* outnormal)

Intersection between a ray and a box

Parameters

Input argument ray | Origin and direction of the ray.
Input argument box | a VxBbox to test the intersection with.
Output argument inpoint | A VxVector giving the position of first intersection with the box if available.
Output argument outpoint | A VxVector giving the position of second intersection with the box if available.
Output argument innormal | A VxVector giving the normal of the box face which was intersected at first.
Output argument outnormal | A VxVector giving the normal of the box face which was intersected in second.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

Intersection Ray - Box (return -1 if origin inside)

See Also

SegmentBox,LineBox


VxIntersect::SegmentBox

Static Object Method VxIntersect::SegmentBox

static BOOL VxIntersect::SegmentBox(const VxRay& ray,const VxBbox& box)
BOOL VxIntersect::SegmentBox(const VxRay& ray,const VxBbox& box,VxVector& inpoint,VxVector* outpoint,VxVector* innormal,VxVector* outnormal)

Intersection between a segment and a box

Parameters

Input argument ray | Origin and Ending point of the ray.
Input argument box | a VxBbox to test the intersection with.
Output argument inpoint | A VxVector giving the position of first intersection with the box if available.
Output argument outpoint | A VxVector giving the position of second intersection with the box if available.
Output argument innormal | A VxVector giving the normal of the box face which was intersected at first.
Output argument outnormal | A VxVector giving the normal of the box face which was intersected in second.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

Intersection Segment - Box (return -1 if origin inside)

See Also

RayBox,LineBox


VxIntersect::FaceFace

Static Object Method VxIntersect::FaceFace

BOOL VxIntersect::FaceFace(const VxVector& V0,const VxVector& V1,const VxVector& V2,const VxVector& N1,const VxVector& U0,const VxVector& U1,const VxVector& U2,const VxVector& N2)

Intersection between two faces.

Parameters

V0,V1,V2: Three VxVector defining the triangle face. N0: The normal vector of the face. V0,V1,V2: Three VxVector defining the triangle face. N0: The normal vector of the face.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

dist value is returned relative to the line: point = ray.m_Origin + dist * ray.m_Direction;

See Also

RayFace,LineFace


VxIntersect::LineFace

Static Object Method VxIntersect::LineFace

BOOL VxIntersect::LineFace(const VxRay &ray,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,VxVector& res,float& dist)
BOOL VxIntersect::LineFace(const VxRay &ray,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,VxVector& res,float& dist,int& i1,int& i2)

Intersection between an infinite line and a triangle face.

Parameters

ray | Origin and direction of the line.
norm | The normal vector of the face.
res | A VxVector giving the position of intersection if available.
dist | A float value giving the distance to the origin of the line.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

dist value is returned relative to the line: point = ray.m_Origin + dist * ray.m_Direction;

See Also

RayFace,LineFace


VxIntersect::PointInFace

Static Object Method VxIntersect::PointInFace

BOOL VxIntersect::PointInFace(const VxVector& point,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,int& i1,int& i2)

Tests if a point is inside a triangle face.

Parameters

Input argument point | a VxVector to test if it's inside the face..
Input argument norm | The normal vector of the face.

Returns

TRUE if the point is inside the face, FALSE otherwise.

See Also

RayFace,SegmentFace,LineFace


VxIntersect::RayFace

Static Object Method VxIntersect::RayFace

BOOL VxIntersect::RayFace(const VxRay &ray,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,VxVector& res,float& dist)
BOOL VxIntersect::RayFace(const VxRay &ray,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,VxVector& res,float& dist,int& i1,int& i2)
BOOL VxIntersect::RayFaceCulled(const VxRay &ray,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,VxVector& res,float& dist,int& i1,int& i2)

Intersection between a ray and a triangle face.

Parameters

ray | Origin and direction of the ray.
norm | The normal vector of the face.
res | A VxVector giving the position of intersection if available.
dist | A float value giving the distance to the origin of the ray.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

o dist value is returned relative to the ray: point = ray.m_Origin + dist * ray.m_Direction;

See Also

SegmentFace,LineFace


VxIntersect::SegmentFace

Static Object Method VxIntersect::SegmentFace

BOOL VxIntersect::SegmentFace(const VxRay &ray,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,VxVector& res,float& dist)
BOOL VxIntersect::SegmentFace(const VxRay &ray,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,VxVector& res,float& dist,int& i1,int& i2)
BOOL VxIntersect::SegmentFaceCulled(const VxRay &ray,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const VxVector& norm,VxVector& res,float& dist,int& i1,int& i2)

Intersection between a segment and a triangle face.

Parameters

ray | Origin and Ending points of the ray.
norm | The normal vector of the face.
res | A VxVector giving the position of intersection if available.
dist | A float value giving the distance to the origin of the ray.

Returns

TRUE if there is a valid intersection, FALSE otherwise.

Remarks

dist value is returned relative to the ray: point = ray.m_Origin + dist * ray.m_Direction;

See Also

RayFace,LineFace


VxIntersect::FacePlane

Static Object Method VxIntersect::FacePlane

static BOOL VxIntersect::FacePlane(const VxVector& A0,const VxVector& A1,const VxVector& A2,const VxPlane& plane)

Remarks

Intersection Box - Plane


VxIntersect::FrustumAABB

Static Object Method VxIntersect::FrustumAABB

static BOOL VxIntersect::FrustumAABB(const VxFrustum& frustum,const VxBbox& box)

Remarks

Intersection Ray - Face


VxIntersect::FrustumBox

Static Object Method VxIntersect::FrustumBox

static BOOL VxIntersect::FrustumBox(const VxFrustum& frustum,const VxBbox& box,const VxMatrix& mat)

Remarks

Intersection Frustum - Box


VxIntersect::FrustumFace

Static Object Method VxIntersect::FrustumFace

BOOL
VxIntersect::FrustumFace(const VxFrustum& frustum,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2)

Remarks

Intersection Frustum - Face


VxIntersect::FrustumOBB

Static Object Method VxIntersect::FrustumOBB

static BOOL VxIntersect::FrustumOBB(const VxFrustum& frustum,const VxBbox& box,const VxMatrix& mat)

Remarks

Intersection Frustum - Box


VxIntersect::GetPointCoefficients

Static Object Method VxIntersect::GetPointCoefficients

static void VxIntersect::GetPointCoefficients(const VxVector& pt,const VxVector& pt0,const VxVector& pt1,const VxVector& pt2,const int& i1,const int& i2,float& V0Coef,float& V1Coef,float& V2Coef)

Remarks

Foe a given point inside a face return the coefficient for each face vertex to interpolate normal or uv data ( pt.uv = pt0.uv * V0Coef + pt1.uv * V1Coef + pt2.uv * V2Coef


VxIntersect::RaySphere

Static Object Method VxIntersect::RaySphere

static int VxIntersect::RaySphere(const VxRay &iRay,const VxSphere& iSphere,VxVector* oInter1,VxVector* oInter2)

Remarks

Intersection Ray - Sphere


VxIntersect::SegmentPlaneCulled

Static Object Method VxIntersect::SegmentPlaneCulled

BOOL VxIntersect::SegmentPlaneCulled(const VxRay& ray,const VxPlane& plane,VxVector& point,float& dist)


VxIntersect::SphereAABB

Static Object Method VxIntersect::SphereAABB

static int VxIntersect::SphereAABB(const VxSphere& iSphere,const VxBbox& iBox)

Remarks

Intersection Ray - Sphere returns the number of intersection(s) of a ray on the sphere (0,1 or 2)


VxIntersect::SphereSphere

Static Object Method VxIntersect::SphereSphere

static BOOL VxIntersect::SphereSphere(const VxSphere& iS1, const VxVector& iP1, const VxSphere& iS2, const VxVector& iP2, float* oCollisionTime1, float* oCollisionTime2)

Remarks

Spheres


VxOBB

Class VxOBB

Class representation of a ray (an origin and a direction).

Remarks

A Ray is defined by 2 VxVector and is used to represents a ray in space (useful for intersection purposes.)

A VxOBB is defined as:

class VxOBB
{
public:
    VxVector    m_Origin;
    VxVector    m_Direction;
};

Groups

Data Members
Member Variable m_Axis | Axis of the box
Member Variable m_Center | Center of the box
Member Variable m_Extents | Extents of the box
Constructors
Method VxOBB | Ctors
Operations
Method Create | Transform the ray into the other referential
Method GetAxes |
Method GetAxis |
Method GetCenter |
Method GetExtent |
Method GetExtents |
Method IsBoxInside | return TRUE if iB is completely inside this box
Method VectorIn | return TRUE if a point is inside this box
Comparison Operators
Method operator== | Description: Equality Operator

See Also

VxMatrix,VxVector


VxOBB::m_Axis

Member Variable VxOBB::m_Axis

VxVector VxOBB::m_Axis[3]

Remarks

Axis of the box


VxOBB::m_Center

Member Variable VxOBB::m_Center

VxVector VxOBB::m_Center

Remarks

Center of the box


VxOBB::m_Extents

Member Variable VxOBB::m_Extents

VxVector VxOBB::m_Extents

Remarks

Extents of the box


VxOBB::VxOBB

Method VxOBB::VxOBB

VxOBB::VxOBB()
VxOBB::VxOBB(const VxBbox& box,const VxMatrix& mat)

Remarks

Ctors


VxOBB::Create

Method VxOBB::Create

void VxOBB::Create(const VxBbox& box,const VxMatrix& mat)

Remarks

Transform the ray into the other referential


VxOBB::GetAxes

Method VxOBB::GetAxes

VxVector* VxOBB::GetAxes ()
const VxVector* VxOBB::GetAxes () const


VxOBB::GetAxis

Method VxOBB::GetAxis

VxVector& VxOBB::GetAxis (int i)
const VxVector& VxOBB::GetAxis (int i) const


VxOBB::GetCenter

Method VxOBB::GetCenter

VxVector& VxOBB::GetCenter ()
const VxVector& VxOBB::GetCenter () const


VxOBB::GetExtent

Method VxOBB::GetExtent

float& VxOBB::GetExtent(int i)
const float& VxOBB::GetExtent(int i) const


VxOBB::GetExtents

Method VxOBB::GetExtents

float* VxOBB::GetExtents()
const float* VxOBB::GetExtents() const


VxOBB::IsBoxInside

Method VxOBB::IsBoxInside

XBOOL VxOBB::IsBoxInside(const VxBbox& iB) const

Remarks

return TRUE if iB is completely inside this box


VxOBB::VectorIn

Method VxOBB::VectorIn

XBOOL VxOBB::VectorIn(const VxVector& iV) const

Remarks

return TRUE if a point is inside this box


VxOBB::operator==

Method VxOBB::operator==

bool VxOBB::operator== (const VxOBB& iBox) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


VxPlane

Class VxPlane

Class representation of an infinite plane.

Remarks

A VxPlane is defined by a normal VxVector and and is used to represents a infinite plane in space (usefull for intersection purposes.) It can be created with a point in space and normal,an equation or with 3 points.

A VxPlane is defined as:

class VxPlane
{
    public:
        VxVector    m_Normal;   // The normal to the plane
        float       m_D;        // The D component of Ax + By + Cz + D = 0 equation
};

Groups

Data Members
Member Variable m_D | The D component of Ax + By + Cz + D = 0 equation
Member Variable m_Normal | The normal to the plane
Constructors
Method VxPlane | Constructors.
Operations
Method Classify | Returns on which side an oriented box is regarding to a plane..
Method ClassifyFace | Returns on which side a face is regarding to a plane..
Method Create | Ctor with the plane normal and a point in the plane
Method Distance | Return the distance of a point to the plane
Method GetNormal |
Method NearestPoint | Return the nearest point from a point on the plane
Method XClassify |
Comparison Operators
Method operator== | Description: Equality Operator

See Also

VxVector,VxRay,Intersections,VxIntersect


VxPlane::m_D

Member Variable VxPlane::m_D

float VxPlane::m_D

Remarks

The D component of Ax + By + Cz + D = 0 equation


VxPlane::m_Normal

Member Variable VxPlane::m_Normal

VxVector VxPlane::m_Normal

Remarks

The normal to the plane


VxPlane::VxPlane

Method VxPlane::VxPlane

VxPlane::VxPlane()
VxPlane::VxPlane(const VxVector& n,float d)
VxPlane::VxPlane(float a,float b,float c,float d)
VxPlane::VxPlane(const VxVector& n,const VxVector& p)
VxPlane::VxPlane(const VxVector& a,const VxVector& b,const VxVector& c)

Constructors.

Parameters

n | A VxVector representing the normal of the plane.
Input argument p | A point in space lying on the plane

Remarks

A VxPlane can be created from its equation, a normal and a point lying on the plane or three points belonging to the plane (which must not be aligned).


VxPlane::Classify

Method VxPlane::Classify

float VxPlane::Classify(const VxVector& p) const
float VxPlane::Classify(const VxBbox& box) const
float VxPlane::Classify(const VxBbox& box, const VxMatrix& mat) const

Returns on which side an oriented box is regarding to a plane..

Parameters

Input argument p | A point in space.
Input argument box | A box in the referential of the given matrix. max: matrix of the referntial of the box.

Remarks

Classify the box with regards of the plane : a positive value means the box is front of the plane. 0 means the box intersects the plane.

See Also

Distance


VxPlane::ClassifyFace

Method VxPlane::ClassifyFace

float
VxPlane::ClassifyFace(const VxVector& pt0,const VxVector& pt1,const VxVector& pt2) const

Returns on which side a face is regarding to a plane..

Parameters

Input argument pt0 | the first index of the face.
Input argument pt1 | the second index of the face.
Input argument pt2 | the third index of the face. Retun Value: The minimum distance of the face to the plane.

Remarks

Classify the face with regards of the plane : a positive value means the point is front of the plane, a negative value that the face is behind the plane.. 0 means that the face is crossing.

See Also

Distance

Intersection Box - Plane


VxPlane::Create

Method VxPlane::Create

void
VxPlane::Create(const VxVector& n,const VxVector& p)
void
VxPlane::Create(const VxVector& a,const VxVector& b,const VxVector& c)

Remarks

Ctor with the plane normal and a point in the plane


VxPlane::Distance

Method VxPlane::Distance

float VxPlane::Distance(const VxVector& p) const

Return the distance of a point to the plane

Parameters

Input argument p

A point in space.

Returns

Distance from the point to the plane.

See Also

Classify


VxPlane::GetNormal

Method VxPlane::GetNormal

const VxVector& VxPlane::GetNormal() const


VxPlane::NearestPoint

Method VxPlane::NearestPoint

const VxVector VxPlane::NearestPoint(const VxVector& p) const

Return the nearest point from a point on the plane

Parameters

Input argument p

A point in space.

Returns

A point on the plane.

See Also

Classify


VxPlane::XClassify

Method VxPlane::XClassify

float VxPlane::XClassify(const VxVector boxaxis[4]) const


VxPlane::operator==

Method VxPlane::operator==

bool VxPlane::operator== (const VxPlane& iPlane) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


VxRay

Class VxRay

Class representation of a ray (an origin and a direction).

Remarks

A Ray is defined by 2 VxVector and is used to represents a ray in space (useful for intersection purposes.)

A VxRay is defined as:

class VxRay
{
public:
    VxVector    m_Origin;
    VxVector    m_Direction;
};

Groups

Data Members
Member Variable m_Direction | Direction of the ray (not normalized)
Member Variable m_Origin | Origin of the ray
Constructors
Method VxRay | Ctors
Operations
Method Distance | Returns the distance from a point to this ray..
Method GetDirection |
Method GetOrigin |
Method Interpolate | Interpolates a vector along the ray.
Method SquareDistance | Returns the square distance from a point to this ray..
Method Transform | Transforms the ray into an other referential.
Comparison Operators
Method operator== | Description: Equality Operator

See Also

VxMatrix,VxVector


VxRay::m_Direction

Member Variable VxRay::m_Direction

VxVector VxRay::m_Direction

Remarks

Direction of the ray (not normalized)


VxRay::m_Origin

Member Variable VxRay::m_Origin

VxVector VxRay::m_Origin

Remarks

Origin of the ray


VxRay::VxRay

Method VxRay::VxRay

VxRay::VxRay()
VxRay::VxRay(const VxVector& start,const VxVector& end)
VxRay::VxRay(const VxVector& start,const VxVector& dir,int* dummy)

Remarks

Ctors


VxRay::Distance

Method VxRay::Distance

float VxRay::Distance(const VxVector& p) const

Returns the distance from a point to this ray..

Parameters

Input argument p

A point in space.

Returns

The algebraic distance from the point to the line

Remarks

return the minimum distance between a point p and a line defined by a point o and a direction d. All the inputs must be in the same referential.


VxRay::GetDirection

Method VxRay::GetDirection

const VxVector& VxRay::GetDirection() const
VxVector& VxRay::GetDirection()


VxRay::GetOrigin

Method VxRay::GetOrigin

const VxVector& VxRay::GetOrigin() const
VxVector& VxRay::GetOrigin()


VxRay::Interpolate

Method VxRay::Interpolate

void VxRay::Interpolate (VxVector& p,float t) const

Interpolates a vector along the ray.

Parameters

Output argument p | A point in space = m_Origin+ t* m_Direction.
Input argument t | A float value for interpolation.


VxRay::SquareDistance

Method VxRay::SquareDistance

float VxRay::SquareDistance(const VxVector& p) const

Returns the square distance from a point to this ray..

Parameters

Input argument p

A point in space.


VxRay::Transform

Method VxRay::Transform

void VxRay::Transform(VxRay& dest,const VxMatrix& mat)

Transforms the ray into an other referential.

Parameters

Output argument dest | The transformed VxRay.
Input argument mat | Transformation matrix to apply to the ray.


VxRay::operator==

Method VxRay::operator==

bool VxRay::operator== (const VxRay& iRay) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


System Utilities

Class CKDirectoryParser | Utility class for Directories parsing.
Class CKFileExtension | Storage class for filename extensions
Class CKPathMaker | Utility class for directory and filenames concatenation
Class CKPathSplitter | Utility class for filenames extraction
Class VxDataMutexed | This class ensure that a data is access by only one thread.
Class VxFile | Utility class for file reading/writing.
Class VxLogListener | Define an object which listen to a log.
Class VxMemoryMappedFile | Utility class for memory mapped file reading.
Class VxMutex | Represent an objet used for mutual-exclusion synchronization between threads.
Class VxMutexLock | Represent an objet used for mutual-exclusion synchronization between threads.
Class VxSharedLibrary | Utility class for loading Dlls.
Class VxThread | Represents a system thread.
Class VxTimeProfiler | Class for timing purposes
Class XGUID | Global Unique Identifier Struture.
System Functions |
Processor Identification |
Macro sizeofarray | Handy macro that return the number of elements in a static array.
External Function XRemoveIf | Remove all elements that match the predicate in a sequential range. This occurs in place. The predicate object should be stateless and provide a () operator that receive the element to be tested, and returns true if it is to be deleted. The order of the remaining elements is preserved.

See Also

VxMath Reference


CKDirectoryParser

Class CKDirectoryParser

Utility class for Directories parsing.

Remarks

CKDirectoryParser class useful for iterating inside a directory arborescence. It can be used to parse only a directory looking for files with an extension filter or to parse a complete arborescence. On Win32 platforms, suffers the extension mismatches limitation : if you want to parse the *.ext files, *.exta files will also be listed.

Groups

Constructors
Method CKDirectoryParser | Constructs a CKDirectoryParser object.
Operations
Method GetNextFile | Returns the next file if available.
Method Reset | Resets the parser

Example

Counts and makes a list of files with extension .cpp
in a directory tree
   CKDirectoryParser MyParser(Directory,"*.cpp",TRUE);

   XClassArray<XString> FileList;
   char* str = NULL;
   while(str = parser.GetNextFile()) {
str contains the full path of the file.
       FileList.PushBack(XString(str));
   }

See Also

CKPathMaker,CKPathSplitter


CKDirectoryParser::CKDirectoryParser

Method CKDirectoryParser::CKDirectoryParser

CKDirectoryParser::CKDirectoryParser(char* dir,char* fileMask,BOOL recurse, BOOL iDontSkipDirectory)

Constructs a CKDirectoryParser object.

Parameters

Input argument dir | Directory to parse.
Input argument fileMask | A filter string for the extension to look for (eg “*.cpp”)
Input argument recurse | TRUE to iterate every sub-directory or FALSE to parse only dir.
Input argument iDontSkipDirectory | TRUE if you GetNextFile returns file and directory.

Remarks

Once created the GetNextFile function can be used to iterate through the files.

See Also

GetNextFile


CKDirectoryParser::GetNextFile

Method CKDirectoryParser::GetNextFile

char* CKDirectoryParser::GetNextFile()

Returns the next file if available.

Returns

A non-NULL char pointer if there is still files to parse or NULL otherwise.

Remarks

GetNextFile only returns “files” directory names are not returned by this method but will be parsed if CKDirectoryParser was created with the flag recurse set to TRUE.


CKDirectoryParser::Reset

Method CKDirectoryParser::Reset

void CKDirectoryParser::Reset(char* dir, char* fileMask,BOOL recurse, BOOL iDontSkipDirectory)

Resets the parser

Returns

A non-NULL char pointer if thenre is still files to parse or NULL otherwise.

Remarks

GetNextFile only returns “files” directory names are not returned by this method but will be parsed if CKDirectoryParser was created with the flag recurse set to TRUE.


CKFileExtension

Class CKFileExtension

Storage class for filename extensions

Groups

Data Members
Member Variable m_ExtLong | Members secret
Constructors
Method CKFileExtension | Ctor
Coercion Operators
Method cast operator | Description: Converts to another type. This converts the current object to a particular type.
Comparison Operators
Method operator== | Description: Equality Operator

See Also

CKPathSplitter,CKPathMaker


CKFileExtension::m_ExtLong

Member Variable CKFileExtension::m_ExtLong

char CKFileExtension::m_ExtLong[VIRTOOLS_MAX_EXTENSION_SIZE]

Remarks

Members secret


CKFileExtension::CKFileExtension

Method CKFileExtension::CKFileExtension

CKFileExtension::CKFileExtension()
CKFileExtension::CKFileExtension(char* s)

Remarks

Ctor


CKFileExtension::cast operator

Method CKFileExtension::cast operator

CKFileExtension::operator char*()
CKFileExtension::operator const char*()

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


CKFileExtension::operator==

Method CKFileExtension::operator==

int CKFileExtension::operator==(const CKFileExtension& s)

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


CKPathMaker

Class CKPathMaker

Utility class for directory and filenames concatenation

Remarks

CKPathSplitter & CKPathMaker are useful for manipulation of filenames and paths. CKPathMaker class creates a path string from its four components..

Groups

Constructors
Method CKPathMaker | Constructs the object from an optionnal Drive letter,Directory,Filename and Extension.
Operations
Method GetFileName | Returns the full path.

Example

for example to change the name of a file :
       CKPathSplitter  splitter(OldFilename);

       char* OldName = splitter.GetName();
       char* newname = ChangeName(OldName);
       CKPathMaker maker(splitter.GetDrive(),splitter.GetDir(),newname,splitter.GetExtension());
       char* NewFilename = maker.GetFileName();

See Also

CKPathSplitter


CKPathMaker::CKPathMaker

Method CKPathMaker::CKPathMaker

CKPathMaker::CKPathMaker(char* Drive,char* Directory,char* Fname,char* Extension)

Remarks

Constructs the object from an optionnal Drive letter,Directory,Filename and Extension.


CKPathMaker::GetFileName

Method CKPathMaker::GetFileName

char *CKPathMaker::GetFileName()

Remarks

Returns the full path.


CKPathSplitter

Class CKPathSplitter

Utility class for filenames extraction

Remarks

CKPathSplitter & CKPathMaker are useful for manipulation of filenames and paths. CKPathSplitter class is used to break a path into its four components (Drive, Directory Filename and extension). CKPathMaker class creates a path string from its four components..

Groups

Constructors
Method CKPathSplitter | Constructs the object from a full path.
Assignment
Method operator= | create the objet from a full path.
Operations
Method GetDir | Returns the optionnal directory path, including trailing slash (\)
Method GetDrive | Returns the optionnal drive letter, followed by a colon (:)
Method GetExtension | Returns the file extension including period (.)
Method GetName | Returns the file name without extension

Example

for example to change the name of a file :
       CKPathSplitter  splitter(OldFilename);

       char* OldName = splitter.GetName();
       char* newname = ChangeName(OldName);
       CKPathMaker maker(splitter.GetDrive(),splitter.GetDir(),newname,splitter.GetExtension());
       char* NewFilename = maker.GetFileName();

See Also

CKPathMaker


CKPathSplitter::CKPathSplitter

Method CKPathSplitter::CKPathSplitter

CKPathSplitter::CKPathSplitter(char* file)

Remarks

Constructs the object from a full path.


CKPathSplitter::operator=

Method CKPathSplitter::operator=

CKPathSplitter& CKPathSplitter::operator=(const char* file)

Returns

A reference to the current object.

Remarks

create the objet from a full path.


CKPathSplitter::GetDir

Method CKPathSplitter::GetDir

char *CKPathSplitter::GetDir()

Remarks

Returns the optionnal directory path, including trailing slash (\)


CKPathSplitter::GetDrive

Method CKPathSplitter::GetDrive

char *CKPathSplitter::GetDrive()

Remarks

Returns the optionnal drive letter, followed by a colon (:)


CKPathSplitter::GetExtension

Method CKPathSplitter::GetExtension

char *CKPathSplitter::GetExtension()

Remarks

Returns the file extension including period (.)


CKPathSplitter::GetName

Method CKPathSplitter::GetName

char *CKPathSplitter::GetName()

Remarks

Returns the file name without extension


VxDataMutexed

Class VxDataMutexed

This class ensure that a data is access by only one thread.

Remarks

To ensure that the access to your data is thread safe you need to create the VxDataMutexed. Then, if a thread want to modify or do anything on it, you create its accessor in a scope. You can modify the value using the Value on the accessor.

Groups

Constructors
Method VxDataMutexed | Initialization constructor. The internal value is intialized.
Classes
Class Accessor | This class give you a thread safe access to the VxDataMutexed Value. Look the example in the VxDataMutexed.
Class ConstAccessor | This class give you a thread safe access to the VxDataMutexed Value. Look the example in the VxDataMutexed.

Example

VxDataMutexed<int> val;
{
  VxDataMutexed<int>::Accessor acces(val);
  acces.Value() = 1;
}

See Also

VxThread,VxMutexLock,VxMutex


VxDataMutexed::VxDataMutexed

Method VxDataMutexed::VxDataMutexed

VxDataMutexed::VxDataMutexed()
VxDataMutexed::VxDataMutexed(const T &value)

Initialization constructor. The internal value is intialized.

Remarks

The type associated with “T” must have an affectation operator.


VxDataMutexed::Accessor

Class VxDataMutexed::Accessor

This class give you a thread safe access to the VxDataMutexed Value. Look the example in the VxDataMutexed.

Groups

Constructors
Method Accessor | Construct an accessor on your data. The data is locked by its mutex.
Operations
Method Value | access to the Value
Destructors
Method ~Accessor | Destruct the accessor on your data. The data is unlocked by its mutex.


VxDataMutexed::Accessor::Accessor

Method VxDataMutexed::Accessor::Accessor

VxDataMutexed::Accessor::Accessor(VxDataMutexed<T> *dm)

Construct an accessor on your data. The data is locked by its mutex.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxDataMutexed::Accessor::Value

Method VxDataMutexed::Accessor::Value

T& VxDataMutexed::Accessor::Value()

access to the Value


VxDataMutexed::Accessor::~Accessor

Method VxDataMutexed::Accessor::~Accessor

VxDataMutexed::Accessor::~Accessor()

Destruct the accessor on your data. The data is unlocked by its mutex.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxDataMutexed::ConstAccessor

Class VxDataMutexed::ConstAccessor

This class give you a thread safe access to the VxDataMutexed Value. Look the example in the VxDataMutexed.

Groups

Constructors
Method ConstAccessor | Construct an accessor on your data. The data is locked by its mutex.
Operations
Method Value | access to the Value
Destructors
Method ~ConstAccessor | Destruct the accessor on your data. The data is unlocked by its mutex.


VxDataMutexed::ConstAccessor::ConstAccessor

Method VxDataMutexed::ConstAccessor::ConstAccessor

VxDataMutexed::ConstAccessor::ConstAccessor(const VxDataMutexed<T> *dm)

Construct an accessor on your data. The data is locked by its mutex.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxDataMutexed::ConstAccessor::Value

Method VxDataMutexed::ConstAccessor::Value

const T& VxDataMutexed::ConstAccessor::Value() const

access to the Value


VxDataMutexed::ConstAccessor::~ConstAccessor

Method VxDataMutexed::ConstAccessor::~ConstAccessor

VxDataMutexed::ConstAccessor::~ConstAccessor()

Destruct the accessor on your data. The data is unlocked by its mutex.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxFile

Class VxFile

Utility class for file reading/writing.

VxStream
Show brief derivation trees

VxFile

VxStream
Show full derivation trees

VxFile

Subclasses

VxCachedFile

Groups

Constructors
Method VxFile | Default Ctor.
Operations
Virtual Method Method Close | Returns TRUE if the file is successfully closed.
Virtual Method Method Copy | Copy given amount of data from the source stream to the stream. A size of 0 means copy the whole stream.
Virtual Method Method EndOfFile | Checks for the end of file (TRUE is end of file).
Virtual Method Method Flush | Flushes a file (force update).
Static Object Method GetFileMode | Returns the file mode.
Virtual Method Method GetString | Gets a string from a file.
Method IsValid | Returns TRUE if the file is still valid.
Virtual Method Method Open | Opens () and close the currently opened one) a file for reading or writing.
Method Position | Returns the current cursor position.
Virtual Method Method Printf | Writes a formatted text buffer to the file.
Method Read | Reads given amount of data from the file to the buffer.
Virtual Method Method ReadItems | Reads given amount of items from the file to the buffer.
Virtual Method Method Scanf | Reads data from the current position of stream into the locations given by argument (if any).
Method Seek | Seeks to a given position into the file, starting from a given origin mode.
Method Size | Returns the file size in bytes.
Method Write | Writes given amount of data from the buffer to the file.
Type Definitions
Enumerated Type FileMode |
Enumerated Type OpenMode |
Enumerated Type SeekMode | Starting position and direction of a seek.
Destructors
Virtual Method Method ~VxFile | Closes the file if it was open.

Example

VxFile file;

file.Open("TestFile.txt",VxFile::TEXTWRITEONLY);
file.Printf("dummy string : %s","example");
file.Close();


VxFile::VxFile

Method VxFile::VxFile

VxFile::VxFile()

Default Ctor.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxFile::Close

Virtual Method Method VxFile::Close

virtual XBOOL VxFile::Close()

Returns TRUE if the file is successfully closed.


VxFile::EndOfFile

Virtual Method Method VxFile::EndOfFile

virtual XBOOL VxFile::EndOfFile()

Checks for the end of file (TRUE is end of file).


VxFile::Flush

Virtual Method Method VxFile::Flush

virtual XDWORD VxFile::Flush()

Flushes a file (force update).


VxFile::GetFileMode

Static Object Method VxFile::GetFileMode

static XDWORD VxFile::GetFileMode(const char* iFileName)

Returns the file mode.

See Also

FileMode.


VxFile::GetString

Virtual Method Method VxFile::GetString

virtual XBOOL VxFile::GetString(char* oString, XDWORD iMax)

Gets a string from a file.


VxFile::IsValid

Method VxFile::IsValid

XBOOL VxFile::IsValid()

Returns TRUE if the file is still valid.


VxFile::Open

Virtual Method Method VxFile::Open

virtual XBOOL VxFile::Open(const char* iFileName, OpenMode iMode = READONLY)

Opens () and close the currently opened one) a file for reading or writing.


VxFile::Position

Method VxFile::Position

XDWORD VxFile::Position()

Returns the current cursor position.


VxFile::Printf

Virtual Method Method VxFile::Printf

virtual XDWORD VxFile::Printf(const char* iFormat, ...)

Writes a formatted text buffer to the file.

Returns

The number of bytes actually written


VxFile::Read

Method VxFile::Read

XDWORD VxFile::Read(void* oBuffer, XDWORD iSize)

Reads given amount of data from the file to the buffer.

Returns

The number of bytes actually read


VxFile::ReadItems

Virtual Method Method VxFile::ReadItems

virtual XDWORD VxFile::ReadItems(void* oBuffer, XDWORD iSize, XDWORD iCount)

Reads given amount of items from the file to the buffer.

Returns

The number of items actually read


VxFile::Scanf

Virtual Method Method VxFile::Scanf

virtual XDWORD VxFile::Scanf(const char* iFormat, ...)

Reads data from the current position of stream into the locations given by argument (if any).

Returns

The number of fiels succesfully converted and assigned. A return value of 0 indicates that no fields were assigned. If an error occurs, or if the end of the file stream is reached before the first conversion, the return value is EOF


VxFile::Seek

Method VxFile::Seek

XBOOL VxFile::Seek(int iOffset, SeekMode iOrigin)

Seeks to a given position into the file, starting from a given origin mode.


VxFile::Size

Method VxFile::Size

XDWORD VxFile::Size()

Returns the file size in bytes.


VxFile::Write

Method VxFile::Write

XDWORD VxFile::Write(const void* iBuffer, XDWORD iSize)

Writes given amount of data from the buffer to the file.

Returns

The number of bytes actually written


VxFile::FileMode

Enumerated Type VxFile::FileMode

enum FileMode
{
INVALID = 0,
REGULAR_FILE = 1<<13,
DIRECTORY = 1<<12,
READPERMISSION = 1<<8,
WRITEPERMISSION = 1<<7,
EXECPERMISSION = 1<<6,
}

Members

DIRECTORY
EXECPERMISSION
INVALID
READPERMISSION
REGULAR_FILE
WRITEPERMISSION


VxFile::OpenMode

Enumerated Type VxFile::OpenMode

enum OpenMode {
READONLY = 1,
WRITEONLY = 2,
READWRITE = 3,
APPEND = 4,
RWAPPEND = 5,
TEXTREADONLY = 9,
TEXTWRITEONLY = 10,
TEXTREADWRITE = 11,
TEXTAPPEND = 12,
TEXTRWAPPEND = 13
}

Members

APPEND
READONLY
READWRITE
RWAPPEND
TEXTAPPEND
TEXTREADONLY
TEXTREADWRITE
TEXTRWAPPEND
TEXTWRITEONLY
WRITEONLY


VxFile::~VxFile

Virtual Method Method VxFile::~VxFile

virtual VxFile::~VxFile()

Closes the file if it was open.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxLogListener

Class VxLogListener

Define an object which listen to a log.

Subclasses

VxConsoleListener, VxFileListener, and VxOutputDebugListener

Remarks

A listener has a level which determines if it must print information. The default value of the level is VxLog::ALL.

Groups

Operations
Method AddModule | Add a module in the listener.
Method GetDateAsString | Convert the current date to a string.
Method GetFlags | Get flags of the listener.
Pure Virtual Method Method GetGuid | Returns the Guid of the Listener.
Method GetLevel | Get the level of a listener.
Method GetName | Get the name of the listener.
Method GetTimeFormatValue | Get timeformat of the listener.
Method IsModule | Test if a module is already registered in the listener
Pure Virtual Method Method Print | Print information with the listener.
Method SetFlags | Set flags of the listener.
Method SetLevel | Set the level of a listener.
Method SetTimeFormat | Set timeformat of the listener.
Type Definitions
Enumerated Type Flags | Describes the behavior of the listener.
Enumerated Type TimeFormat | Describes how the date will be generated as a string.
Destructors
Virtual Method Method ~VxLogListener | Destructor.

See Also

VxLog.


VxLogListener::AddModule

Method VxLogListener::AddModule

void VxLogListener::AddModule(int iModule)

Add a module in the listener.

Parameters

Input argument iModule

identifier of the module returnedby VxLog::RegisterModule.

See Also

VxLog::RegisterModule, IsModule.


VxLogListener::GetDateAsString

Method VxLogListener::GetDateAsString

void VxLogListener::GetDateAsString(TimeFormat iFormat,XString& iStr)

Convert the current date to a string.


VxLogListener::GetFlags

Method VxLogListener::GetFlags

int VxLogListener::GetFlags() const

Get flags of the listener.

See Also

SetFlags.


VxLogListener::GetGuid

Pure Virtual Method Method VxLogListener::GetGuid

virtual const XGUID& VxLogListener::GetGuid() const

Returns the Guid of the Listener.


VxLogListener::GetLevel

Method VxLogListener::GetLevel

int VxLogListener::GetLevel() const

Get the level of a listener.

See Also

VxLog::Level.


VxLogListener::GetName

Method VxLogListener::GetName

const XString& VxLogListener::GetName() const

Get the name of the listener.


VxLogListener::GetTimeFormatValue

Method VxLogListener::GetTimeFormatValue

TimeFormat VxLogListener::GetTimeFormatValue() const

Get timeformat of the listener.

See Also

SetTimeFormat.


VxLogListener::IsModule

Method VxLogListener::IsModule

XBOOL VxLogListener::IsModule(int iModule) const

Test if a module is already registered in the listener

Parameters

Input argument iModule

identifier of the module returnedby VxLog::RegisterModule.

Returns

Returns TRUE if the module is registered in the listener.

See Also

VxLog::RegisterModule, AddModule.


VxLogListener::Print

Pure Virtual Method Method VxLogListener::Print

virtual void VxLogListener::Print(int iModule,VxLog::Level iLevel,int iLine,const char* iFile,const char* iLog)

Print information with the listener.

Parameters

Input argument iModule | the module which want to log the information.
Input argument iLevel | the level of the informations to be displayed.
Input argument iLine | the line the log occured.
Input argument iFile | the file the log occured
Input argument iLog | a string representing the informations to be displayed.

Remarks

Function you must overload.

See Also

VxLog.


VxLogListener::SetFlags

Method VxLogListener::SetFlags

void VxLogListener::SetFlags(int iFlags)

Set flags of the listener.

See Also

GetFlags.


VxLogListener::SetLevel

Method VxLogListener::SetLevel

void VxLogListener::SetLevel(int iLevel)

Set the level of a listener.

See Also

VxLog::Level.


VxLogListener::SetTimeFormat

Method VxLogListener::SetTimeFormat

void VxLogListener::SetTimeFormat(TimeFormat iTimeFormat)

Set timeformat of the listener.

See Also

GetTimeFormatValue.


VxLogListener::Flags

Enumerated Type VxLogListener::Flags

enum Flags
{
DATEINNAME = 1,
FILEINFO = 2,
FILEAPPEND = 4,
}

Describes the behavior of the listener.

Members

DATEINNAME | the name of the listener will contains the date as ([yy mm dd]).
FILEAPPEND | (only for file) the file will be open in appen mode.
FILEINFO | the listener will add information about the file where the log was generated.


VxLogListener::TimeFormat

Enumerated Type VxLogListener::TimeFormat

enum TimeFormat
{
NODATE = 0,
TIME = 1,
DATE = 2,
DATEMILLI = 3,
DATELONGYEAR = 4,
DATELONGYEARMILLI = 5,
DATEMILLI2 = 6,
}

Describes how the date will be generated as a string.

Members

DATE | the system date like dd/mm/yy hh:mm:ss.
DATELONGYEAR | the system date like dd/mm/yyyy hh:mm:ss.
DATELONGYEARMILLI | the system date like dd/mm/yyyy hh:mm:ss:ms.
DATEMILLI | the system date like dd/mm/yy hh:mm:ss:ms.
DATEMILLI2 | the system date like dd/mm/yy hh:mm:ss:ms (time).
NODATE |
TIME |


VxLogListener::~VxLogListener

Virtual Method Method VxLogListener::~VxLogListener

virtual VxLogListener::~VxLogListener()

Destructor.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxMemoryMappedFile

Class VxMemoryMappedFile

Utility class for memory mapped file reading.

Remarks

The VxMemoryMappedFile can be used have a mapping of a file into a memory buffer for reading purposes.

Groups

Constructors
Method VxMemoryMappedFile | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method GetBase | Returns a pointer to the mapped memory buffer.
Method GetErrorType | Returns whether there was an error opening the file.
Method GetFileSize | Returns the file size in bytes.
Method IsValid | Returns the file was successfully opened and mapped to a memory buffer.

Example

       VxMemoryMappedFile mappedFile(FileName);

       DWORD FileSize = mappedFile.GetFileSize();
       BYTE* buffer = (BYTE*)mappedFile.GetBase();

buffer now contain the file content and can be read


VxMemoryMappedFile::VxMemoryMappedFile

Method VxMemoryMappedFile::VxMemoryMappedFile

VxMemoryMappedFile::VxMemoryMappedFile( char *pszFileName )

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxMemoryMappedFile::GetBase

Method VxMemoryMappedFile::GetBase

void* VxMemoryMappedFile::GetBase( void )

Returns a pointer to the mapped memory buffer.

Remarks

The returned pointer should not be deleted nor should it be used for writing purpose.


VxMemoryMappedFile::GetErrorType

Method VxMemoryMappedFile::GetErrorType

VxMMF_Error VxMemoryMappedFile::GetErrorType()

Returns whether there was an error opening the file.


VxMemoryMappedFile::GetFileSize

Method VxMemoryMappedFile::GetFileSize

DWORD VxMemoryMappedFile::GetFileSize( void )

Returns the file size in bytes.


VxMemoryMappedFile::IsValid

Method VxMemoryMappedFile::IsValid

BOOL VxMemoryMappedFile::IsValid( void )

Returns the file was successfully opened and mapped to a memory buffer.


VxMutex

Class VxMutex

Represent an objet used for mutual-exclusion synchronization between threads.

Groups

Constructors
Method VxMutex | Default constructor. Create and initialize a mutex.
Operators
Method operator++ | Description: Postfix Increment Operator This increments the current object.
Method operator-- | Description: Postfix Increment Operator This increments the current object.
Operations
Method EnterMutex | The EnterMutex function waits for ownership of the specified critical section object. The function returns when the calling thread is granted ownership.
Method LeaveMutex | The LeaveMutex function releases ownership of the specified critical section object.
Destructors
Method ~VxMutex | Destructor. Releases all resources used by the mutex object.

See Also

VxThread,VxMutexLock


VxMutex::VxMutex

Method VxMutex::VxMutex

VxMutex::VxMutex()

Default constructor. Create and initialize a mutex.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxMutex::operator++

Method VxMutex::operator++

BOOL VxMutex::operator++(int)

Returns

The value of the current object before the operation was performed.

Remarks

Description: Postfix Increment Operator

This increments the current object.


VxMutex::operator--

Method VxMutex::operator--

BOOL VxMutex::operator--(int)

Returns

The value of the current object before the operation was performed.

Remarks

Description: Postfix Increment Operator

This increments the current object.


VxMutex::EnterMutex

Method VxMutex::EnterMutex

BOOL
VxMutex::EnterMutex()

The EnterMutex function waits for ownership of the specified critical section object. The function returns when the calling thread is granted ownership.

Returns

TRUE if successful.

See Also

LeaveMutex


VxMutex::LeaveMutex

Method VxMutex::LeaveMutex

BOOL
VxMutex::LeaveMutex()

The LeaveMutex function releases ownership of the specified critical section object.

Returns

TRUE if successful.

See Also

EnterMutex


VxMutex::~VxMutex

Method VxMutex::~VxMutex

VxMutex::~VxMutex()

Destructor. Releases all resources used by the mutex object.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxMutexLock

Class VxMutexLock

Represent an objet used for mutual-exclusion synchronization between threads.

Groups

Constructors
Method VxMutexLock | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Destructors
Method ~VxMutexLock | Description: Destroys the object This destroys all the subordinate objects for this object.

See Also

VxThread,VxMutex


VxMutexLock::VxMutexLock

Method VxMutexLock::VxMutexLock

VxMutexLock::VxMutexLock(VxMutex& Mutex)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxMutexLock::~VxMutexLock

Method VxMutexLock::~VxMutexLock

VxMutexLock::~VxMutexLock()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxSharedLibrary

Class VxSharedLibrary

Utility class for loading Dlls.

Groups

Constructors
Method VxSharedLibrary | Creates an unattached VxLibrary
Operations
Method Attach | Attaches a existing Library to a VxLibrary
Method GetFunctionPtr | Retrieves a function pointer from the library
Method Load | Loads the shared Library from disk
Method ReleaseLibrary | Unloads the shared Library

Example

To load a dll in order to retrieve a specific function and call it
       VxSharedLibrary Shl;
       INSTANCE_HANDLE DllInst = Shl.Load(DllName);    // INSTANCE_HANDLE = HMODULE of win32

       MyFunc = Shl.GetFunctionPtr("MyFunctionInTheDll");
       MyFunc(...);

       shl.ReleaseLibrary();


VxSharedLibrary::VxSharedLibrary

Method VxSharedLibrary::VxSharedLibrary

VxSharedLibrary::VxSharedLibrary()

Remarks

Creates an unattached VxLibrary


VxSharedLibrary::Attach

Method VxSharedLibrary::Attach

void VxSharedLibrary::Attach(INSTANCE_HANDLE LibraryHandle)

Remarks

Attaches a existing Library to a VxLibrary


VxSharedLibrary::GetFunctionPtr

Method VxSharedLibrary::GetFunctionPtr

void* VxSharedLibrary::GetFunctionPtr(char *FuntioncName)

Remarks

Retrieves a function pointer from the library


VxSharedLibrary::Load

Method VxSharedLibrary::Load

INSTANCE_HANDLE VxSharedLibrary::Load(char *LibraryName)

Remarks

Loads the shared Library from disk


VxSharedLibrary::ReleaseLibrary

Method VxSharedLibrary::ReleaseLibrary

void VxSharedLibrary::ReleaseLibrary()

Remarks

Unloads the shared Library


VxThread

Class VxThread

Represents a system thread.

Remarks

There is to way to use thread :

  1. you can inherit from the VxThread class and overload the VxThread::Run() method.

  2. or you can associate a ThreadFunction to you're while the creation.

Groups

Constructors
Method VxThread | Default constructor.
Operations
Method Close | Close the handle associated with an system thead and reinitialize the VxThread object.
Method CreateThread | Create the system thread object associated with the VxThread object.
Static Object Method GetCurrentVxThread | Static function which return a pointer to the VxThread associated with the current system thread object.
Static Object Method GetCurrentVxThreadId | Static function which return the thread identifier of the current system thread object.
Method GetHandle | Return the thread HANDLE specific to the system.
Method GetID | Return the thread ID specific to the system.
Method GetName | Return the name of the thread.
Method GetPriority | Return the thread priority
Method IsCreated | Check if the system thread was created.
Method IsJoinable | Check if the thread is joinable. It means if a call to Join is possible.
Method IsMainThread | Check if the current VxThread object represent the main thread.
Method IsStarted | Check if the thread is running at this time.
Method SetName | Set the name of the thread.
Method SetPriority | Set the priority of the thread.
Method Terminate | Used to cause a thread to exit
Method Wait | Wait for the specified thread.
External Variables
Method GetExitCode | The GetExitCode function retrieves the termination status of the specified thread.
Destructors
Virtual Method Method ~VxThread | Destructor.

See Also

VxThread::Run,VxThread::CreateThread,VxMutex.


VxThread::VxThread

Method VxThread::VxThread

VxThread::VxThread()

Default constructor.

Remarks

Create a VxThread object and initialize it. The system thread does not exist until you call CreateThread.

See Also

CreateThread.


VxThread::Close

Method VxThread::Close

void
VxThread::Close()

Close the handle associated with an system thead and reinitialize the VxThread object.

Remarks

Don't call this method if the associated system thread is runnig or you'll loose its handle and its state.

Don't call Close until you want to call GetExitCode or GetGENERIC_HANDLE.

See Also

GetExitCode, GetHandle.


VxThread::CreateThread

Method VxThread::CreateThread

BOOL
VxThread::CreateThread(VxThreadFunction* func,void* args)

Create the system thread object associated with the VxThread object.

Parameters

Input argument func | The function to be excuted by the thread. If NULL the function excuted by this thread will be Run.
Input argument args | Arguments of the thread function. Can be NULL.

Returns

TRUE if the system thread was successfuly created.

See Also

Run.


VxThread::GetCurrentVxThread

Static Object Method VxThread::GetCurrentVxThread

VxThread*
VxThread::GetCurrentVxThread()

Static function which return a pointer to the VxThread associated with the current system thread object.

Remarks

The returned VxThread depend on the context where this method is called.


VxThread::GetCurrentVxThreadId

Static Object Method VxThread::GetCurrentVxThreadId

DWORD
VxThread::GetCurrentVxThreadId()

Static function which return the thread identifier of the current system thread object.

Remarks

This depend on the context where this method is called. Thread identifier dosn't exist under Linux so we return 0.


VxThread::GetHandle

Method VxThread::GetHandle

const GENERIC_HANDLE
VxThread::GetHandle() const

Return the thread HANDLE specific to the system.


VxThread::GetID

Method VxThread::GetID

DWORD
VxThread::GetID() const

Return the thread ID specific to the system.


VxThread::GetName

Method VxThread::GetName

const XString&
VxThread::GetName() const

Return the name of the thread.

Remarks

If the name hasn't been setted on the creation the name of the thread is “THREAD_xxxx” where “xxxx” is the handle of the thread. This handle is available after a successful call to CreateThread.


VxThread::GetPriority

Method VxThread::GetPriority

unsigned int
VxThread::GetPriority() const

Return the thread priority

See Also

SetPriority.


VxThread::IsCreated

Method VxThread::IsCreated

BOOL
VxThread::IsCreated() const

Check if the system thread was created.

See Also

CreateThread.


VxThread::IsJoinable

Method VxThread::IsJoinable

BOOL
VxThread::IsJoinable() const

Check if the thread is joinable. It means if a call to Join is possible.

Remarks

On Windows systems a thread is always joinable.

See Also

Join.


VxThread::IsMainThread

Method VxThread::IsMainThread

BOOL
VxThread::IsMainThread() const

Check if the current VxThread object represent the main thread.


VxThread::IsStarted

Method VxThread::IsStarted

BOOL
VxThread::IsStarted() const

Check if the thread is running at this time.

See Also

CreateThread, Suspend, Resume.


VxThread::SetName

Method VxThread::SetName

void
VxThread::SetName(const char* name)

Set the name of the thread.

Remarks

This method must be called before creating a thread.

See Also

CreateThread.


VxThread::SetPriority

Method VxThread::SetPriority

void
VxThread::SetPriority(unsigned int priority)

Set the priority of the thread.

Parameters

Input argument priority

the thread priority (see NKTHREAD_PRIORITY).

Remarks

This method must be called before creating a thread.

See Also

CreateThread, NKTHREAD_PRIORITY.


VxThread::Terminate

Method VxThread::Terminate

BOOL
VxThread::Terminate(unsigned int* status)

Used to cause a thread to exit

Parameters

Output argument status

exit status of the thread associated with the current VxThread object.

Returns

TRUE if successful. FALSE else.

Remarks

Terminate is a dangerous function that should only be used in the most extreme cases.

After calling Terminate you need to call Close on the VxThread object to free memory associated with the system thread.

See Also

Close.


VxThread::Wait

Method VxThread::Wait

int
VxThread::Wait(unsigned int* status,unsigned int timeout)

Wait for the specified thread.

Parameters

Output argument status | exit status of the thread associated with the current VxThread object.
Input argument timeout | The time-out.

Returns

VXT_OK If successful. VXTERROR_WAIT or VTERROR_EXITCODE else.

Remarks

The thread which call this method will block until the Join method finished (the thread associated with the VxThread object is ended or the timeout was reached).

After calling Wait you need to call Close on the VxThread object to free memory associated with the system thread.

See Also

Close.


VxThread::GetExitCode

Method VxThread::GetExitCode

BOOL
VxThread::GetExitCode(unsigned int& status)
const unsigned int VXT_STILLACTIVE
const unsigned int VXT_TERMINATEFORCED

The GetExitCode function retrieves the termination status of the specified thread.

Parameters

Output argument status

Used to receive the thread termination status. This value is a int (VXT_OK or int _NULLTHREAD at this time are the only int value that can be returned) or a value greater than 0 defined by the user of the thread.

Returns

TRUE If successful. FALSE else.

Remarks

If the specified thread has not terminated, the termination status returned is VXT_STILLACTIVE If the thread has terminated, the termination status returned may be one of the following:

  • The exit value specified in the Terminate (or VXT_TERMINATEFORCED if no value has been specified) function.

  • The return value from the thread function.

  • The exit value of the thread's process.

See Also

Terminate,VXT_STILLACTIVE,VXT_TERMINATEFORCED.


VxThread::~VxThread

Virtual Method Method VxThread::~VxThread

VxThread::~VxThread()

Destructor.

Remarks

Destroy the VxThread object. The system thread associated with the VxThread is not destroy until its thread function ended.


VxTimeProfiler

Class VxTimeProfiler

Class for timing purposes

Remarks

This class provides methods to accurately compute the time elapsed. On PC platform it uses the Windows QueryPerformanceCounter function to be compatible with processor with the Intel SpeedStep feature.

The VxRDTSCProfiler class is best suited when profiling small chunk of code has it has smaller overhead than VxTimeProfiler.

Groups

Constructors
Method VxTimeProfiler | Starts profiling
Operations
Method Current |
Method Reset |
Method Split | Returns the current time elapsed (in milliseconds)
Destructors
Method ~VxTimeProfiler | Description: Destroys the object This destroys all the subordinate objects for this object.

Example

 To profile several items :

VxTimeProfiler MyProfiler;
...
float delta_time=MyProfiler.Current();
MyProfiler.Reset();
...
float delta_time2=MyProfiler.Current();

See Also

VxRDTSCProfiler


VxTimeProfiler::VxTimeProfiler

Method VxTimeProfiler::VxTimeProfiler

VxTimeProfiler::VxTimeProfiler()
VxTimeProfiler::VxTimeProfiler(BOOL iReset)

Starts profiling

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxTimeProfiler::Current

Method VxTimeProfiler::Current

float VxTimeProfiler::Current()


VxTimeProfiler::Reset

Method VxTimeProfiler::Reset

void VxTimeProfiler::Reset()


VxTimeProfiler::Split

Method VxTimeProfiler::Split

float VxTimeProfiler::Split()

Returns the current time elapsed (in milliseconds)


VxTimeProfiler::~VxTimeProfiler

Method VxTimeProfiler::~VxTimeProfiler

VxTimeProfiler::~VxTimeProfiler()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XGUID

Class XGUID

Global Unique Identifier Struture.

Remarks

Comparison operators are defined so XGUIDS can be compared with ==,!= ,<,> operators.

Groups

Data Members
Member Variable d1 |
Member Variable d2 |
Constructors
Method XGUID | Description: Builds an instance of the object This builds an instance of the object out of its parameters.


XGUID::d1

Member Variable XGUID::d1

XDWORD XGUID::d1


XGUID::d2

Member Variable XGUID::d2

XDWORD XGUID::d2


XGUID::XGUID

Method XGUID::XGUID

explicit XGUID::XGUID(XDWORD gd1=0,XDWORD gd2=0)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


System Functions

External Function VxAddLibrarySearchPath | Add a search path for third party DLL .
External Function VxGetEnvironmentVariable | Gets the Value of an environment variable.
External Function VxGetOs | Returns the current operating system.
External Function VxGetPlatform | Returns the current platform.
External Function VxScanCodeToAscii | Converts a Scan code to Ascii (char)
External Function VxScanCodeToName | Converts a Scan code to a description string
External Function VxSetCursor | Changes the system mouse cursor.
External Function VxSetEnvironmentVariable | Sets the Value of an environment variable.
External Function VxShowCursor | Shows or hide the mouse cursor.
External Function VxURLDownloadToCacheFile | Downloads data into the Internet cache and returns the file name.
Windows functions |
Directories functions |

See Also

System Utilities


VxAddLibrarySearchPath

External Function VxAddLibrarySearchPath

void VxAddLibrarySearchPath(char* path)

Add a search path for third party DLL .

Parameters

Input argument path

Directory path to add to environment variable.

Remarks

This function adds a path to the standard search path for Dll so that third-party dll can be found when loading plugins.


VxGetEnvironmentVariable

External Function VxGetEnvironmentVariable

BOOL VxGetEnvironmentVariable(char* envName,XString& envValue)

Gets the Value of an environment variable.

Parameters

Input argument envName | The environment variable who's value will be retrieved
Input argument envValue | an XString that will receive the value

See Also

VxSetEnvironmentVariable


VxGetOs

External Function VxGetOs

VX_OSINFO VxGetOs()

Returns the current operating system.


VxGetPlatform

External Function VxGetPlatform

VX_PLATFORMINFO VxGetPlatform()

Returns the current platform.


VxScanCodeToAscii

External Function VxScanCodeToAscii

char VxScanCodeToAscii(DWORD scancode,unsigned char mykeystate[256])

Converts a Scan code to Ascii (char)

Parameters

Input argument scancode

Scan code of the keyboard key to convert.

Returns

The corresponding char value.

See Also

VxScanCodeToName


VxScanCodeToName

External Function VxScanCodeToName

int VxScanCodeToName(DWORD scancode,char *keyName)

Converts a Scan code to a description string

Parameters

Input argument scancode

Scan code of the keyboard key to convert.

Returns

Length of description string.

Remarks

This function can be called with keyName=NULL to retrieve the size of the description string.

See Also

VxScanCodeToAscii


VxSetCursor

External Function VxSetCursor

BOOL VxSetCursor(VXCURSOR_POINTER cursorID)

Changes the system mouse cursor.

Parameters

Input argument cursorID

VXCURSOR_POINTER defining the system mouse cursor.


VxSetEnvironmentVariable

External Function VxSetEnvironmentVariable

BOOL VxSetEnvironmentVariable(char* envName,char* envValue)

Sets the Value of an environment variable.

Parameters

Input argument envName | The environment variable who's value will be set
Input argument envValue | Value string

See Also

VxGetEnvironmentVariable


VxShowCursor

External Function VxShowCursor

int VxShowCursor(BOOL show)

Shows or hide the mouse cursor.

Parameters

Input argument show

TRUE to show the mouse cursor, FALSE to hide it.

Remarks

On Windows system the show cursor function manages a reference count. If VxShowCursor(TRUE) is called 12 times, you'll need to call VxShowCursor(FALSE) 13 times to hide the mouse cursor.


VxURLDownloadToCacheFile

External Function VxURLDownloadToCacheFile

DWORD VxURLDownloadToCacheFile(char* File,char* CachedFile,int szCachedFile)

Downloads data into the Internet cache and returns the file name.

Parameters

Input argument File | URL to be downloaded. This cannot be set to NULL.
Input argument CachedFile | Name of the downloaded file. This cannot be set to NULL.
Input argument szCachedFile | Size of the CachedFile buffer.

Returns

0 if successful.


Windows functions

See Also

System Functions


Directories functions

External Function VxFileExist | Tests if a file exists
External Function VxGetCurrentDirectory | Gets the current working directory.
External Function VxMakePath | Concats a path and file name.
External Function VxRenameFile | Rename a file or a directory
External Function VxSetCurrentDirectory | Sets the current working directory.
External Function VxAddDirectorySeparator | Adds the character representing a directory separator on the current system.
External Function VxConvertPathToSystemPath | Converts a path to be compatible with current system.

See Also

System Functions


VxFileExist

External Function VxFileExist

BOOL VxFileExist(const char* iPath)

Tests if a file exists

Parameters

Input argument iPath

A string that will be filled with the full path of path + file.

Returns

TRUE if the file exists.


VxGetCurrentDirectory

External Function VxGetCurrentDirectory

BOOL VxGetCurrentDirectory(char *path)

Gets the current working directory.

Parameters

Input argument path

A string that will be filled with the current working directory.

Returns

TRUE if successful.

Remarks

path must be allocated to a minimum of _MAX_PATH bytes.


VxMakePath

External Function VxMakePath

BOOL VxMakePath(char *fullpath,char *path, char *file)

Concats a path and file name.

Parameters

Input argument fullpath | A string that will be filled with the full path of path + file.
Input argument path | A string containing the directory name.
Input argument file | A string containing the file name.

Returns

TRUE if successful.


VxRenameFile

External Function VxRenameFile

BOOL VxRenameFile(const char* iOldPath, const char* iNewPath)

Rename a file or a directory

Parameters

Input argument iOldPath | Old full path of the file to rename.
Input argument iNewPath | Old new path of the file to rename.

Returns

TRUE if the renaming is successfull.


VxSetCurrentDirectory

External Function VxSetCurrentDirectory

BOOL VxSetCurrentDirectory(char *path)

Sets the current working directory.

Parameters

Input argument path

A string that will be used to set the current directory

Returns

TRUE if successful.


VxAddDirectorySeparator

External Function VxAddDirectorySeparator

void VxAddDirectorySeparator(XString& path)

Adds the character representing a directory separator on the current system.

Parameters

Input argument path

a Xstring to add a directory separator to.

Remarks

Depending on the system the character can be
Macintosh - “:”
PC/XBox - “\”
Linux/PS2   - “/”


VxConvertPathToSystemPath

External Function VxConvertPathToSystemPath

void VxConvertPathToSystemPath(XString& path)

Converts a path to be compatible with current system.

Remarks

Process a string representing a directory or a file to be compatible with the current system. It means directory seperators are converted to match the current system.

See Also

DIRECTORY_SEP_STRING,VxAddDirectorySeparator


Processor Identification

External Function GetProcessorDescription | Returns a description of the processor. The processor type and frequency are detected at startup of any program using VxMath library. This function returns a string describing the processor (eg. Pentium MMX 233Mhz (estimated:233)).
External Function GetProcessorFeatures | Returns features supported by processor (Combinaison of ProcessorsFeatures enums).
External Function GetProcessorFrequency | Returns the processor frequency in MHz. The processor type and frequency are detected at startup of any program using VxMath library.
External Function GetProcessorType | Returns the processor type. The processor type and frequency are detected at startup of any program using VxMath library.
External Function ModifyProcessorFeatures | Emulates the removal of processor specific optimisation.
Enumerated Type ProcessorsFeatures | Enumerations of different processor features. The processor type and frequency are detected at startup of any program using VxMath library.
Enumerated Type ProcessorsType | Enumerations of different processor types. The processor type and frequency are detected at startup of any program using VxMath library.
External Function VxGetFPUControlWord | Returns the current FPU control word.
External Function VxSetBaseFPUControlWord | Sets the default settings for the FPU control word.
External Function VxSetFPUControlWord | Sets the current FPU control word.

See Also

System Utilities


GetProcessorDescription

External Function GetProcessorDescription

char* GetProcessorDescription()

Returns a description of the processor.

The processor type and frequency are detected at startup of any program using VxMath library. This function returns a string describing the processor (eg. Pentium MMX 233Mhz (estimated:233)).

Returns

A string describing the processor.

See Also

GetProcessorFrequency,GetProcessorType


GetProcessorFeatures

External Function GetProcessorFeatures

DWORD GetProcessorFeatures()

Returns features supported by processor (Combinaison of ProcessorsFeatures enums).

Remarks

At startup processor features are detected and stored by VxMath library. External plugins and NeMo core use these features to determine which optimisation level they can afford.

See Also

ProcessorsFeatures,GetProcessorFrequency,GetProcessorType,ModifyProcessorFeatures


GetProcessorFrequency

External Function GetProcessorFrequency

int GetProcessorFrequency()

Returns the processor frequency in MHz.

The processor type and frequency are detected at startup of any program using VxMath library.

Returns

Processor Frequency in Mhz

See Also

GetProcessorType,GetProcessorDescription


GetProcessorType

External Function GetProcessorType

ProcessorsType GetProcessorType()

Returns the processor type.

The processor type and frequency are detected at startup of any program using VxMath library.

Returns

A ProcessorsType Enum value identifying the processor type

See Also

GetProcessorFrequency,GetProcessorDescription


ModifyProcessorFeatures

External Function ModifyProcessorFeatures

void ModifyProcessorFeatures(DWORD Add,DWORD Remove)

Emulates the removal of processor specific optimisation.

Parameters

Input argument Add | A combinaison of ProcessorsFeatures to add.
Input argument Remove | A combinaison of ProcessorsFeatures to remove.

Remarks

o At startup processor features are detected and stored by VxMath library. External plugins and NeMo core use these features to determine which optimisation level they can afford. By modifying these features one can emulate an older processor and disable these optimisations. o Adding features that a processor does not support (like setting the PROC_SIMD (PIII instructions) on a PII) can cause fatal exception (illegal instructions) and stop the program. The Add argument should rather be used to restore previously removed features.

See Also

GetProcessorFrequency,GetProcessorType,ProcessorsFeatures


ProcessorsFeatures

Enumerated Type ProcessorsFeatures

enum ProcessorsFeatures
{
PROC_HASFPU = 0x00000001,
PROC_V86 = 0x00000002,
PROC_DE = 0x00000004,
PROC_PSE = 0x00000008,
PROC_TIMESTAMP = 0x00000010,
PROC_MSR = 0x00000020,
PROC_PAE = 0x00000040,
PROC_MCE = 0x00000080,
PROC_CMPXCHG8B = 0x00000100,
PROC_APIC = 0x00000200,
PROC_RESERVED = 0x00000400,
PROC_SEP = 0x00000800,
PROC_MTRR = 0x00001000,
PROC_PGE = 0x00002000,
PROC_MCA = 0x00004000,
PROC_CMOV = 0x00008000,
PROC_PAT = 0x00010000,
PROC_PST32 = 0x00020000,
PROC_PN = 0x00040000,
PROC_MMX = 0x00800000,
PROC_FXSR = 0x01000000,
PROC_SIMD = 0x02000000,
PROC_WNI = 0x04000000,
PROC_SS = 0x08000000,
PROC_HTT = 0x10000000,
PROC_TM = 0x20000000,
}

Enumerations of different processor features.

The processor type and frequency are detected at startup of any program using VxMath library.

Members

PROC_APIC | APIC on Chip
PROC_CMOV | CMOVcc instructions
PROC_CMPXCHG8B | CMPXCHG8B instruction available
PROC_DE | Debugging Extensions
PROC_FXSR | Fast state save/restore
PROC_HASFPU | Fpu on Chip
PROC_HTT | Hyper Threading Technology
PROC_MCA |
PROC_MCE |
PROC_MMX | MMX instructions available
PROC_MSR | Model specific register
PROC_MTRR |
PROC_PAE |
PROC_PAT |
PROC_PGE |
PROC_PN | Processor Number
PROC_PSE | Page size Extensions
PROC_PST32 |
PROC_RESERVED |
PROC_SEP |
PROC_SIMD | SIMD instructions available
PROC_SS | Self snoop
PROC_TIMESTAMP | Time stamp counter available
PROC_TM | Thermal Moitoring
PROC_V86 |
PROC_WNI | Willamette new instructions available

See Also

GetProcessorFeatures,ModifyProcessorFeatures


ProcessorsType

Enumerated Type ProcessorsType

enum ProcessorsType
{
PROC_UNKNOWN =-1,
PROC_PENTIUM =0,
PROC_PENTIUMMMX =1,
PROC_PENTIUMPRO =2,
PROC_K63DNOW =3,
PROC_PENTIUM2 =4,
PROC_PENTIUM2XEON =5,
PROC_PENTIUM2CELERON=6,
PROC_PENTIUM3 =7,
PROC_ATHLON =9,
PROC_PENTIUM4 =10,
PROC_PPC_ARM =11,
PROC_PPC_MIPS =12,
PROC_PPC_G3 =13,
PROC_PPC_G4 =14,
PROC_PSX2 =15,
PROC_XBOX2 =16,
PROC_PSP =17
}

Enumerations of different processor types.

The processor type and frequency are detected at startup of any program using VxMath library.

Members

PROC_ATHLON | AMD K7 Athlon Processor
PROC_K63DNOW | AMD K6 + 3DNow ! support
PROC_PENTIUM | Standard Pentium Processor
PROC_PENTIUM2 | Intel Pentium II Processor Model 3
PROC_PENTIUM2CELERON | Intel Pentium II Processor Celeron Model 6
PROC_PENTIUM2XEON | Intel Pentium II Processor Xeon or Celeron Model 5
PROC_PENTIUM3 | Intel Pentium III Processor
PROC_PENTIUM4 | Intel Pentium 4 Processor
PROC_PENTIUMMMX | Standard Pentium Processor with MMX support
PROC_PENTIUMPRO | Intel Pentium Pro Processor
PROC_PPC_ARM | Pocket PC ARM Device
PROC_PPC_G3 | Power PC G3
PROC_PPC_G4 | Power PC G4
PROC_PPC_MIPS | Pocket PC MIPS Device
PROC_PSP | XBOX2 CPU
PROC_PSX2 | MIPS PSX2
PROC_UNKNOWN | Processor type can not be detected
PROC_XBOX2 | XBOX2 CPU

See Also

GetProcessorType


VxGetFPUControlWord

External Function VxGetFPUControlWord

WORD VxGetFPUControlWord()

Returns the current FPU control word.


VxSetBaseFPUControlWord

External Function VxSetBaseFPUControlWord

void VxSetBaseFPUControlWord()

Sets the default settings for the FPU control word.

Remarks

Sets the FPU control word so that :

  • we are in single precision mode

  • rounding is to nearest

  • all exceptions are disabled...


VxSetFPUControlWord

External Function VxSetFPUControlWord

void VxSetFPUControlWord(WORD Fpu)

Sets the current FPU control word.


sizeofarray

Macro sizeofarray

#define sizeofarray(array) (sizeof(array) / sizeof((array)[0]))

Handy macro that return the number of elements in a static array.


XRemoveIf

External Function XRemoveIf

template <class Iter, class Pred> Iter XRemoveIf(Iter begin, Iter end, const Pred& predicate)
template <class Cont, class Pred> void XRemoveIf(Cont &cont, const Pred& predicate)

Remove all elements that match the predicate in a sequential range. This occurs in place. The predicate object should be stateless and provide a () operator that receive the element to be tested, and returns true if it is to be deleted. The order of the remaining elements is preserved.

Remarks

This function mimics the STL 'remove_if' function : it doesn't erase the last elements in a container, but returns a pointer on the new 'end' of the container. It is up to the caller to delete the ['new end', 'old end'] range in the container. It is needed because this function don't have a reference on the container. (It just knows about its iterator)


Graphic Utilities

External Function BGRAFTOCOLOR | Converts 4 floats to a DWORD BGRA color
External Function GetBitCount | Counts number of bits to representing a value in dwMask.
External Function GetBitShift | Counts number of bits to shift to acces a non zero value in dwMask.
External Function GetQuantizationSamplingFactor | Return the sampling actor of the quantization algorithm.
External Function RGBAFTOCOLOR | Converts 4 floats to a DWORD ARGB color
External Function SetQuantizationSamplingFactor | Sets the sampling actor of the quantization algorithm.
External Function VxBppToMask | Creates a default mask for each color component from a given number of bits per pixel.
Class VxColor | Structure describing a color through 4 floats.
External Function VxConvertToBumpMap | Convert the bitmap to a bump map.
External Function VxConvertToNormalMap | Convert the bitmap to a normal map.
External Function VxDoAlphaBlit | Sets the alpha component of an image.
External Function VxDoBlit | Performs a blit between two images.
External Function VxGenerateMipMap | Generate the sub mipmap level of an image .
External Function VxGetBitCounts | Counts number of bits used by each color component.
External Function VxGetBitShifts | Counts number of bits to shift to acces each color component.
External Function VxImageDesc2PixelFormat | Returns a pixel format given a VxImageDescEx.
Class VxImageDescEx | Enhanced Image description
External Function VxPixelFormat2ImageDesc | Fills a VxImageDescEx structure given a pixel format.
External Function VxPixelFormat2String | Returns a description string for a given pixel format.
External Function VxResizeImage32 | Performs a resizing between two images.
Bitmaps & Fonts functions |

See Also

VxMath Reference


BGRAFTOCOLOR

External Function BGRAFTOCOLOR

unsigned int BGRAFTOCOLOR(const VxColor* col)

Converts 4 floats to a DWORD BGRA color

Remarks

This function takes 4 floats R,G,B,A (in the range 0..1) and converts them into a color stored in DWORD in 32 bit BGRA format.


GetBitCount

External Function GetBitCount

DWORD GetBitCount(DWORD dwMask)

Counts number of bits to representing a value in dwMask.


GetBitShift

External Function GetBitShift

DWORD GetBitShift(DWORD dwMask)

Counts number of bits to shift to acces a non zero value in dwMask.


GetQuantizationSamplingFactor

External Function GetQuantizationSamplingFactor

int
GetQuantizationSamplingFactor()

Return the sampling actor of the quantization algorithm.

Remarks

1 means all the pixels of the image are used to create the palette, 10 means 1 pixel every 10 is used.

See Also

SetQuantizationSamplingFactor


RGBAFTOCOLOR

External Function RGBAFTOCOLOR

unsigned int RGBAFTOCOLOR(const VxColor* col)
unsigned int RGBAFTOCOLOR(float r,float g,float b,float a)

Converts 4 floats to a DWORD ARGB color

Remarks

This function takes 4 floats R,G,B,A (in the range 0..1) and converts them into a color stored in DWORD in 32 bit ARGB format.


SetQuantizationSamplingFactor

External Function SetQuantizationSamplingFactor

void
SetQuantizationSamplingFactor(int sf)

Sets the sampling actor of the quantization algorithm.

Remarks

1 means all the pixels of the image are used to create the palette, 10 means 1 pixel every 10 is used.

See Also

GetQuantizationSamplingFactor


VxBppToMask

External Function VxBppToMask

void VxBppToMask(VxImageDescEx& desc)

Creates a default mask for each color component from a given number of bits per pixel.

Remarks

Default masks:

16 Bpp => RGB 555 24 Bpp => RGB 888 32 Bpp => ARGB 8888


VxColor

Class VxColor

Structure describing a color through 4 floats.

Remarks

Structure describing a color through 4 floats for each component Red, Green, Blue and Alpha.

Most methods are used to construct a VxColor or to convert it to a 32 but ARGB format.

A VxColor is defined as:

typedef struct VxColor {
   union {
      struct {
              float r,g,b,a;
      };
      float col[4];
   };
}

Groups

Constructors
Method VxColor | Constructors
Assignment
Method operator*= | Description: Multiply-Equals Operator This sets the current object to the product of the original value of this object and the value on the right.
Method operator+= | Description: Plus-Equals Operator This sets the current object to the sum of the original value of this object and the value on the right.
Method operator-= | Description: Minus-Equals Operator This sets the current object to the difference between the original value of this object and the value on the right.
Method operator/= | Description: Divide-Equals Operator This sets the current object to the result of dividing the original value of this object by the value on the right.
Operations
Method Check | Ensure that every component is clamped to [0..1]
Method Clear | Sets all components to 0
Static Object Method Convert |
Method GetRGB | Returns the color in a DWORD in the 32 bit format ARGB and sets alpha to 255
Method GetRGBA | Returns the color in a DWORD in the 32 bit format ARGB
Method GetSquareDistance | Returns square distance between two colors.
Method Set | Initializations


VxColor::VxColor

Method VxColor::VxColor

inline VxColor::VxColor(const float _r, const float _g, const float _b,const float _a)
inline VxColor::VxColor()
inline VxColor::VxColor(const int _r, const int _g, const int _b,const int _a)
inline VxColor::VxColor(const int _r, const int _g, const int _b)
inline VxColor::VxColor(const float _r, const float _g, const float _b)
inline VxColor::VxColor(const float _r)
inline VxColor::VxColor(const unsigned int colz)

Remarks

Constructors


VxColor::operator*=

Method VxColor::operator*=

inline VxColor& VxColor::operator*= (const VxColor& v)
inline VxColor& VxColor::operator*= (float s)

Returns

A reference to the current object.

Remarks

Description: Multiply-Equals Operator

This sets the current object to the product of the original value of this object and the value on the right.


VxColor::operator+=

Method VxColor::operator+=

inline VxColor& VxColor::operator+= (const VxColor& v)

Returns

A reference to the current object.

Remarks

Description: Plus-Equals Operator

This sets the current object to the sum of the original value of this object and the value on the right.


VxColor::operator-=

Method VxColor::operator-=

inline VxColor& VxColor::operator-= (const VxColor& v)

Returns

A reference to the current object.

Remarks

Description: Minus-Equals Operator

This sets the current object to the difference between the original value of this object and the value on the right.


VxColor::operator/=

Method VxColor::operator/=

inline VxColor& VxColor::operator/= (const VxColor& v)
inline VxColor& VxColor::operator/= (float s)

Returns

A reference to the current object.

Remarks

Description: Divide-Equals Operator

This sets the current object to the result of dividing the original value of this object by the value on the right.


VxColor::Check

Method VxColor::Check

void VxColor::Check()

Remarks

Ensure that every component is clamped to [0..1]


VxColor::Clear

Method VxColor::Clear

inline void VxColor::Clear()

Remarks

Sets all components to 0


VxColor::Convert

Static Object Method VxColor::Convert

static unsigned int VxColor::Convert(float _r, float _g, float _b,float _a = 1.0f)
static unsigned int VxColor::Convert(int _r, int _g, int _b,int _a = 255)


VxColor::GetRGB

Method VxColor::GetRGB

inline unsigned int VxColor::GetRGB() const

Remarks

Returns the color in a DWORD in the 32 bit format ARGB and sets alpha to 255


VxColor::GetRGBA

Method VxColor::GetRGBA

inline unsigned int VxColor::GetRGBA() const

Remarks

Returns the color in a DWORD in the 32 bit format ARGB


VxColor::GetSquareDistance

Method VxColor::GetSquareDistance

inline float VxColor::GetSquareDistance(const VxColor& color) const

Remarks

Returns square distance between two colors.


VxColor::Set

Method VxColor::Set

inline void VxColor::Set(const float _r, const float _g, const float _b,const float _a)
inline void VxColor::Set(const int _r, const int _g, const int _b,const int _a)
inline void VxColor::Set(const int _r, const int _g, const int _b)
inline void VxColor::Set(const float _r, const float _g, const float _b)
inline void VxColor::Set(const float _r)
inline void VxColor::Set(const unsigned int colz)

Remarks

Initializations


VxConvertToBumpMap

External Function VxConvertToBumpMap

BOOL VxConvertToBumpMap(const VxImageDescEx& image)

Convert the bitmap to a bump map.

Remarks

o This method only works for 32 bit per pixel bitmaps.

o The source image is supposed to be a RGB representation of the displacement, the fonction converts its data to du,dv,Luminance respectively stored in the R,G and B components.


VxConvertToNormalMap

External Function VxConvertToNormalMap

BOOL VxConvertToNormalMap(const VxImageDescEx& image,DWORD ColorMask)

Convert the bitmap to a normal map.

Parameters

Input argument ColorMask

Mask of the color to take into account for the elevation info. 0xFFFFFFFF stands for the overall intensity, 0x00FF0000 for red component, 0x0000FF00 for green and 0x000000FF for blue.

Remarks

o This method only works for 32 bit per pixel bitmaps. o On supported drivers the texture blend mode can simulate the effect of bump-mapping using the DotProduct3 blend mode. For this effect the texture must contain a normal map information encoded on RGBA colors.


VxDoAlphaBlit

External Function VxDoAlphaBlit

void VxDoAlphaBlit(const VxImageDescEx& dst_desc,BYTE AlphaValue)
void VxDoAlphaBlit(const VxImageDescEx& dst_desc,BYTE* AlphaValues)

Sets the alpha component of an image.

Parameters

Input argument AlphaValue | A BYTE value containing the alpha value to set to the whole image.
dst_desc | A pointer to a structure describing the destination image format.
Input argument AlphaValues | A BYTE array containing the alpha values for each pixel. This array should be allocated to Width*Height bytes.

Remarks

If the destination image does not have alpha information the function returns immediatly.

See Also

VxResizeImage32,VxDoBlit


VxDoBlit

External Function VxDoBlit

void VxDoBlit(const VxImageDescEx& src_desc,const VxImageDescEx& dst_desc)
void VxDoBlitUpsideDown(const VxImageDescEx& src_desc,const VxImageDescEx& dst_desc)
void VxDoBlitDeInterleaved(const VxImageDescEx& src_desc,const VxImageDescEx& dst_desc, const BOOL iField1First)
void VxDoBlitDeInterleavedUpsideDown(const VxImageDescEx& src_desc,const VxImageDescEx& dst_desc, const BOOL iField1First)

Performs a blit between two images.

Parameters

Input argument src_desc | A pointer to a structure describing the source image format.
Input argument dst_desc | A pointer to a structure describing the destination image format.

Remarks

  • If the two images have different pixel format, the function performs the relevant conversion.

  • VxDoBlit can resize (shrink or grow) images but only if the source image is in a 32 bit per pixel format.

  • VxDoBlitUpsideDown inverts the destination image.

See Also

VxResizeImage32,VxDoAlphaBlit


VxGenerateMipMap

External Function VxGenerateMipMap

void VxGenerateMipMap(const VxImageDescEx& src_desc,BYTE* Buffer)

Generate the sub mipmap level of an image .

Parameters

Input argument src_desc | A VxImageDescEx structure that contains the description of the source image.
Input argument Buffer | A memory buffer that will be filled with the sub level of the source image.

Remarks

  • Only works on 32 bpp images.

  • Source width and height must be power of 2 integers

  • Buffer must be allocated to at least (Width/2 * Height/2) Dwords.

  • The pitch (bytes per line) of the resulting image is (SourceWidth * 2)

See Also

VxImageDescEx,VxDoBlit


VxGetBitCounts

External Function VxGetBitCounts

void VxGetBitCounts(const VxImageDescEx& desc,DWORD& Rbits,DWORD& Gbits,DWORD& Bbits,DWORD& Abits)

Counts number of bits used by each color component.

Parameters

Input argument desc | A reference to a structure describing the pixel format.
Output argument Rbits | Number of bits for red component.
Output argument Gbits | Number of bits for green component.
Output argument Bbits | Number of bits for blue component.
Output argument Abits | Number of bits for alpha component.


VxGetBitShifts

External Function VxGetBitShifts

void VxGetBitShifts(const VxImageDescEx& desc,DWORD& Rshift,DWORD& Gshift,DWORD& Bshift,DWORD& Ashift)

Counts number of bits to shift to acces each color component.

Parameters

Input argument desc | A reference to a structure describing the pixel format.
Output argument Rshift | Number of bits to shift to the right to access red component.
Output argument Gshift | Number of bits to shift to the right to access green component.
Output argument Bshift | Number of bits to shift to the right to access blue component.
Output argument Ashift | Number of bits to shift to the right to access alpha component


VxImageDesc2PixelFormat

External Function VxImageDesc2PixelFormat

VX_PIXELFORMAT VxImageDesc2PixelFormat(const VxImageDescEx& desc)

Returns a pixel format given a VxImageDescEx.


VxImageDescEx

Class VxImageDescEx

Enhanced Image description

Remarks

The VxImageDescEx holds basically an VxImageDesc with additionnal support for Colormap, Image pointer and is ready for future enhancements.

Groups

Data Members
Member Variable AlphaMask | Mask for Alpha component
Member Variable BitsPerPixel | Number of bits per pixel
Member Variable ColorMap | Palette colors
Member Variable ColorMapEntries | If other than 0 image is palletized
Member Variable Flags | Reserved for special formats (such as compressed ) 0 otherwise
Member Variable Height | Height in pixel of the image
Member Variable Image |
Member Variable Size | Size of the structure
Member Variable Width | Width in pixel of the image
Constructors
Method VxImageDescEx | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method HasAlpha |
Method Set |
Comparison Operators
Method operator!= | Description: Not-Equals Operator
Method operator== | Description: Equality Operator


VxImageDescEx::AlphaMask

Member Variable VxImageDescEx::AlphaMask

DWORD VxImageDescEx::AlphaMask

Remarks

Mask for Alpha component


VxImageDescEx::BitsPerPixel

Member Variable VxImageDescEx::BitsPerPixel

int VxImageDescEx::BitsPerPixel

Remarks

Number of bits per pixel


VxImageDescEx::ColorMap

Member Variable VxImageDescEx::ColorMap

BYTE* VxImageDescEx::ColorMap

Remarks

Palette colors


VxImageDescEx::ColorMapEntries

Member Variable VxImageDescEx::ColorMapEntries

short VxImageDescEx::ColorMapEntries

Remarks

If other than 0 image is palletized


VxImageDescEx::Flags

Member Variable VxImageDescEx::Flags

DWORD VxImageDescEx::Flags

Remarks

Reserved for special formats (such as compressed ) 0 otherwise


VxImageDescEx::Height

Member Variable VxImageDescEx::Height

int VxImageDescEx::Height

Remarks

Height in pixel of the image


VxImageDescEx::Image

Member Variable VxImageDescEx::Image

BYTE* VxImageDescEx::Image


VxImageDescEx::Size

Member Variable VxImageDescEx::Size

int VxImageDescEx::Size

Remarks

Size of the structure


VxImageDescEx::Width

Member Variable VxImageDescEx::Width

int VxImageDescEx::Width

Remarks

Width in pixel of the image


VxImageDescEx::VxImageDescEx

Method VxImageDescEx::VxImageDescEx

VxImageDescEx::VxImageDescEx()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxImageDescEx::HasAlpha

Method VxImageDescEx::HasAlpha

BOOL VxImageDescEx::HasAlpha()


VxImageDescEx::Set

Method VxImageDescEx::Set

void VxImageDescEx::Set(const VxImageDescEx& desc)


VxImageDescEx::operator!=

Method VxImageDescEx::operator!=

int VxImageDescEx::operator!= (const VxImageDescEx& desc)

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


VxImageDescEx::operator==

Method VxImageDescEx::operator==

int VxImageDescEx::operator== (const VxImageDescEx& desc)

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


VxPixelFormat2ImageDesc

External Function VxPixelFormat2ImageDesc

void VxPixelFormat2ImageDesc(VX_PIXELFORMAT Pf,VxImageDescEx& desc)

Fills a VxImageDescEx structure given a pixel format.


VxPixelFormat2String

External Function VxPixelFormat2String

const char* VxPixelFormat2String(VX_PIXELFORMAT Pf)

Returns a description string for a given pixel format.


VxResizeImage32

External Function VxResizeImage32

void VxResizeImage32(const VxImageDescEx& src_desc,const VxImageDescEx& dst_desc)

Performs a resizing between two images.

Parameters

Input argument src_desc | A pointer to a structure describing the source image.
Input argument dst_desc | A pointer to a structure describing the destination image.

Remarks

o Both images must have a 32 bit per pixel format.


Bitmaps & Fonts functions

See Also

Graphic Utilities


Macros

Macro ASM_SUPPORTED
Macro CKPGUID_CUSTOMIZEDPARAM
Macro CKVERSION
define CKVERSION 0x19092006 (4.0.0.41)
define CKVERSION 0x24012007 // (4.0.0.64)
define CKVERSION 0x11042007 // (4.0.0.75) BF Case 1489
define CKVERSION 0x30062007 // (4.0.0.87) SP3
define CKVERSION 0x20082007 // (4.1.0.6) BF Case 1667
define CKVERSION 0x06112007 // (4.1.0.17) BF Case 1778
define CKVERSION 0x04022008   // (4.0.0.96) BF Case 1872
Macro ColorGetAlpha

Extracts Alpha component from a 32 bit ARGB color.
Macro ColorGetBlue

Extracts Blue component from a 32 bit ARGB color.
Macro ColorGetGreen

Extracts Green component from a 32 bit ARGB color.
Macro ColorGetRed

Extracts Red component from a 32 bit ARGB color.
Macro ColorSetAlpha

Sets Alpha component in a 32 bit ARGB color and returns the color.
Macro ColorSetBlue

Sets Blue component in a 32 bit ARGB color and returns the color.
Macro ColorSetGreen

Sets Green component in a 32 bit ARGB color and returns the color.
Macro ColorSetRed

Sets Red component in a 32 bit ARGB color and returns the color.
Macro DIRECTORY_SEP_CHAR

Defines the character representing a directory separator on the current system.
Macro DIRECTORY_SEP_STRING

Defines the string representing a directory separator on the current system.
Macro DLL_EXPORT

VC++ export option
Macro IMPLEMENT_POOL

Ensures a virtual class is allocated inside a fixed size memory pool.
Macro IMPLEMENT_POOL_CLASS

Ensures a class is allocated inside a fixed size memory pool. Adding this macro to the class definition ensure the memory allocation will be done in a fixed size pool For class that do not have a virtual table use this macro with the name of the class inside the class declaration
Macro INV_RANDMAX
Macro INVHALF_RANDMAX
Macro MAC_USE_ANSI_FOR_VXFILE

Define it to use standard ANSI routines Undef it to use Carbon Toolbox API
Macro MUPREVSIZE
Macro MUSIZE
Macro RGBAITOCOLOR

Convers 4 integers to a DWORD ARGB color
Macro SIMD_SUPPORTED

This is defined in VxMath.h header file and should be removed if your compiler does not support SIMD (Intel Pentium III) instructions to compile some of the sample behaviors that use such instructions... otherwise you can install the Visual C++ Processor Pack (available in VC++ Service Pack 4 and 5) that supports these instructions
Macro SPEEDSTEP_SAFE

define this macro to force the usage of QueryPerformanceCounter which works with Intel SpeedStep while rdtsc is not reliable
Macro USE_PIX
Macro VIRTOOLS_MAX_EXTENSION_SIZE
Macro VXRDTSCPROFILER

See Also

VxMath Reference


ASM_SUPPORTED

Macro ASM_SUPPORTED

#define ASM_SUPPORTED


CKPGUID_CUSTOMIZEDPARAM

Macro CKPGUID_CUSTOMIZEDPARAM

#define CKPGUID_CUSTOMIZEDPARAM CKDEFINEGUID( 0x91757c44 , 0xf18c37c7 )


CKVERSION

Macro CKVERSION

#define CKVERSION 0x07032008

Remarks

define CKVERSION 0x19092006 (4.0.0.41)
define CKVERSION 0x24012007 // (4.0.0.64)
define CKVERSION 0x11042007 // (4.0.0.75) BF Case 1489
define CKVERSION 0x30062007 // (4.0.0.87) SP3
define CKVERSION 0x20082007 // (4.1.0.6) BF Case 1667
define CKVERSION 0x06112007 // (4.1.0.17) BF Case 1778
define CKVERSION 0x04022008   // (4.0.0.96) BF Case 1872


ColorGetAlpha

Macro ColorGetAlpha

#define ColorGetAlpha(rgb) (((rgb) >> A_SHIFT) & 0xffL)

Extracts Alpha component from a 32 bit ARGB color.


ColorGetBlue

Macro ColorGetBlue

#define ColorGetBlue(rgb) (((rgb) >> B_SHIFT) & 0xffL)

Extracts Blue component from a 32 bit ARGB color.


ColorGetGreen

Macro ColorGetGreen

#define ColorGetGreen(rgb) (((rgb) >> G_SHIFT) & 0xffL)

Extracts Green component from a 32 bit ARGB color.


ColorGetRed

Macro ColorGetRed

#define ColorGetRed(rgb) (((rgb) >> R_SHIFT) & 0xffL)

Extracts Red component from a 32 bit ARGB color.


ColorSetAlpha

Macro ColorSetAlpha

#define ColorSetAlpha(rgba, x) (((x) << A_SHIFT) | ((rgba) & ~A_MASK))

Sets Alpha component in a 32 bit ARGB color and returns the color.


ColorSetBlue

Macro ColorSetBlue

#define ColorSetBlue(rgba, x) (((x) << B_SHIFT)| ((rgba) & ~B_MASK))

Sets Blue component in a 32 bit ARGB color and returns the color.


ColorSetGreen

Macro ColorSetGreen

#define ColorSetGreen(rgba, x) (((x) << G_SHIFT) | ((rgba) & ~G_MASK))

Sets Green component in a 32 bit ARGB color and returns the color.


ColorSetRed

Macro ColorSetRed

#define ColorSetRed(rgba, x) (((x) << R_SHIFT) | ((rgba) & ~R_MASK))

Sets Red component in a 32 bit ARGB color and returns the color.


DIRECTORY_SEP_CHAR

Macro DIRECTORY_SEP_CHAR

#define DIRECTORY_SEP_CHAR ':'

Defines the character representing a directory separator on the current system.

Remarks

Depending on the system the character can be
Macintosh - “:”
PC/XBox - “\”
Linux/PS2   - “/”


DIRECTORY_SEP_STRING

Macro DIRECTORY_SEP_STRING

#define DIRECTORY_SEP_STRING ":"

Defines the string representing a directory separator on the current system.

Remarks

Depending on the system the character can be
Macintosh - “:”
PC/XBox - “\”
Linux/PS2   - “/”


DLL_EXPORT

Macro DLL_EXPORT

#define DLL_EXPORT __declspec(dllexport)

Remarks

VC++ export option


IMPLEMENT_POOL

Macro IMPLEMENT_POOL

#define IMPLEMENT_POOL()\
void* operator new(size_t st) {\
return VxAllocator::Instance().AllocatePool(st);\
}\
void operator delete(void* mem,size_t st) {\
VxAllocator::Instance().ReleasePool(st,mem);\
}\

Ensures a virtual class is allocated inside a fixed size memory pool.

Remarks

Adding this macro to the class definition ensure the memory allocation will be done in a fixed size pool. This macro only works for class with a virtual table use IMPLEMENT_POOL_CLASS otherwise


IMPLEMENT_POOL_CLASS

Macro IMPLEMENT_POOL_CLASS

#define IMPLEMENT_POOL_CLASS(classname)\
void* operator new(size_t st) {\
return VxAllocator::Instance().AllocatePool(st);\
}\
void operator delete(void* mem,size_t st) {\
VxAllocator::Instance().ReleasePool(sizeof(classname),mem);\
}\

Ensures a class is allocated inside a fixed size memory pool. Adding this macro to the class definition ensure the memory allocation will be done in a fixed size pool For class that do not have a virtual table use this macro with the name of the class inside the class declaration


INV_RANDMAX

Macro INV_RANDMAX

#define INV_RANDMAX 4.65661287e-10f


INVHALF_RANDMAX

Macro INVHALF_RANDMAX

#define INVHALF_RANDMAX 9.31322575e-10f


MAC_USE_ANSI_FOR_VXFILE

Macro MAC_USE_ANSI_FOR_VXFILE

#define MAC_USE_ANSI_FOR_VXFILE

Remarks

Define it to use standard ANSI routines Undef it to use Carbon Toolbox API


MUPREVSIZE

Macro MUPREVSIZE

#define MUPREVSIZE 18


MUSIZE

Macro MUSIZE

#define MUSIZE (24-MUPREVSIZE)


RGBAITOCOLOR

Macro RGBAITOCOLOR

#define RGBAITOCOLOR(r,g,b,a) (((a) << A_SHIFT) | ((r) << R_SHIFT) | ((g) << G_SHIFT) | ((b) << B_SHIFT))

Convers 4 integers to a DWORD ARGB color

Remarks

This macro takes 4 integer R,G,B,A (in the range 0..255) and convert them into a color stored in DWORD in 32 bit ARGB format.


SIMD_SUPPORTED

Macro SIMD_SUPPORTED

#define SIMD_SUPPORTED

Remarks

This is defined in VxMath.h header file and should be removed if your compiler does not support SIMD (Intel Pentium III) instructions to compile some of the sample behaviors that use such instructions... otherwise you can install the Visual C++ Processor Pack (available in VC++ Service Pack 4 and 5) that supports these instructions


SPEEDSTEP_SAFE

Macro SPEEDSTEP_SAFE

#define SPEEDSTEP_SAFE

Remarks

define this macro to force the usage of QueryPerformanceCounter which works with Intel SpeedStep while rdtsc is not reliable


USE_PIX

Macro USE_PIX

#define USE_PIX


VIRTOOLS_MAX_EXTENSION_SIZE

Macro VIRTOOLS_MAX_EXTENSION_SIZE

#define VIRTOOLS_MAX_EXTENSION_SIZE 68


VXRDTSCPROFILER

Macro VXRDTSCPROFILER

#define VXRDTSCPROFILER


Overloaded Operators

External Function operator!= | Description: Not-Equals Operator
External Function operator* | Description: Multiplication Operator
External Function operator- | Description: Negation Operator
External Function operator/ | Description: Division Operator
External Function operator< | Description: Less-Than Operator
External Function operator<= | Description: Less-Than-Or-Equal Operator
External Function operator== | Description: Equality Operator

See Also

VxMath Reference


operator!=

External Function operator!=

inline int operator!= (const VxQuaternion& q1, const VxQuaternion& q2)
inline int operator!= (const VxRect& r1, const VxRect& r2)
inline int operator!= (const VxVector& v1, const VxVector& v2)
inline int operator!= (const VxVector4& v1, const VxVector4& v2)
inline int operator!= (const VxColor& col1, const VxColor& col2)

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


operator*

External Function operator*

inline VxQuaternion operator* (float s, const VxQuaternion& q)
inline VxQuaternion operator* (const VxQuaternion& q, float s)
inline const VxVector operator* (const VxVector& v1, const VxVector& v2)
inline const VxVector operator* (const VxVector& v, float s)
inline const VxVector operator* (float s, const VxVector& v)
inline const VxVector4 operator* (const VxVector4& v1, const VxVector4& v2)
inline const VxVector4 operator* (const VxVector4& v, float s)
inline const VxVector4 operator* (float s, const VxVector4& v)
inline VxColor operator* (const VxColor& col1, const VxColor& col2)
inline VxColor operator*(const VxColor& col,float s)
inline Vx2DVector operator* (float s, const Vx2DVector& v)

Returns

The result of multiplying the current object by the value of the object on the right.

Remarks

Description: Multiplication Operator


operator-

External Function operator-

inline const VxVector operator- (const VxVector& v)
inline const VxVector operator- (const VxVector& v1, const VxVector& v2)
inline const VxVector4 operator- (const VxVector4& v)
inline const VxVector4 operator- (const VxVector4& v1, const VxVector4& v2)
inline VxColor operator- (const VxColor& col1, const VxColor& col2)
inline const VxPlane operator- (const VxPlane& p)

Returns

The negation of the argument.

Remarks

Description: Negation Operator


operator/

External Function operator/

inline const VxVector operator/ (const VxVector& v1, const VxVector& v2)
inline const VxVector operator/ (const VxVector& v, float s)
inline const VxVector4 operator/ (const VxVector4& v1, const VxVector4& v2)
inline const VxVector4 operator/ (const VxVector4& v, float s)
inline VxColor operator/ (const VxColor& col1, const VxColor& col2)
inline Vx2DVector operator/ (float s, const Vx2DVector& v)

Returns

The current object divided by the one on the right.

Remarks

Description: Division Operator


operator<

External Function operator<

inline int operator< (const VxVector& v1, const VxVector& v2)

Returns

This returns true if this object is less than the one on the right-hand-side of the operator.

Remarks

Description: Less-Than Operator


operator<=

External Function operator<=

inline int operator<= (const VxVector& v1, const VxVector& v2)

Returns

This returns true if this object is not greater than the one on the right-hand-side of the operator.

Remarks

Description: Less-Than-Or-Equal Operator


operator==

External Function operator==

inline int operator== (const VxQuaternion& q1, const VxQuaternion& q2)
inline int operator== (const VxRect& r1, const VxRect& r2)
inline int operator== (const VxVector& v1, const VxVector& v2)
inline int operator== (const VxVector4& v1, const VxVector4& v2)
inline int operator== (const VxColor& col1, const VxColor& col2)

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


Misc Utilities

External Function _rotl

perform a left bit rotation (emulates _rotl & _rotr of Windows' Stdlib)
External Function _rotr

perform a right bit rotation (emulates _rotl & _rotr of Windows' Stdlib)
External Function ChooseRef

Enables the initialisation of a reference from two values.
External Function GaussianDistribution
External Function GetQuasiRandomGenerator
External Function Is2Power

return true if num is a power of 2
External Function Near2Power

return the nearest superior power of 2 of v
Class QuasiRandomGenerator
Class StandardRandomGenerator
External Function VxComputeBestFitBBox

Compute best Fit Box for a set of points
External Function VxCopyDwords2Words

Copy the contents of an array of WORDs (16bits) to an array of DWORDs (32bits).
External Function VxCopyStructure

copies an array of elements between two memory buffers
External Function VxCopyWords2Dwords

Copy the contents of an array of DWORDs (32bits) to an array of WORDs (16bits).
External Function VxDeleteAligned

Deletes a memory buffer allocated by VxNewAligned.
External Function VxFillStructure

Fills a memory buffer with a source buffer pattern.
External Function VxIndexedCopy

copies an array of elements between two memory buffers using an list of index
External Function VxIsAllocatedByNewAligned

Returns if a pointer was allocated with VxNewAligned.
External Function VxNewAligned

Allocates a memory buffer aligned on a given boundary.
External Function VxPtInRect

Returns if a point is inside a given rectangle.
Class VxRect

A Rect is defined by 4 floats and is used to represents a 2D region.

A VxRect is defined as:

class VxRect
{
public:
    float left;
    float top;
    float right;
    float bottom;
};

Elements can be accessed directly or by using the accessors functions for more sophisticate access.
Class VxSphere

A 3D Sphere defined by a center and a radius.
Class VxStridedData

Structure for storage of strided data.
Class VxStridedDataBase

Structure for storage of strided data.
External Function XAbs

Returns the absolute value of a.
Class XAP

auto_ptr like class.
External Function XFabs

Returns the absolute value of a float.
External Function XMax

Returns the maximum of two values.
External Function XMin

Returns the minimum of two values.
External Function XMinMax

Finds the minimum and maximum of 2 values.
Class XP

auto_ptr like class.
Class XPtrStrided

Strided pointers iterator class.
Class XRefCount

a reference counting class. You must derive from this class to use smart pointers.
Class XSmartPtr

Smart pointer class.
External Function XSqrt

Returns the square root value of a float.
External Function XSwap

Swaps two elements.
External Function XThreshold

Forces a value in an interval.

See Also

VxMath Reference


_rotl

External Function _rotl

inline int _rotl(int v, int shift)

perform a left bit rotation (emulates _rotl & _rotr of Windows' Stdlib)

Remarks

Macintosh only


_rotr

External Function _rotr

inline int _rotr(int v, int shift)

perform a right bit rotation (emulates _rotl & _rotr of Windows' Stdlib)

Remarks

Macintosh only


ChooseRef

External Function ChooseRef

template <class T>
const T& ChooseRef(XBOOL iCond, const T& iT1, const T& iT2)

Enables the initialisation of a reference from two values.

Parameters

Input argument iCond

TRUE to return iT1 , FALSE to return iT2;


GaussianDistribution

External Function GaussianDistribution

template <class R>
float
GaussianDistribution(const R& iRG, float iMean, float iDeviation)


GetQuasiRandomGenerator

External Function GetQuasiRandomGenerator

const QuasiRandomGenerator&
GetQuasiRandomGenerator()


Is2Power

External Function Is2Power

inline XBOOL Is2Power(int x)

return true if num is a power of 2


Near2Power

External Function Near2Power

inline int Near2Power(int v)

return the nearest superior power of 2 of v


QuasiRandomGenerator

Class QuasiRandomGenerator

Groups

Constructors
Method QuasiRandomGenerator | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operators
Method operator() | Returns an uniformely distribued float value : [0,1)
Operations
Method Gaussian | returns a random number distribued “gaussianly” with a mean and a deviation value : [iMean-iDeviation,iMean+iDeviation)


QuasiRandomGenerator::QuasiRandomGenerator

Method QuasiRandomGenerator::QuasiRandomGenerator

QuasiRandomGenerator::QuasiRandomGenerator()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


QuasiRandomGenerator::operator()

Method QuasiRandomGenerator::operator()

float QuasiRandomGenerator::operator()() const

Remarks

Returns an uniformely distribued float value : [0,1)


QuasiRandomGenerator::Gaussian

Method QuasiRandomGenerator::Gaussian

float QuasiRandomGenerator::Gaussian(float iMean, float iDeviation) const

Remarks

returns a random number distribued “gaussianly” with a mean and a deviation value : [iMean-iDeviation,iMean+iDeviation)


StandardRandomGenerator

Class StandardRandomGenerator

Groups

Constructors
Method StandardRandomGenerator | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operators
Method operator() | Returns an uniformely distribued float value : [0,1)
Operations
Method Gaussian | returns a random number distribued “gaussianly” with a mean and a deviation value : [iMean-iDeviation,iMean+iDeviation)
Method Init | Initialize the random generator for a given seed, the sequence of generated number will be the same


StandardRandomGenerator::StandardRandomGenerator

Method StandardRandomGenerator::StandardRandomGenerator

StandardRandomGenerator::StandardRandomGenerator()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


StandardRandomGenerator::operator()

Method StandardRandomGenerator::operator()

float StandardRandomGenerator::operator()() const

Remarks

Returns an uniformely distribued float value : [0,1)


StandardRandomGenerator::Gaussian

Method StandardRandomGenerator::Gaussian

float StandardRandomGenerator::Gaussian(float iMean, float iDeviation) const

Remarks

returns a random number distribued “gaussianly” with a mean and a deviation value : [iMean-iDeviation,iMean+iDeviation)


StandardRandomGenerator::Init

Method StandardRandomGenerator::Init

void StandardRandomGenerator::Init(unsigned int iSeed) const

Remarks

Initialize the random generator for a given seed, the sequence of generated number will be the same


VxComputeBestFitBBox

External Function VxComputeBestFitBBox

BOOL VxComputeBestFitBBox(const BYTE *Points, const DWORD Stride, const int Count, VxMatrix& BBoxMatrix, const float AdditionnalBorder )

Compute best Fit Box for a set of points


VxCopyDwords2Words

External Function VxCopyDwords2Words

void VxCopyDwords2Words(WORD* iDest,DWORD* iSrc,int iCount)

Copy the contents of an array of WORDs (16bits) to an array of DWORDs (32bits).


VxCopyStructure

External Function VxCopyStructure

BOOL VxCopyStructure(int Count,void* Dst,DWORD OutStride,DWORD SizeSrc,void* Src,DWORD InStride)
BOOL VxCopyStructure(int Count,const VxStridedData& Dst,DWORD SizeSrc,const VxStridedData& Src)

copies an array of elements between two memory buffers

Parameters

Input argument OutStride | Amount in bytes between each element in the destination buffer
Input argument InStride | Amount in bytes between each element in the source buffer
Count | Number of element to copy in the destination buffer
Dst | Destination buffer
SizeSrc | Size in bytes (but must be a multiple of 4) of an element
Src | Source buffer.

Remarks

This function can be used to initialized an array of structure when only some members should be modified.

Example

This code is optimized to perform a strided memcpy and is equivalent to:

        BYTE* DestinationBuffer = (BYTE *)Dst;
        BYTE* SourceBuffer = (BYTE *)Src;

        for (int i=0;i<Count;++i) {
            memcpy(DestinationBuffer,SourceBuffer,SizeSrc);
            DestinationBuffer += OutStride;
            SourceBuffer += InStride;
        }

See Also

VxFillStructure,VxIndexedCopy


VxCopyWords2Dwords

External Function VxCopyWords2Dwords

void VxCopyWords2Dwords(DWORD* iDest,WORD* iSrc,int iCount)

Copy the contents of an array of DWORDs (32bits) to an array of WORDs (16bits).

Remarks

This function does not perform any check on the validity of data. A 32 bit value converted to a 16 bit value lose its high order 16 bits.


VxDeleteAligned

External Function VxDeleteAligned

void VxDeleteAligned(void* ptr)

Deletes a memory buffer allocated by VxNewAligned.

Parameters

Input argument ptr

A pointer to the buffer to destroy.

See Also

VxNewAligned


VxFillStructure

External Function VxFillStructure

BOOL VxFillStructure(int Count,void* Dst,DWORD Stride,DWORD SizeSrc,void* Src)
BOOL VxFillStructure(int Count,const VxStridedData& Dst,DWORD SizeSrc,void* Src)

Fills a memory buffer with a source buffer pattern.

Parameters

Input argument Stride | Amount in bytes between each element in the destination buffer
Count | Number of element to set in the destination buffer
Dst | Destination buffer
SizeSrc | Size in bytes (but must be a multiple of 4) of an element int the Src buffer
Src | Source buffer.

Remarks

This function can be used to initialized an array of structure when only some members should be modified.

Example

This code is optimized to perform a strided memset and is equivalent to:

        BYTE* DestinationBuffer = (BYTE *)Dst;
        DWORD* SourceBuffer = (DWORD *)Src;

        for (int i=0;i<Count;++i) {
            memcpy(DestinationBuffer,SourceBuffer,SizeSrc);
            DestinationBuffer += Stride;
        }

See Also

VxCopyStructure,VxIndexedCopy


VxIndexedCopy

External Function VxIndexedCopy

BOOL VxIndexedCopy(const VxStridedData& Dst,const VxStridedData& Src,DWORD SizeSrc,DWORD* Indices,int IndexCount)
BOOL VxIndexedCopy(const VxStridedData& Dst,const VxStridedData& Src,DWORD SizeSrc,WORD* Indices,int IndexCount)

copies an array of elements between two memory buffers using an list of index

Parameters

Dst | Destination buffer and stride between elements
Src | Source buffer and stride between elements
SizeSrc | Size in bytes (but must be a multiple of 4) of an element
Indices | An array of int or word indices giving the index of each element in the source buffer.
IndexCount | Number of indices

Example

This code is optimized to perform a strided memcpy and is equivalent to:

        BYTE* DestinationBuffer = (BYTE *)Dst.Data;
        BYTE* SourceBuffer = (BYTE *)Src.Data;

        for (int i=0;i<IndexCount;++i) {
            memcpy(DestinationBuffer,SourceBuffer[Src.Stride * Indices[i] ],SizeSrc);
            DestinationBuffer += Dst.Stride;
        }

See Also

VxFillStructure,VxIndexedCopy


VxIsAllocatedByNewAligned

External Function VxIsAllocatedByNewAligned

BOOL VxIsAllocatedByNewAligned(void* ptr,int alignement)

Returns if a pointer was allocated with VxNewAligned.

Remarks

Do not call delete on the returned pointer, use VxDeleteAligned.

See Also

VxNewAligned,VxDeleteAligned


VxNewAligned

External Function VxNewAligned

void* VxNewAligned(int size,int align)

Allocates a memory buffer aligned on a given boundary.

Parameters

Input argument size

Size in bytes of the buffer to allocate.

Returns

The allocated buffer.

Remarks

Do not call delete on the returned pointer, use VxDeleteAligned.

See Also

VxDeleteAligned


VxPtInRect

External Function VxPtInRect

BOOL VxPtInRect(CKRECT *rect, CKPOINT *pt)

Returns if a point is inside a given rectangle.


VxRect

Class VxRect

Remarks

A Rect is defined by 4 floats and is used to represents a 2D region.

A VxRect is defined as:

class VxRect
{
public:
    float left;
    float top;
    float right;
    float bottom;
};

Elements can be accessed directly or by using the accessors functions for more sophisticate access.

Groups

Data Members | Constructors | Assignment | Operations | Clipping | Creation | Tests | Transform

Data Members
Member Variable bottom |
Member Variable left |
Member Variable right |
Member Variable top |
Constructors
Method VxRect | Methods
Assignment
Method operator*= | Description: Multiply-Equals Operator This sets the current object to the product of the original value of this object and the value on the right.
Method operator+= | Description: Plus-Equals Operator This sets the current object to the sum of the original value of this object and the value on the right.
Method operator-= | Description: Minus-Equals Operator This sets the current object to the difference between the original value of this object and the value on the right.
Method operator/= | Description: Divide-Equals Operator This sets the current object to the result of dividing the original value of this object by the value on the right.
Operations
Method Bounding | Creates a rectangle bounding two given points.
Method Clear | Sets the rectangle as a NULL rectangle (position (0,0) ; size (0,0).
Method CopyFrom | Assign the VxRect to a CKRECT.
Method CopyTo | Assign the VxRect to a CKRECT.
Method GetBottomRight |
Method GetCenter |
Method GetHalfSize |
Method GetHCenter | Returns the horizontal center of the rect.
Method GetHeight | Returns the height of a rectangle.
Method GetSize | Returns the size of a rectangle.
Method GetTopLeft |
Method GetVCenter | Returns the vertical center of the rect.
Method GetWidth | Returns the width of a rectangle.
Method Inflate | Inflates a rectangle by an offset.
Method Interpolate | Interpolates a rectangle with another one.
Method Merge | Merge a rectangle with another one.
Method Move | Move a rectangle to a position.
Method Scale | Scales a rectangle by a factor.
Method SetBottomRight |
Method SetCenter | Creates a rectangle based on the center position and the half size.
Method SetDimension | Creates a rectangle based on the top left coner and the size.
Method SetHalfSize |
Method SetHeight | Changes the height of a rectangle.
Method SetSize | Changes the size of a rectangle.
Method SetTopLeft |
Method SetWidth | Changes the width of a rectangle.
Method TransformFromHomogeneous | Transform a point in homogeneous coordinates into a points in screen coordinates (the rect representing the screen).
Method TransformToHomogeneous | Transforms a screen coordinate rectangle to an homogeneous rectangle.
Method Translate | Translate a rectangle of an offset.
Clipping
Method Clip | Clips a rectangle over a clipping rectangle.
Creation
Method Normalize | Checks that the rectangle is valid. If not, turns it right.
Method SetCorners | Creates a rectangle based on two corners.
Tests
Method IsInside | Tests a rectangle over a clipping rectangle.
Method IsNull | Tests a rectangle for validity.
Method IsOutside | Tests a rectangle over a clipping rectangle.
Transform
Method Transform | Transforms a rectangle from a screen referentiel to another.


VxRect::bottom

Member Variable VxRect::bottom

float VxRect::bottom


VxRect::left

Member Variable VxRect::left

float VxRect::left


VxRect::right

Member Variable VxRect::right

float VxRect::right


VxRect::top

Member Variable VxRect::top

float VxRect::top


VxRect::VxRect

Method VxRect::VxRect

VxRect::VxRect()
VxRect::VxRect(Vx2DVector& topleft,Vx2DVector& bottomright)
VxRect::VxRect(float l,float t,float r,float b)

Remarks

Methods


VxRect::operator*=

Method VxRect::operator*=

VxRect& VxRect::operator*= (const Vx2DVector& t)

Returns

A reference to the current object.

Remarks

Description: Multiply-Equals Operator

This sets the current object to the product of the original value of this object and the value on the right.


VxRect::operator+=

Method VxRect::operator+=

VxRect& VxRect::operator+= (const Vx2DVector& t)

Returns

A reference to the current object.

Remarks

Description: Plus-Equals Operator

This sets the current object to the sum of the original value of this object and the value on the right.


VxRect::operator-=

Method VxRect::operator-=

VxRect& VxRect::operator-= (const Vx2DVector& t)

Returns

A reference to the current object.

Remarks

Description: Minus-Equals Operator

This sets the current object to the difference between the original value of this object and the value on the right.


VxRect::operator/=

Method VxRect::operator/=

VxRect& VxRect::operator/= (const Vx2DVector& t)

Returns

A reference to the current object.

Remarks

Description: Divide-Equals Operator

This sets the current object to the result of dividing the original value of this object by the value on the right.


VxRect::Bounding

Method VxRect::Bounding

void VxRect::Bounding(const Vx2DVector& p1,const Vx2DVector& p2)

Creates a rectangle bounding two given points.

Parameters

Input argument p1 | the first Vx2DVector.
Input argument p2 | the second Vx2DVector.

See Also

VxRect::SetCorners,VxRect::SetDimension


VxRect::Clear

Method VxRect::Clear

void VxRect::Clear()

Sets the rectangle as a NULL rectangle (position (0,0) ; size (0,0).


VxRect::CopyFrom

Method VxRect::CopyFrom

void VxRect::CopyFrom(const CKRECT& iRect)

Assign the VxRect to a CKRECT.

Parameters

Input argument iRect

the rectangle to copy from.


VxRect::CopyTo

Method VxRect::CopyTo

void VxRect::CopyTo(CKRECT* oRect) const

Assign the VxRect to a CKRECT.

Parameters

Input argument oRect

the rectangle to copy to.


VxRect::GetBottomRight

Method VxRect::GetBottomRight

const Vx2DVector& VxRect::GetBottomRight() const
Vx2DVector& VxRect::GetBottomRight()


VxRect::GetCenter

Method VxRect::GetCenter

Vx2DVector VxRect::GetCenter() const


VxRect::GetHalfSize

Method VxRect::GetHalfSize

Vx2DVector VxRect::GetHalfSize() const


VxRect::GetHCenter

Method VxRect::GetHCenter

float VxRect::GetHCenter() const

Returns the horizontal center of the rect.


VxRect::GetHeight

Method VxRect::GetHeight

float VxRect::GetHeight() const

Returns the height of a rectangle.


VxRect::GetSize

Method VxRect::GetSize

Vx2DVector VxRect::GetSize() const

Returns the size of a rectangle.


VxRect::GetTopLeft

Method VxRect::GetTopLeft

const Vx2DVector& VxRect::GetTopLeft() const
Vx2DVector& VxRect::GetTopLeft()


VxRect::GetVCenter

Method VxRect::GetVCenter

float VxRect::GetVCenter() const

Returns the vertical center of the rect.


VxRect::GetWidth

Method VxRect::GetWidth

float VxRect::GetWidth() const

Returns the width of a rectangle.


VxRect::Inflate

Method VxRect::Inflate

void VxRect::Inflate(const Vx2DVector& pt)

Inflates a rectangle by an offset.

See Also

VxRect::Scale


VxRect::Interpolate

Method VxRect::Interpolate

void VxRect::Interpolate(float value, const VxRect& a)

Interpolates a rectangle with another one.

See Also

VxRect::Scale


VxRect::Merge

Method VxRect::Merge

void VxRect::Merge(const VxRect& a)

Merge a rectangle with another one.

See Also

VxRect::Scale


VxRect::Move

Method VxRect::Move

void VxRect::Move(const Vx2DVector& pos)
void VxRect::HMove(float h)
void VxRect::VMove(float v)

Move a rectangle to a position.

Parameters

Input argument pos

new position of the rectangle in Vx2DVector.

See Also

VxRect::Translate


VxRect::Scale

Method VxRect::Scale

void VxRect::Scale(const Vx2DVector& s)

Scales a rectangle by a factor.

Parameters

t: translation vector in Vx2DVector.

See Also

VxRect::Inflate


VxRect::SetBottomRight

Method VxRect::SetBottomRight

void VxRect::SetBottomRight(const Vx2DVector& v)


VxRect::SetCenter

Method VxRect::SetCenter

void VxRect::SetCenter(const Vx2DVector& v)
void VxRect::SetCenter(const Vx2DVector& center,const Vx2DVector& halfsize)
void VxRect::SetCenter(float cx,float cy,float hw,float hh)

Creates a rectangle based on the center position and the half size.

Parameters

Input argument halfsize | a Vx2DVector containing half size.
Input argument cx | horizontal center position in float.
Input argument cy | vertical center position in float.
Input argument hw | half width in float. hy: half height in float.

See Also

VxRect::SetCorners,VxRect::SetDimension


VxRect::SetDimension

Method VxRect::SetDimension

void VxRect::SetDimension(const Vx2DVector& position,const Vx2DVector& size)
void VxRect::SetDimension(float x,float y,float w,float h)

Creates a rectangle based on the top left coner and the size.

Parameters

Input argument position | a Vx2DVector containing the top left corner.
Input argument size | a Vx2DVector containing the size.
Input argument x | left position in float.
Input argument y | height in float.
Input argument w | width in float.

See Also

VxRect::SetCorners,VxRect::SetCenter


VxRect::SetHalfSize

Method VxRect::SetHalfSize

void VxRect::SetHalfSize(const Vx2DVector& v)


VxRect::SetHeight

Method VxRect::SetHeight

void VxRect::SetHeight(float h)

Changes the height of a rectangle.

Parameters

Input argument h

new height in float.


VxRect::SetSize

Method VxRect::SetSize

void VxRect::SetSize(const Vx2DVector& v)

Changes the size of a rectangle.

Parameters

Input argument v

new size in the form of a Vx2DVector.


VxRect::SetTopLeft

Method VxRect::SetTopLeft

void VxRect::SetTopLeft(const Vx2DVector& v)


VxRect::SetWidth

Method VxRect::SetWidth

void VxRect::SetWidth(float w)

Changes the width of a rectangle.

Parameters

Input argument w

new width in float.


VxRect::TransformFromHomogeneous

Method VxRect::TransformFromHomogeneous

void VxRect::TransformFromHomogeneous(Vx2DVector& dest,const Vx2DVector& srchom) const
void VxRect::TransformFromHomogeneous(const VxRect& screen)

Transform a point in homogeneous coordinates into a points in screen coordinates (the rect representing the screen).

Parameters

Input argument dest | vector destination (in screen coordinates).
Input argument srchom | src vector (in homogeneous coordinates).
Input argument screen | Vx2DVector screen size.

See Also

VxRect::Transform


VxRect::TransformToHomogeneous

Method VxRect::TransformToHomogeneous

void VxRect::TransformToHomogeneous(const VxRect& screen)

Transforms a screen coordinate rectangle to an homogeneous rectangle.

Parameters

Input argument screen

Vx2DVector screen size.

See Also

VxRect::Transform


VxRect::Translate

Method VxRect::Translate

void VxRect::Translate(const Vx2DVector& t)
void VxRect::HTranslate(float h)
void VxRect::VTranslate(float v)

Translate a rectangle of an offset.

Parameters

Input argument t

translation vector in Vx2DVector.

See Also

VxRect::Move


VxRect::Clip

Method VxRect::Clip

BOOL VxRect::Clip(const VxRect& cliprect)
void VxRect::Clip(Vx2DVector& pt,BOOL excluderightbottom = TRUE) const

Clips a rectangle over a clipping rectangle.

Parameters

Input argument cliprect | clipping rectangle.
Input argument pt | point to clip
Input argument excluderightbottom | should the bottom and right line be considered as valid values for the point.

Returns

TRUE if the rectangle is visible (partially clipped or not), FALSE otherwise.

See Also

VxRect::IsOutside,VxRect::IsInside


VxRect::Normalize

Method VxRect::Normalize

void VxRect::Normalize()

Checks that the rectangle is valid. If not, turns it right.

Remarks

Use this function when you create a rectangle with two corners without being sure that you provided the top left and top right corners, if this order.

See Also

VxRect::SetCorners,VxRect::SetDimension


VxRect::SetCorners

Method VxRect::SetCorners

void VxRect::SetCorners(const Vx2DVector& topleft,const Vx2DVector& bottomright)
void VxRect::SetCorners(float l,float t,float r,float b)

Creates a rectangle based on two corners.

Parameters

Input argument topleft | a Vx2DVector containing the top left corner.
Input argument bottomright | a Vx2DVector containing the bottom right corner.
Input argument l | left in float.
Input argument t | top in float.
Input argument r | right in float.
Input argument b | bottom in float.

See Also

VxRect::SetDimension,VxRect::SetCenter


VxRect::IsInside

Method VxRect::IsInside

int VxRect::IsInside(const VxRect& cliprect) const
BOOL VxRect::IsInside(const Vx2DVector& pt) const

Tests a rectangle over a clipping rectangle.

Parameters

Input argument cliprect | clipping rectangle.
Input argument pt | Vx2DVector to test.

Returns

Value | Meaning
ALLOUTSIDE | if the two rectangles are distinct.
PARTINSIDE | if the two rectangles are crossing.
ALLINSIDE | if the tested rectangle is inside the clipping rectangle.

See Also

VxRect::IsOutside


VxRect::IsNull

Method VxRect::IsNull

BOOL VxRect::IsNull() const

Tests a rectangle for validity.

Returns

TRUE if the rectangle is NULL, FALSE otherwise.

See Also

VxRect::IsOutside, VxRect::Clear


VxRect::IsOutside

Method VxRect::IsOutside

BOOL VxRect::IsOutside(const VxRect& cliprect) const

Tests a rectangle over a clipping rectangle.

Parameters

Input argument cliprect

clipping rectangle.

Returns

TRUE if the rectangle is outside the clipping one, FALSE otherwise.

See Also

VxRect::IsInside


VxRect::Transform

Method VxRect::Transform

void VxRect::Transform(const VxRect& destScreen,const VxRect& srcScreen)
void
VxRect::Transform(const Vx2DVector& destScreenSize,const Vx2DVector& srcScreenSize)

Transforms a rectangle from a screen referentiel to another.

Parameters

destscreen: destination referential screen defined by a rectangle. srcscreen: source referential screen defined by a rectangle. destscreen: destination referential screen size. srcscreen: source referential screen size.

See Also

VxRect::TransformToHomogeneous


VxSphere

Class VxSphere

Remarks

A 3D Sphere defined by a center and a radius.

Groups

Constructors
Method VxSphere | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method Center | Accessors
Method IsBoxTotallyInside |
Method IsPointInside |
Method IsPointOnSurface |
Method Radius |
Comparison Operators
Method operator== | Description: Equality Operator


VxSphere::VxSphere

Method VxSphere::VxSphere

VxSphere::VxSphere()
VxSphere::VxSphere(const VxVector& iCenter, const float iRadius)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxSphere::Center

Method VxSphere::Center

VxVector& VxSphere::Center()
const VxVector& VxSphere::Center() const

Remarks

Accessors


VxSphere::IsBoxTotallyInside

Method VxSphere::IsBoxTotallyInside

bool
VxSphere::IsBoxTotallyInside(const VxBbox& iBox)


VxSphere::IsPointInside

Method VxSphere::IsPointInside

bool
VxSphere::IsPointInside(const VxVector& iPoint)


VxSphere::IsPointOnSurface

Method VxSphere::IsPointOnSurface

bool
VxSphere::IsPointOnSurface(const VxVector& iPoint)


VxSphere::Radius

Method VxSphere::Radius

float& VxSphere::Radius()
const float& VxSphere::Radius() const


VxSphere::operator==

Method VxSphere::operator==

bool VxSphere::operator== (const VxSphere& iSphere) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


VxStridedData

Class VxStridedData

Structure for storage of strided data.

VxStridedDataBase
Show brief derivation trees

VxStridedData

XPtrStrided

VxStridedDataBase
Show full derivation trees

VxStridedData

Subclasses

XPtrStrided

Groups

Constructors
Method VxStridedData

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxStridedData::VxStridedData

Method VxStridedData::VxStridedData

VxStridedData::VxStridedData()
VxStridedData::VxStridedData(void* iPtr,unsigned int iStride)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxStridedDataBase

Class VxStridedDataBase

Structure for storage of strided data.

Subclasses

VxStridedData

Groups

Data Members
Member Variable Stride |
Coercion Operators
Method cast operator | Description: Converts to another type. This converts the current object to a particular type.


VxStridedDataBase::Stride

Member Variable VxStridedDataBase::Stride

unsigned int VxStridedDataBase::Stride


VxStridedDataBase::cast operator

Method VxStridedDataBase::cast operator

VxStridedDataBase::operator const VxStridedData& () const

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XAbs

External Function XAbs

template <class T>
T XAbs(T a)

Returns the absolute value of a.


XAP

Class XAP

auto_ptr like class.

Remarks

XAP objects will allow you to keep a reference on pointers, without having to delete them explicitely. The pointers will be deleted by the XP object when leaving the its scope. This class use a delete [] operator, so to handle pointers allocated with new , use XP.

Groups

Constructors | Assignment | Operators | Operations | Coercion Operators | Destructors

Constructors
Method XAP | Copy the pointer and release it the burden from the source XAP.
Assignment
Method operator= | Copy the pointer and release it the burden from the source XAP.
Operators
Method operator* | Direct access to the pointer.
Operations
Method Release | Release the pointer from sure deletion.
Method Set | Sets a new pointer to be handled, deleting the previously handled one.
Coercion Operators
Method cast operator | Original pointer cast.
Destructors
Method ~XAP | Releases the pointed object.

See Also

XP


XAP::XAP

Method XAP::XAP

explicit XAP::XAP(T* p = NULL)
XAP::XAP(XAP<T>& a)

Copy the pointer and release it the burden from the source XAP.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XAP::operator=

Method XAP::operator=

XAP<T>& XAP::operator= (XAP<T>& a)

Copy the pointer and release it the burden from the source XAP.

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


XAP::operator*

Method XAP::operator*

T& XAP::operator* () const

Direct access to the pointer.

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


XAP::Release

Method XAP::Release

T* XAP::Release()

Release the pointer from sure deletion.


XAP::Set

Method XAP::Set

void XAP::Set(T* p = 0)

Sets a new pointer to be handled, deleting the previously handled one.


XAP::cast operator

Method XAP::cast operator

XAP::operator T* () const

Original pointer cast.

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XAP::~XAP

Method XAP::~XAP

XAP::~XAP()

Releases the pointed object.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XFabs

External Function XFabs

inline float XFabs(float a)

Returns the absolute value of a float.


XMax

External Function XMax

template <class T>
const T& XMax(const T& a,const T& b)
inline int XMax(const int a,const int b)
inline
float XMax(const float a,const float b)
template <class T>
const T& XMax(const T& a,const T& b,const T& c)

Returns the maximum of two values.

Remarks

Returns maximum between a,b and c.

See Also

XMax

Generated by the DocJet Source Code Documentation System version 6.1.3 Thursday, February 26, 2009


XMin

External Function XMin

template <class T>
const T& XMin(const T& a,const T& b)
inline int XMin(const int a,const int b)
inline float XMin(const float a,const float b)
template <class T>
const T& XMin(const T& a,const T& b,const T& c)

Returns the minimum of two values.

Remarks

Returns minimum between a,b and c.

See Also

XMax


XMinMax

External Function XMinMax

template <class T>
void XMinMax(const T& a,const T& b, T& min, T& max)
template <class T>
void XMinMax(const T& a,const T& b,const T& c, T& min, T& max)
template <class T>
void XMinMax(const T& a,const T& b,const T& c, T& min, T& med, T& max)

Finds the minimum and maximum of 2 values.

Remarks

Returns minimum and maximum between a,b and c.

See Also

XMin,XMax


XP

Class XP

auto_ptr like class.

Remarks

XP objects will allow you to keep a reference on pointers, without having to delete them explicitely. The pointers will be deleted by the XP object when leaving the its scope. This class use a delete operator, so to handle pointers allocated with new [], use XAP.

Groups

Constructors | Assignment | Operators | Operations | Coercion Operators | Destructors

Constructors
Method XP | Copy the pointer and release it the burden from the source XP.
Assignment
Method operator= | Copy the pointer and release it the burden from the source XP.
Operators
Method operator* | Direct access to the pointer.
Method operator-> | Direct access to the pointer.
Operations
Method Release | Release the pointer from sure deletion.
Method Set | Sets a new pointer to be handled, deleting the previously handled one.
Coercion Operators
Method cast operator | Original pointer cast.
Destructors
Method ~XP | Releases the pointed object.

See Also

XAP


XP::XP

Method XP::XP

explicit XP::XP(T* p)
XP::XP(XP<T>& a)

Copy the pointer and release it the burden from the source XP.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XP::operator=

Method XP::operator=

XP<T>& XP::operator= (XP<T>& a)

Copy the pointer and release it the burden from the source XP.

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


XP::operator*

Method XP::operator*

T& XP::operator* () const

Direct access to the pointer.

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


XP::operator->

Method XP::operator->

T* XP::operator-> () const

Direct access to the pointer.

Returns

The object pointed to this object when it is being dereferenced for the purposes of finding a component of the pointed-to object.

Remarks

Description: Dereference Operator


XP::Release

Method XP::Release

T* XP::Release()

Release the pointer from sure deletion.


XP::Set

Method XP::Set

void XP::Set(T* p = 0)

Sets a new pointer to be handled, deleting the previously handled one.


XP::cast operator

Method XP::cast operator

XP::operator T* () const

Original pointer cast.

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XP::~XP

Method XP::~XP

XP::~XP()

Releases the pointed object.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XPtrStrided

Class XPtrStrided

Strided pointers iterator class.

VxStridedDataBase

VxStridedData
Show brief derivation trees

XPtrStrided

VxStridedDataBase

VxStridedData
Show full derivation trees

XPtrStrided

Groups

Constructors | Assignment | Operators | Operations | Coercion Operators

Constructors
Method XPtrStrided | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Assignment
Method operator+= | Description: Plus-Equals Operator This sets the current object to the sum of the original value of this object and the value on the right.
Method operator= | Description: Assignment Operator This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.
Operators
Method operator* | Dereferencing operators.
Method operator+ | Go to the n next element.
Method operator++ | Go to the next element.
Method operator-> | Description: Dereference Operator
Method operator[] | Description: Indexing Operator
Operations
Method Set |
Coercion Operators
Method cast operator | Cast to the relevant type of pointer.

See Also

XP


XPtrStrided::XPtrStrided

Method XPtrStrided::XPtrStrided

XPtrStrided::XPtrStrided()
XPtrStrided::XPtrStrided(void* Ptr, unsigned int Stride)
template <class U>
XPtrStrided::XPtrStrided(const XPtrStrided<U>& copy)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XPtrStrided::operator+=

Method XPtrStrided::operator+=

XPtrStrided& XPtrStrided::operator+=(int n)

Returns

A reference to the current object.

Remarks

Description: Plus-Equals Operator

This sets the current object to the sum of the original value of this object and the value on the right.


XPtrStrided::operator=

Method XPtrStrided::operator=

template <class U>
XPtrStrided& XPtrStrided::operator= (const XPtrStrided<U>& copy)

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


XPtrStrided::operator*

Method XPtrStrided::operator*

T& XPtrStrided::operator* ()
const T& XPtrStrided::operator* () const

Dereferencing operators.

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


XPtrStrided::operator+

Method XPtrStrided::operator+

XPtrStrided XPtrStrided::operator+(int n)

Go to the n next element.

Returns

The current object added with the value of the object on the right-hand-side of the operator.

Remarks

Description: Addition Operator


XPtrStrided::operator++

Method XPtrStrided::operator++

XPtrStrided& XPtrStrided::operator++()
XPtrStrided XPtrStrided::operator++(int)

Go to the next element.

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XPtrStrided::operator->

Method XPtrStrided::operator->

T* XPtrStrided::operator-> ()

Returns

The object pointed to this object when it is being dereferenced for the purposes of finding a component of the pointed-to object.

Remarks

Description: Dereference Operator


XPtrStrided::operator[]

Method XPtrStrided::operator[]

const T& XPtrStrided::operator[] (unsigned short iCount) const
T& XPtrStrided::operator[] (unsigned short iCount)
const T& XPtrStrided::operator[] (int iCount) const
T& XPtrStrided::operator[] (int iCount)
const T& XPtrStrided::operator[] (unsigned int iCount) const
T& XPtrStrided::operator[] (unsigned int iCount)

Returns

The value that this object associates with the value of the object that is the parameter to this operator.

Remarks

Description: Indexing Operator


XPtrStrided::Set

Method XPtrStrided::Set

void XPtrStrided::Set(void* iPtr, unsigned int iStride)


XPtrStrided::cast operator

Method XPtrStrided::cast operator

XPtrStrided::operator T* ()

Cast to the relevant type of pointer.

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XRefCount

Class XRefCount

a reference counting class. You must derive from this class to use smart pointers.

Groups

Data Members
Member Variable m_RefCount | Reference counter
Constructors
Method XRefCount | copy cons must NOT copy XRefs/pinfo!!
Assignment
Method operator= | operator= must NOT copy XRefs/pinfo!!
Destructors
Method ~XRefCount | Destructor which release pinfo if necessary.

See Also

XP,XSmartPtr


XRefCount::m_RefCount

Member Variable XRefCount::m_RefCount

mutable unsigned int XRefCount::m_RefCount

Remarks

Reference counter


XRefCount::XRefCount

Method XRefCount::XRefCount

XRefCount::XRefCount()
XRefCount::XRefCount(const XRefCount &)

Remarks

copy cons must NOT copy XRefs/pinfo!!


XRefCount::operator=

Method XRefCount::operator=

XRefCount &XRefCount::operator=(const XRefCount &)

Returns

A reference to the current object.

Remarks

operator= must NOT copy XRefs/pinfo!!


XRefCount::~XRefCount

Method XRefCount::~XRefCount

XRefCount::~XRefCount()

Remarks

Destructor which release pinfo if necessary.


XSmartPtr

Class XSmartPtr

Smart pointer class.

Groups

Constructors | Assignment | Operators | Coercion Operators | Destructors

Constructors
Method XSmartPtr | Copy the pointer and release it the burden from the source XP.
Assignment
Method operator= | Copy the pointer and release it the burden from the source XP.
Operators
Method operator* | Direct access to the pointer.
Method operator-> | Direct access to the pointer.
Coercion Operators
Method cast operator | Original pointer cast.
Destructors
Method ~XSmartPtr | Releases the pointed object.

See Also

XP,XRefCount


XSmartPtr::XSmartPtr

Method XSmartPtr::XSmartPtr

XSmartPtr::XSmartPtr()
explicit XSmartPtr::XSmartPtr(T* p)
XSmartPtr::XSmartPtr(const XSmartPtr& a)

Copy the pointer and release it the burden from the source XP.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XSmartPtr::operator=

Method XSmartPtr::operator=

XSmartPtr<T>& XSmartPtr::operator= (const XSmartPtr& a)
XSmartPtr<T>& XSmartPtr::operator= (T* p)

Copy the pointer and release it the burden from the source XP.

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


XSmartPtr::operator*

Method XSmartPtr::operator*

T& XSmartPtr::operator* () const

Direct access to the pointer.

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


XSmartPtr::operator->

Method XSmartPtr::operator->

T* XSmartPtr::operator-> () const

Direct access to the pointer.

Returns

The object pointed to this object when it is being dereferenced for the purposes of finding a component of the pointed-to object.

Remarks

Description: Dereference Operator


XSmartPtr::cast operator

Method XSmartPtr::cast operator

XSmartPtr::operator T* () const

Original pointer cast.

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XSmartPtr::~XSmartPtr

Method XSmartPtr::~XSmartPtr

XSmartPtr::~XSmartPtr()

Releases the pointed object.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XSqrt

External Function XSqrt

inline float XSqrt(float a)

Returns the square root value of a float.


XSwap

External Function XSwap

template <class T>
void XSwap(T& a,T& b)

Swaps two elements.

Remarks

Swaps a and b.


XThreshold

External Function XThreshold

template <class T>
void XThreshold(T& t,const T& min,const T& max)

Forces a value in an interval.

Parameters

Input argument t | value to threshold
Input argument min | minimum valid value
Input argument max | maximum valid value

See Also

XMin,XMax


Containers

Class XArray | Class representation of an array.
Class XBaseString | Wrapper around a C string (a char* or const char*).
Class XBinaryTree | Not Yet Documented
Class XBinaryTreeIt | Not Yet Documented
Class XBinaryTreeNode | Not Yet Documented
Class XBitArray | Set of bit flags.
Class XBTree | Not Yet Documented
Class XClassArray | Class representation of an array.
Class XList | Doubly linked list.
Class XListIt | Iterator on an XList.
Class XNTree | Class representation of a N tree.
Class XPriorityQueue | Class representation of a priority queue. Template Parameters: T : type of object to store into the queue PF : priority function, which is use to tell the priority (an int) of a T object.
Class XString | Class representation of a string (an array of character ended by a '\0').
Strings |
Hash Tables |

See Also

VxMath Reference


XArray

Class XArray

Class representation of an array.

Subclasses

XObjectArray, and XObjectPointerArray

Remarks

The array has a notion of reserved size, which doubles each time it is reached. The reserved size reduces only if the occupation of the array goes below 30% of the reserved size. You mustn't store classes of variable size into an XArray. Use XClassArray for this.

Groups

Constructors | Assignment | Operators | Operations | Type Definitions | Destructors

Constructors
Method XArray | Constructors.
Assignment
Method operator+= | Appends the content of another array.
Method operator-= | Removes the elements of the given array from the array.
Method operator= | Affectation operator.
Operators
Method operator[] | Access to an array element.
Operations
Method Allocated | Returns the elements allocated.
Method At | Access to an array element.
Method Attach |
Method Back | Returns the last element of an array.
Method Begin | Returns an iterator on the first element.
Method BinaryFind | Dichotomic search : finds an element in an array that is sorted in increasing order.
Method BubbleSort | Sorts an array with a bubble sort.
Method Clear | Removes all the elements from an array.
Method Compact | Ensures than the reserved size equals the real size..
Method Compress | Compress an array of e elements.
Method Detach |
Method End | Returns an iterator after the last element.
Method Erase |
Method EraseAt |
Method Expand | Expands an array of e elements.
Method FastRemove |
Method FastRemoveAt |
Method Fill | Fills an array with a value.
Method Find | Finds an element.
Method Front | Returns the first element of an array.
Method GetMemoryOccupation | Returns the occupied size in memory in bytes
Method GetPosition | Returns the position of an element.
Method Insert | Inserts an element before another one.
Method InsertSorted | dicchotomic sorted insertion (use the < operator)
Method IsEmpty | Returns whether the array is empty (it is faster to use IsEmpty than Size when testing for array size...)
Method IsHere | Tests for an element presence.
Method Memset | Fills an array with a BYTE value.
Method Move | Moves the element n before the element i.
Method PopBack | Removes the last element of an array.
Method PopFront | Removes the first element of an array.
Method PushBack | Inserts an element at the end of an array.
Method PushFront | Inserts an element at the start of an array.
Method RBegin | Returns an iterator on the last element.
Method Remove | Removes an element.
Method RemoveAt | Removes an element at a given position.
Method REnd | Returns an iterator before the first element.
Method Reserve | Reserves n elements for an array.
Method Resize | Resizes the array.
Method Size | Returns the elements number.
Method Sort | Sorts an array with a quick sort.
Method Swap | Swaps two items in array.
Type Definitions
Type Definition Array |
Type Definition Iterator | Types
Type Definition Reference |
Type Definition Type |
Destructors
Method ~XArray | Destructor.

See Also

XClassArray, XSArray


XArray::XArray

Method XArray::XArray

XArray::XArray(int ss=0)
XArray::XArray(const Array& a)

Constructors.

Parameters

Input argument ss | Default number of reserved elements.
Input argument a | An array to copy from.

Remarks

copy Ctor template<int A>


XArray::operator+=

Method XArray::operator+=

Array& XArray::operator+= (const Array& a)

Appends the content of another array.

Returns

A reference to the current object.

Remarks

The content of the array is conserved.

template<int A>


XArray::operator-=

Method XArray::operator-=

Array& XArray::operator-= (const Array& a)

Removes the elements of the given array from the array.

Returns

A reference to the current object.

Remarks

The content of the array is conserved.

template<int A>


XArray::operator=

Method XArray::operator=

Array& XArray::operator= (const Array& a)

Affectation operator.

Returns

A reference to the current object.

Remarks

The content of the array is enterely overwritten by the given array.

template<int A>


XArray::operator[]

Method XArray::operator[]

const T& XArray::operator[](int i) const
T& XArray::operator[](int i)

Access to an array element.

Parameters

i

index of the element to access.

Returns

a reference on the object accessed.

Remarks

No test are provided on i.


XArray::Allocated

Method XArray::Allocated

int XArray::Allocated() const

Returns the elements allocated.


XArray::At

Method XArray::At

T* XArray::At(unsigned int i)
const T* XArray::At(unsigned int i) const

Access to an array element.

Parameters

i

index of the element to access.

Returns

a pointer on the object accessed.

Remarks

End() is returned if i is outside the array limits.


XArray::Attach

Method XArray::Attach

void XArray::Attach(T* iArray,int iCount)


XArray::Back

Method XArray::Back

T& XArray::Back()
const T& XArray::Back() const

Returns the last element of an array.

Remarks

No test are provided to see if there is an element.


XArray::Begin

Method XArray::Begin

T* XArray::Begin() const

Returns an iterator on the first element.

Example

       Typically, an algorithm iterating on an array
   looks like:

           for(T* t = a.Begin(); t != a.End(); ++t) {
do something with *t
           }


XArray::BinaryFind

Method XArray::BinaryFind

T* XArray::BinaryFind(const T& o) const

Dichotomic search : finds an element in an array that is sorted in increasing order.

Parameters

Input argument o

element to find.

Returns

a pointer on the first object found or End() if the object is not found.


XArray::BubbleSort

Method XArray::BubbleSort

void XArray::BubbleSort(T* rangestart, T* rangeend,VxSortFunc compare = XCompare)
void XArray::BubbleSort(VxSortFunc compare = XCompare)

Sorts an array with a bubble sort.

Parameters

Input argument compare

The function comparing two elements.

Remarks

Two sorts algorithm are available : BubbleSort and (quick)sort.


XArray::Clear

Method XArray::Clear

void XArray::Clear()

Removes all the elements from an array.

Remarks

There is no more space reserved after this call.


XArray::Compact

Method XArray::Compact

void XArray::Compact()

Ensures than the reserved size equals the real size..


XArray::Compress

Method XArray::Compress

void XArray::Compress(int e = 1)

Compress an array of e elements.

Parameters

Input argument e

size to compress.


XArray::Detach

Method XArray::Detach

void XArray::Detach()


XArray::End

Method XArray::End

T* XArray::End() const

Returns an iterator after the last element.


XArray::Erase

Method XArray::Erase

BOOL XArray::Erase(const T& o)


XArray::EraseAt

Method XArray::EraseAt

BOOL XArray::EraseAt(int pos)


XArray::Expand

Method XArray::Expand

void XArray::Expand(int e = 1)

Expands an array of e elements.

Parameters

Input argument e

size to expand.


XArray::FastRemove

Method XArray::FastRemove

void XArray::FastRemove(const T& o)
void XArray::FastRemove(const Iterator& iT)


XArray::FastRemoveAt

Method XArray::FastRemoveAt

void XArray::FastRemoveAt(int pos)


XArray::Fill

Method XArray::Fill

void XArray::Fill(const T& o)

Fills an array with a value.

Parameters

Input argument o

value to fill.


XArray::Find

Method XArray::Find

T* XArray::Find(const T& o) const

Finds an element.

Parameters

Input argument o

element to find.

Returns

a pointer on the first object found or End() if the object is not found.


XArray::Front

Method XArray::Front

T& XArray::Front()
const T& XArray::Front() const

Returns the first element of an array.

Remarks

No test are provided to see if there is an element.


XArray::GetMemoryOccupation

Method XArray::GetMemoryOccupation

int XArray::GetMemoryOccupation(XBOOL addstatic=FALSE) const

Returns the occupied size in memory in bytes

Parameters

addstatic

TRUE if you want to add the size occupied by the class itself.


XArray::GetPosition

Method XArray::GetPosition

int XArray::GetPosition(const T& o) const

Returns the position of an element.

Parameters

Input argument o

element to find.

Returns

position or -1 if not found.


XArray::Insert

Method XArray::Insert

void XArray::Insert(T* i, const T& o)
void XArray::Insert(int pos, const T& o)

Inserts an element before another one.

Parameters

Input argument i | iterator on the element to insert before.
Input argument pos | position to insert the object
o | object to insert.

Remarks

The element to insert before is given as an iterator on it, i.e. a pointer on it in this case.


XArray::InsertSorted

Method XArray::InsertSorted

void XArray::InsertSorted(const T& o)

Remarks

dicchotomic sorted insertion (use the < operator)


XArray::IsEmpty

Method XArray::IsEmpty

bool XArray::IsEmpty() const

Returns whether the array is empty (it is faster to use IsEmpty than Size when testing for array size...)


XArray::IsHere

Method XArray::IsHere

XBOOL XArray::IsHere(const T& o) const

Tests for an element presence.

Parameters

Input argument o

element to test.

Returns

TRUE if the element is present.


XArray::Memset

Method XArray::Memset

void XArray::Memset(XBYTE val)

Fills an array with a BYTE value.

Parameters

Input argument val

byte value to fill.


XArray::Move

Method XArray::Move

void XArray::Move(T* i, T* n)

Moves the element n before the element i.

Parameters

Input argument i | iterator on the element to insert before.
Input argument n | iterator on the element to move.

Remarks

The elements are given by iterators on them, i.e. pointer on them in this case.


XArray::PopBack

Method XArray::PopBack

T XArray::PopBack()

Removes the last element of an array.

Returns

object removed.

Remarks

You must be sure that the array isn't empty.


XArray::PopFront

Method XArray::PopFront

void XArray::PopFront()

Removes the first element of an array.


XArray::PushBack

Method XArray::PushBack

void XArray::PushBack(const T& o)

Inserts an element at the end of an array.

Parameters

Input argument o

object to insert.


XArray::PushFront

Method XArray::PushFront

void XArray::PushFront(const T& o)

Inserts an element at the start of an array.

Parameters

Input argument o

object to insert.

Remarks

This function can be slow if your array is well filled.


XArray::RBegin

Method XArray::RBegin

T* XArray::RBegin() const

Returns an iterator on the last element.


XArray::Remove

Method XArray::Remove

T* XArray::Remove(T* i)
T* XArray::Remove(const T& o)

Removes an element.

Parameters

Input argument i | iterator on the element to remove.
Input argument o | object to remove.

Returns

An iterator on the next element after the element removed (to go on with an iteration).

Remarks

The elements are given by iterators on them, i.e. pointer on them in this case.


XArray::RemoveAt

Method XArray::RemoveAt

XBOOL XArray::RemoveAt(unsigned int pos,T& old)
T* XArray::RemoveAt(int pos)

Removes an element at a given position.

Parameters

Input argument old | value of the element removed.
pos | position of the object to remove.

Returns

an iterator on the next element after the element removed (to go on with an iteration).


XArray::REnd

Method XArray::REnd

T* XArray::REnd() const

Returns an iterator before the first element.


XArray::Reserve

Method XArray::Reserve

void XArray::Reserve(int size)

Reserves n elements for an array.

Remarks

The elements beyond the reserved limit are discarded.


XArray::Resize

Method XArray::Resize

void XArray::Resize(int size)

Resizes the array.

Parameters

Input argument size

New size of the array.

Remarks

After Resize(n) (n>0), you can address elements from [0] to [n-1]. No constructors are called (use an XClassArray if it is desired). If the size is greater than the reserved size, the array is reallocated at the exact needed size. If not, there is no reallocation at all. Resize(0) is faster than Clear() if you know you will probably push some more elements after.

See Also

Reserve


XArray::Size

Method XArray::Size

int XArray::Size() const

Returns the elements number.


XArray::Sort

Method XArray::Sort

void XArray::Sort(VxSortFunc compare = XCompare)

Sorts an array with a quick sort.

Parameters

Input argument compare

The function comparing two elements.

Remarks

Two sorts algorithm are available : BubbleSort and (quick)Sort.


XArray::Swap

Method XArray::Swap

void XArray::Swap(int pos1,int pos2)
void XArray::Swap(Array& a)

Swaps two items in array.

Parameters

Input argument pos1 | position of first item to swap
Input argument pos2 | position of second item to swap.


XArray::Array

Type Definition XArray::Array

typedef XArray<T,Alignment> XArray::Array


XArray::Iterator

Type Definition XArray::Iterator

typedef T* XArray::Iterator

Remarks

Types


XArray::Reference

Type Definition XArray::Reference

typedef T& XArray::Reference


XArray::Type

Type Definition XArray::Type

typedef T XArray::Type


XArray::~XArray

Method XArray::~XArray

XArray::~XArray()

Destructor.

Remarks

Release the elements contained in the array. If you were storing pointers, you need first to iterate on the array and call delete on each pointer.


XBaseString

Class XBaseString

Wrapper around a C string (a char* or const char*).

Subclasses

XString

Remarks

  • This class does not duplicate the data it is given and does not delete the string it points to when destroyed.

  • It calculates and store the length, for further faster access.

Groups

Constructors
Method XBaseString | Constructors.
Operators
Method operator[] | access to a character (read only)
Operations
Method CStr | Conversion to a const char* (read only).
Method Length | Returns the length of the string.
Method ToDouble | Conversion to a double.
Method ToFloat | Conversion to a float.
Method ToInt | Conversion to a int.
Destructors
Method ~XBaseString | Dtor

See Also

XBaseString.


XBaseString::XBaseString

Method XBaseString::XBaseString

XBaseString::XBaseString()
XBaseString::XBaseString(const char* iString)

Constructors.

Parameters

Input argument iString

the string to hold.

Remarks

Ctor from a const string litteral Warning : the size is calculated here


XBaseString::operator[]

Method XBaseString::operator[]

const char XBaseString::operator[](XDWORD i) const
const char XBaseString::operator[](int i) const

access to a character (read only)

Parameters

i

index of the character to read.

Returns

The value that this object associates with the value of the object that is the parameter to this operator.

Remarks

Description: Indexing Operator


XBaseString::CStr

Method XBaseString::CStr

const char* XBaseString::CStr() const

Conversion to a const char* (read only).


XBaseString::Length

Method XBaseString::Length

XDWORD XBaseString::Length() const

Returns the length of the string.


XBaseString::ToDouble

Method XBaseString::ToDouble

double XBaseString::ToDouble() const

Conversion to a double.


XBaseString::ToFloat

Method XBaseString::ToFloat

float XBaseString::ToFloat() const

Conversion to a float.


XBaseString::ToInt

Method XBaseString::ToInt

int XBaseString::ToInt() const

Conversion to a int.


XBaseString::~XBaseString

Method XBaseString::~XBaseString

XBaseString::~XBaseString()

Remarks

Dtor


XBinaryTree

Class XBinaryTree

Not Yet Documented

Groups

Constructors
Method XBinaryTree | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method BackIterate | Postfixed iteration
Method Begin |
Method Clear |
Method End |
Method Find | Search an element in the tree
Method FindPtr | Search an element in the tree
Method GetMemoryOccupation |
Method GetSmallest | Get The Smallest element
Method Insert | Insert an element in the tree (return 0 if it was already there)
Method Iterate | Infixed iteration
Method Prefixe | Prefixed iteration
Method Remove | Insert an element in the tree (return 0 if it was already there)
Static Object Method XCompare |
Destructors
Method ~XBinaryTree | Description: Destroys the object This destroys all the subordinate objects for this object.


XBinaryTree::XBinaryTree

Method XBinaryTree::XBinaryTree

XBinaryTree::XBinaryTree()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XBinaryTree::BackIterate

Method XBinaryTree::BackIterate

void XBinaryTree::BackIterate(void(*f)(const T&,void *),void* arg = NULL) const

Remarks

Postfixed iteration


XBinaryTree::Begin

Method XBinaryTree::Begin

tIterator XBinaryTree::Begin() const


XBinaryTree::Clear

Method XBinaryTree::Clear

void XBinaryTree::Clear()


XBinaryTree::End

Method XBinaryTree::End

tIterator XBinaryTree::End() const


XBinaryTree::Find

Method XBinaryTree::Find

int XBinaryTree::Find(const T& o,VxSortFunc compare = XCompare) const

Remarks

Search an element in the tree


XBinaryTree::FindPtr

Method XBinaryTree::FindPtr

T* XBinaryTree::FindPtr(const T& o,VxSortFunc compare = XCompare) const

Remarks

Search an element in the tree


XBinaryTree::GetMemoryOccupation

Method XBinaryTree::GetMemoryOccupation

int XBinaryTree::GetMemoryOccupation() const


XBinaryTree::GetSmallest

Method XBinaryTree::GetSmallest

T XBinaryTree::GetSmallest() const

Remarks

Get The Smallest element


XBinaryTree::Insert

Method XBinaryTree::Insert

int XBinaryTree::Insert(const T& o,VxSortFunc compare = XCompare)

Remarks

Insert an element in the tree (return 0 if it was already there)


XBinaryTree::Iterate

Method XBinaryTree::Iterate

void XBinaryTree::Iterate(void(*f)(const T&,void *),void* arg = NULL) const

Remarks

Infixed iteration


XBinaryTree::Prefixe

Method XBinaryTree::Prefixe

void XBinaryTree::Prefixe(void(*f)(const T&,void *),void* arg = NULL) const

Remarks

Prefixed iteration


XBinaryTree::Remove

Method XBinaryTree::Remove

int XBinaryTree::Remove(const T& o,VxSortFunc compare = XCompare)

Remarks

Insert an element in the tree (return 0 if it was already there)


XBinaryTree::XCompare

Static Object Method XBinaryTree::XCompare

static
int XBinaryTree::XCompare(const void *elem1, const void *elem2 )


XBinaryTree::~XBinaryTree

Method XBinaryTree::~XBinaryTree

XBinaryTree::~XBinaryTree()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XBinaryTreeIt

Class XBinaryTreeIt

Not Yet Documented

Groups

Data Members | Constructors | Operators | Comparison Operators | Destructors

Data Members
Member Variable m_Node | Current Node
Member Variable m_Tree | The Binary Tree
Constructors
Method XBinaryTreeIt | Ctors
Operators
Method operator* | Description: Dereference Operator
Method operator++ | Description: Prefix Increment Operator This increments the current object.
Comparison Operators
Method operator!= | Description: Not-Equals Operator
Method operator== | Operators
Destructors
Method ~XBinaryTreeIt | Dtor


XBinaryTreeIt::m_Node

Member Variable XBinaryTreeIt::m_Node

tNode* XBinaryTreeIt::m_Node

Remarks

Current Node


XBinaryTreeIt::m_Tree

Member Variable XBinaryTreeIt::m_Tree

tTree XBinaryTreeIt::m_Tree

Remarks

The Binary Tree


XBinaryTreeIt::XBinaryTreeIt

Method XBinaryTreeIt::XBinaryTreeIt

XBinaryTreeIt::XBinaryTreeIt(const tNode* n, const tTree tree)
XBinaryTreeIt::XBinaryTreeIt(tNode* n=NULL)

Remarks

Ctors


XBinaryTreeIt::operator*

Method XBinaryTreeIt::operator*

const T& XBinaryTreeIt::operator*()

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


XBinaryTreeIt::operator++

Method XBinaryTreeIt::operator++

tIterator& XBinaryTreeIt::operator++()
tIterator XBinaryTreeIt::operator++(int)

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XBinaryTreeIt::operator!=

Method XBinaryTreeIt::operator!=

int XBinaryTreeIt::operator!=(const tIterator& it) const

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XBinaryTreeIt::operator==

Method XBinaryTreeIt::operator==

int XBinaryTreeIt::operator==(const tIterator& it) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Operators


XBinaryTreeIt::~XBinaryTreeIt

Method XBinaryTreeIt::~XBinaryTreeIt

XBinaryTreeIt::~XBinaryTreeIt()

Remarks

Dtor


XBinaryTreeNode

Class XBinaryTreeNode

Not Yet Documented

Groups

Data Members
Member Variable m_Data | Data
Member Variable m_Left | Children
Member Variable m_Right |
Constructors
Method XBinaryTreeNode | Ctors
Destructors
Method ~XBinaryTreeNode | Dtor


XBinaryTreeNode::m_Data

Member Variable XBinaryTreeNode::m_Data

T XBinaryTreeNode::m_Data

Remarks

Data


XBinaryTreeNode::m_Left

Member Variable XBinaryTreeNode::m_Left

XBinaryTreeNode* XBinaryTreeNode::m_Left

Remarks

Children


XBinaryTreeNode::m_Right

Member Variable XBinaryTreeNode::m_Right

XBinaryTreeNode* XBinaryTreeNode::m_Right


XBinaryTreeNode::XBinaryTreeNode

Method XBinaryTreeNode::XBinaryTreeNode

XBinaryTreeNode::XBinaryTreeNode()
XBinaryTreeNode::XBinaryTreeNode( const T & E )
XBinaryTreeNode::XBinaryTreeNode( const T & E,XBinaryTreeNode* L, XBinaryTreeNode* R )

Remarks

Ctors


XBinaryTreeNode::~XBinaryTreeNode

Method XBinaryTreeNode::~XBinaryTreeNode

XBinaryTreeNode::~XBinaryTreeNode()

Remarks

Dtor


XBitArray

Class XBitArray

Set of bit flags.

Remarks

  • This class define a set of bit flags that may be treated as a virtual array but are stored in an efficient manner.

  • The class has methods to set, clear and return the i-th bit, resize the array, etc.

Groups

Constructors | Assignment | Operators | Operations | Destructors

Constructors
Method XBitArray | copy Ctor
Assignment
Method operator-= | subtract bits from another bitarray
Method operator= | operator
Operators
Method operator[] | Returns if the n-th bit is set to 1
Operations
Method And | Performs a binary AND with another array
Method AppendBits | Appends the bitcount first bits of integer v to the array
Method BitSet | Returns the number of bits set
Method CheckCommon | Returns TRUE if at least one common bit is set in two arrays
Method Clear | Resets the array
Method Fill | Sets all bits of the array to 1 Warning : this functions sets all the allocated bits, not only the used bits
Method GetMemoryOccupation | Returns the occupied size in memory in bytes
Method GetSetBitPosition | Returns the position of the n-th set(1) bit
Method GetUnsetBitPosition | Returns the position of the n-th unset(0) bit
Method Invert | Inverts all bits value in the array
Method IsSet | Returns if the n-th bit is set to 1
Method Or | Performs a binary OR with another array
Method Set | Sets the n-th bit to 1
Method Size | Returns the number of bits
Method TestSet | Sets the n-th bit to 1 and return 0 if it was set, 1 otherwise
Method TestUnset | Sets the n-th bit to 0 and return 1 if it was set, 0 otherwise
Method Unset | Sets the n-th bit to 0
Method XOr | Performs a binary XOR with another array
Destructors
Method ~XBitArray | Description: Destroys the object This destroys all the subordinate objects for this object.


XBitArray::XBitArray

Method XBitArray::XBitArray

XBitArray::XBitArray(int initialsize = 1)
XBitArray::XBitArray(const XBitArray& a)

Remarks

copy Ctor


XBitArray::operator-=

Method XBitArray::operator-=

XBitArray& XBitArray::operator-= (XBitArray& a)

subtract bits from another bitarray

Returns

A reference to the current object.

Remarks

Description: Minus-Equals Operator

This sets the current object to the difference between the original value of this object and the value on the right.


XBitArray::operator=

Method XBitArray::operator=

XBitArray& XBitArray::operator= (const XBitArray& a)

Returns

A reference to the current object.

Remarks

operator


XBitArray::operator[]

Method XBitArray::operator[]

int XBitArray::operator[] (int n)

Returns if the n-th bit is set to 1

Returns

The value that this object associates with the value of the object that is the parameter to this operator.

Remarks

Description: Indexing Operator


XBitArray::And

Method XBitArray::And

void XBitArray::And(XBitArray& a)

Performs a binary AND with another array


XBitArray::AppendBits

Method XBitArray::AppendBits

void XBitArray::AppendBits(int n,int v,int bitcount)

Appends the bitcount first bits of integer v to the array


XBitArray::BitSet

Method XBitArray::BitSet

int XBitArray::BitSet()

Returns the number of bits set


XBitArray::CheckCommon

Method XBitArray::CheckCommon

BOOL XBitArray::CheckCommon(XBitArray& a)

Returns TRUE if at least one common bit is set in two arrays


XBitArray::Clear

Method XBitArray::Clear

void XBitArray::Clear()

Resets the array


XBitArray::Fill

Method XBitArray::Fill

void XBitArray::Fill()

Sets all bits of the array to 1 Warning : this functions sets all the allocated bits, not only the used bits


XBitArray::GetMemoryOccupation

Method XBitArray::GetMemoryOccupation

int XBitArray::GetMemoryOccupation(BOOL addstatic=FALSE) const

Returns the occupied size in memory in bytes


XBitArray::GetSetBitPosition

Method XBitArray::GetSetBitPosition

int XBitArray::GetSetBitPosition(int n)

Returns the position of the n-th set(1) bit


XBitArray::GetUnsetBitPosition

Method XBitArray::GetUnsetBitPosition

int XBitArray::GetUnsetBitPosition(int n)

Returns the position of the n-th unset(0) bit


XBitArray::Invert

Method XBitArray::Invert

void XBitArray::Invert()

Inverts all bits value in the array


XBitArray::IsSet

Method XBitArray::IsSet

int XBitArray::IsSet(int n)

Returns if the n-th bit is set to 1


XBitArray::Or

Method XBitArray::Or

void XBitArray::Or(XBitArray& a)

Performs a binary OR with another array


XBitArray::Set

Method XBitArray::Set

void XBitArray::Set(int n)

Sets the n-th bit to 1


XBitArray::Size

Method XBitArray::Size

int XBitArray::Size() const

Returns the number of bits


XBitArray::TestSet

Method XBitArray::TestSet

int XBitArray::TestSet(int n)

Sets the n-th bit to 1 and return 0 if it was set, 1 otherwise


XBitArray::TestUnset

Method XBitArray::TestUnset

int XBitArray::TestUnset(int n)

Sets the n-th bit to 0 and return 1 if it was set, 0 otherwise


XBitArray::Unset

Method XBitArray::Unset

void XBitArray::Unset(int n)

Sets the n-th bit to 0


XBitArray::XOr

Method XBitArray::XOr

void XBitArray::XOr(XBitArray& a)

Performs a binary XOR with another array


XBitArray::~XBitArray

Method XBitArray::~XBitArray

XBitArray::~XBitArray()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XBTree

Class XBTree

Not Yet Documented

Groups

Constructors | Assignment | Operations | Classes | Type Definitions | Destructors

Constructors
Method XBTree | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Assignment
Method operator= | Description: Assignment Operator This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.
Operations
Method Begin | Returns a const iterator on the first element.
Method Clear |
Method End | Returns a const iterator after the last element.
Method Erase |
Method Find |
Method Insert |
Method PushBack |
Method RBegin | Returns a const iterator on the first element for a reverse iteration.
Method REnd | Returns a const iterator after the last element for a reverse iteration.
Method Size | Returns the elements number.
Method Swap |
Classes
Class ConstIterator | Const iterator
Class Iterator | Non-Const Iterator
Type Definitions
Type Definition ConstReference |
Type Definition Pointer |
Type Definition Reference |
Type Definition Type |
Destructors
Method ~XBTree | Description: Destroys the object This destroys all the subordinate objects for this object.


XBTree::XBTree

Method XBTree::XBTree

explicit XBTree::XBTree(const TCmpFunc& iCmp = TCmpFunc())
XBTree::XBTree(const XBTree& iModel)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XBTree::operator=

Method XBTree::operator=

const XBTree& XBTree::operator= (const XBTree& iModel)

Returns

A reference to the current object.

Remarks

Description: Assignment Operator

This sets this object (on the left-hand-side of the operator) to the value given on the right of the operator.


XBTree::Begin

Method XBTree::Begin

Iterator XBTree::Begin()
ConstIterator XBTree::Begin() const

Returns a const iterator on the first element.


XBTree::Clear

Method XBTree::Clear

void XBTree::Clear()


XBTree::End

Method XBTree::End

Iterator XBTree::End()
ConstIterator XBTree::End() const

Returns a const iterator after the last element.


XBTree::Erase

Method XBTree::Erase

Iterator XBTree::Erase(Iterator iT)
Iterator XBTree::Erase(Iterator iFirst, Iterator iLast)


XBTree::Find

Method XBTree::Find

Iterator XBTree::Find(ConstReference iValue)
ConstIterator XBTree::Find(ConstReference iValue) const


XBTree::Insert

Method XBTree::Insert

Iterator XBTree::Insert(Iterator iT, ConstReference iValue)
Iterator XBTree::Insert(ConstReference iValue)


XBTree::PushBack

Method XBTree::PushBack

Iterator XBTree::PushBack(ConstReference iValue)


XBTree::RBegin

Method XBTree::RBegin

Iterator XBTree::RBegin()
ConstIterator XBTree::RBegin() const

Returns a const iterator on the first element for a reverse iteration.


XBTree::REnd

Method XBTree::REnd

Iterator XBTree::REnd()
ConstIterator XBTree::REnd() const

Returns a const iterator after the last element for a reverse iteration.


XBTree::Size

Method XBTree::Size

unsigned int XBTree::Size() const

Returns the elements number.


XBTree::Swap

Method XBTree::Swap

void XBTree::Swap(XBTree& iTree)


XBTree::ConstIterator

Class XBTree::ConstIterator

Subclasses

Iterator

Remarks

Const iterator

Groups

Constructors
Method ConstIterator | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operators
Method operator* | Description: Dereference Operator
Method operator++ | Description: Prefix Increment Operator This increments the current object.
Method operator-- | Description: Prefix Decrement Operator This decrements the current object.
Method operator-> | Description: Dereference Operator
Comparison Operators
Method operator!= | Description: Not-Equals Operator
Method operator== | Description: Equality Operator


XBTree::ConstIterator::ConstIterator

Method XBTree::ConstIterator::ConstIterator

XBTree::ConstIterator::ConstIterator()
XBTree::ConstIterator::ConstIterator ( Node* iP)
XBTree::ConstIterator::ConstIterator(const Iterator& iCopy)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XBTree::ConstIterator::operator*

Method XBTree::ConstIterator::operator*

ConstReference XBTree::ConstIterator::operator*() const

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


XBTree::ConstIterator::operator++

Method XBTree::ConstIterator::operator++

ConstIterator& XBTree::ConstIterator::operator++()
ConstIterator XBTree::ConstIterator::operator++(int)

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XBTree::ConstIterator::operator--

Method XBTree::ConstIterator::operator--

ConstIterator& XBTree::ConstIterator::operator--()
ConstIterator XBTree::ConstIterator::operator--(int)

Returns

A reference to the current object.

Remarks

Description: Prefix Decrement Operator

This decrements the current object.


XBTree::ConstIterator::operator->

Method XBTree::ConstIterator::operator->

Type* XBTree::ConstIterator::operator->() const

Returns

The object pointed to this object when it is being dereferenced for the purposes of finding a component of the pointed-to object.

Remarks

Description: Dereference Operator


XBTree::ConstIterator::operator!=

Method XBTree::ConstIterator::operator!=

bool XBTree::ConstIterator::operator!=(const ConstIterator& iX) const

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XBTree::ConstIterator::operator==

Method XBTree::ConstIterator::operator==

bool XBTree::ConstIterator::operator==(const ConstIterator& iX) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XBTree::Iterator

Class XBTree::Iterator

ConstIterator
Show brief derivation trees

XBTree::Iterator

ConstIterator
Show full derivation trees

XBTree::Iterator

Remarks

Non-Const Iterator

Groups

Constructors
Method Iterator | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operators
Method operator* | Description: Dereference Operator
Method operator++ | Description: Prefix Increment Operator This increments the current object.
Method operator-- | Description: Prefix Decrement Operator This decrements the current object.
Method operator-> | Description: Dereference Operator
Comparison Operators
Method operator!= | Description: Not-Equals Operator
Method operator== | Description: Equality Operator


XBTree::Iterator::Iterator

Method XBTree::Iterator::Iterator

XBTree::Iterator::Iterator()
XBTree::Iterator::Iterator(Node* iNode)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XBTree::Iterator::operator*

Method XBTree::Iterator::operator*

Reference XBTree::Iterator::operator*() const

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


XBTree::Iterator::operator++

Method XBTree::Iterator::operator++

Iterator& XBTree::Iterator::operator++()
Iterator XBTree::Iterator::operator++(int)

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XBTree::Iterator::operator--

Method XBTree::Iterator::operator--

Iterator& XBTree::Iterator::operator--()
Iterator XBTree::Iterator::operator--(int)

Returns

A reference to the current object.

Remarks

Description: Prefix Decrement Operator

This decrements the current object.


XBTree::Iterator::operator!=

Method XBTree::Iterator::operator!=

bool XBTree::Iterator::operator!=(const Iterator& iA) const

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XBTree::Iterator::operator==

Method XBTree::Iterator::operator==

bool XBTree::Iterator::operator==(const Iterator& iA) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XBTree::ConstReference

Type Definition XBTree::ConstReference

typedef const T& XBTree::ConstReference


XBTree::Pointer

Type Definition XBTree::Pointer

typedef T* XBTree::Pointer


XBTree::Reference

Type Definition XBTree::Reference

typedef T& XBTree::Reference


XBTree::Type

Type Definition XBTree::Type

typedef T XBTree::Type


XBTree::~XBTree

Method XBTree::~XBTree

XBTree::~XBTree()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XClassArray

Class XClassArray

Class representation of an array.

Remarks

This array is designed to hold structure or class which have something specific to do on the construction, deletion or recopy, like allocating/destroying pointers.

Groups

Constructors | Assignment | Operators | Operations | Type Definitions | Destructors

Constructors
Method XClassArray | Constructors.
Assignment
Method operator= | Affectation operator.
Operators
Method operator[] | Access to an array element.
Operations
Method Allocated | Returns the elements allocated.
Method At | Access to an array element.
Method Back | Returns the last element of an array.
Method Begin | Returns an iterator on the first element.
Method Clear | Removes all the elements from an array.
Method End | Returns an iterator after the last element.
Method Expand | Expands an array of e elements.
Method FastRemove |
Method Find | Finds an element.
Method GetMemoryOccupation | Returns the occupied size in memory in bytes
Method GetPosition | Returns the position of an element.
Method Insert | Inserts an element before another one.
Method PopBack | Removes the last element of an array.
Method PopFront | Removes the first element of an array.
Method PushBack | Inserts an element at the end of an array.
Method PushFront | Inserts an element at the start of an array.
Method Remove | Removes an element.
Method Reserve | Reserves n elements for an array.
Method Resize | Resizes th elements numbers of an array.
Method Size | Returns the elements number.
Method Sort | Sorts an array with a quick sort.
Method Swap | Swaps two items in array.
Type Definitions
Type Definition Iterator |
Destructors
Method ~XClassArray | Destructor.

See Also

XArray, XSArray


XClassArray::XClassArray

Method XClassArray::XClassArray

XClassArray::XClassArray(int ss=0)
XClassArray::XClassArray(const XClassArray<T>& a)

Constructors.

Parameters

Input argument ss | Default number of reserved elements.
Input argument a | An array to copy from.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XClassArray::operator=

Method XClassArray::operator=

XClassArray<T>& XClassArray::operator= (const XClassArray<T>& a)

Affectation operator.

Returns

A reference to the current object.

Remarks

The content of the array is enterely overwritten by the given array.


XClassArray::operator[]

Method XClassArray::operator[]

T& XClassArray::operator[](int i) const

Access to an array element.

Parameters

Input argument i

index of the element to access.

Returns

a reference on the object accessed.

Remarks

No test are provided on i.


XClassArray::Allocated

Method XClassArray::Allocated

int XClassArray::Allocated() const

Returns the elements allocated.


XClassArray::At

Method XClassArray::At

T* XClassArray::At(unsigned int i) const

Access to an array element.

Parameters

Input argument i

index of the element to access.

Returns

a pointer on the object accessed.

Remarks

End() is returned if i is outside the array limits.


XClassArray::Back

Method XClassArray::Back

T& XClassArray::Back()
const T& XClassArray::Back() const

Returns the last element of an array.

Remarks

No test are provided to see if there is an element.


XClassArray::Begin

Method XClassArray::Begin

T* XClassArray::Begin() const

Returns an iterator on the first element.

Example

       Typically, an algorithm iterating on an array
   looks like:

       for(T* t = a.Begin(); t != a.End(); ++t) {
do something with *t
       }


XClassArray::Clear

Method XClassArray::Clear

void XClassArray::Clear()

Removes all the elements from an array.

Remarks

There is no more space reserved after this call.


XClassArray::End

Method XClassArray::End

T* XClassArray::End() const

Returns an iterator after the last element.


XClassArray::Expand

Method XClassArray::Expand

void XClassArray::Expand(int e = 1)

Expands an array of e elements.

Parameters

Input argument e

size to expand.


XClassArray::FastRemove

Method XClassArray::FastRemove

void XClassArray::FastRemove(const T& o)
void XClassArray::FastRemove(const Iterator& iT)


XClassArray::Find

Method XClassArray::Find

T* XClassArray::Find(const T& o) const

Finds an element.

Parameters

Input argument o

element to find.

Returns

a pointer on the first object found or End() if the object is not found.


XClassArray::GetMemoryOccupation

Method XClassArray::GetMemoryOccupation

int XClassArray::GetMemoryOccupation(XBOOL addstatic=FALSE) const

Returns the occupied size in memory in bytes

Parameters

addstatic

TRUE if you want to add the size occupied by the class itself.


XClassArray::GetPosition

Method XClassArray::GetPosition

int XClassArray::GetPosition(const T& o) const

Returns the position of an element.

Parameters

Input argument o

element to find.

Returns

position or -1 if not found.


XClassArray::Insert

Method XClassArray::Insert

void XClassArray::Insert(T* i, const T& o)
void XClassArray::Insert(int pos, const T& o)

Inserts an element before another one.

Parameters

Input argument i | iterator on the element to insert before.
Input argument pos | position to insert the object
o | object to insert.

Remarks

The element to insert before is given as an iterator on it, i.e. a pointer on it in this case.


XClassArray::PopBack

Method XClassArray::PopBack

void XClassArray::PopBack()

Removes the last element of an array.


XClassArray::PopFront

Method XClassArray::PopFront

void XClassArray::PopFront()

Removes the first element of an array.


XClassArray::PushBack

Method XClassArray::PushBack

void XClassArray::PushBack(const T& o)

Inserts an element at the end of an array.

Parameters

Input argument o

object to insert.


XClassArray::PushFront

Method XClassArray::PushFront

void XClassArray::PushFront(const T& o)

Inserts an element at the start of an array.

Parameters

Input argument o

object to insert.


XClassArray::Remove

Method XClassArray::Remove

T* XClassArray::Remove(T* i)
T* XClassArray::RemoveAt(int pos)

Removes an element.

Parameters

Input argument i

iterator on the element to remove. pos: position of the object to remove.

Returns

an iterator on the next element after the element removed (to go on with an iteration).

Remarks

The elements are given by iterators on them, i.e. pointer on them in this case.


XClassArray::Reserve

Method XClassArray::Reserve

void XClassArray::Reserve(int size)

Reserves n elements for an array.

Remarks

The elements beyond the reserved limit are discarded.


XClassArray::Resize

Method XClassArray::Resize

void XClassArray::Resize(int size)

Resizes th elements numbers of an array.

Remarks

If the size is greater than the reserved size, the array is reallocated at the exact needed size. If not, there is no reallocation at all. Resize(0) is faster than Clear() if you know you will probably push some more elements after.


XClassArray::Size

Method XClassArray::Size

int XClassArray::Size() const

Returns the elements number.


XClassArray::Sort

Method XClassArray::Sort

void XClassArray::Sort( VxSortFunc Fct = XCompare)

Sorts an array with a quick sort.

Parameters

compare: The function comparing two elements.

Remarks

Two sorts algorithm are available : BubbleSort and (quick)Sort.


XClassArray::Swap

Method XClassArray::Swap

void XClassArray::Swap(int pos1,int pos2)
void XClassArray::Swap(XClassArray<T>& a)

Swaps two items in array.

Parameters

Input argument pos1 | position of first item to swap
Input argument pos2 | position of second item to swap.


XClassArray::Iterator

Type Definition XClassArray::Iterator

typedef T* XClassArray::Iterator


XClassArray::~XClassArray

Method XClassArray::~XClassArray

XClassArray::~XClassArray()

Destructor.

Remarks

Release the elements contained in the array. If you were storing pointers, you need first to iterate on the array and call delete on each pointer.


XList

Class XList

Doubly linked list.

Remarks

You can only create a list of elements which can be constructed from nothing (default constructor with no argument) and the element should also possess an operator=.

Groups

Constructors | Assignment | Operations | Type Definitions | Destructors

Constructors
Method XList | Constructors.
Assignment
Method operator= | Affectation operator.
Operations
Method Back | Returns a reference on the last element of an array.
Method Begin | Returns an iterator on the first element.
Method Clear | Removes all the elements of a list.
Method End | Returns an iterator after the last element.
Method Find | Finds an element.
Method Front | Returns a reference on the first element of an array.
Method Insert | Inserts an element before another one.
Method IsHere | Test the presence of an element.
Method PopBack | Removes an element at the end of a list.
Method PopFront | Removes an element at the beginning of a list.
Method PushBack | Inserts an element at the end of a list.
Method PushFront | Inserts an element at the start of a list.
Method Remove | Removes an element.
Method Size | Returns the elements number.
Method Swap | Swaps two lists.
Type Definitions
Type Definition Iterator |
Destructors
Method ~XList | Destructor.


XList::XList

Method XList::XList

XList::XList()
XList::XList(const XList<T>& list)

Constructors.

Parameters

Input argument list

list to recopy in the new one.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XList::operator=

Method XList::operator=

XList& XList::operator= (const XList<T>& list)

Affectation operator.

Returns

A reference to the current object.

Remarks

The content of the list is enterely overwritten by the given one.


XList::Back

Method XList::Back

T XList::Back() const
T& XList::Back()

Returns a reference on the last element of an array.

Remarks

No test are provided to see if there is an element.


XList::Begin

Method XList::Begin

XListIt<T> XList::Begin() const

Returns an iterator on the first element.


XList::Clear

Method XList::Clear

void XList::Clear()

Removes all the elements of a list.


XList::End

Method XList::End

XListIt<T> XList::End() const

Returns an iterator after the last element.


XList::Find

Method XList::Find

XListIt<T> XList::Find(const T& o) const
XListIt<T> XList::Find(const XListIt<T>& start,const T& o) const

Finds an element.

Parameters

Input argument start | iterator from which begin the search. Return Valuen : An iterator on the object found, End() if the object wasn't found.
o | object to find.


XList::Front

Method XList::Front

T XList::Front () const
T& XList::Front()

Returns a reference on the first element of an array.

Remarks

No test are provided to see if there is an element.


XList::Insert

Method XList::Insert

void XList::Insert(XListIt<T>& i,const T& o)

Inserts an element before another one.

Parameters

Input argument i | iterator on the element to insert before.
Input argument o | object to insert.


XList::IsHere

Method XList::IsHere

BOOL XList::IsHere(const T& o) const

Test the presence of an element.

Parameters

Input argument o

object to test.

Returns

TRUE if the object was found, otherwise FALSE.


XList::PopBack

Method XList::PopBack

void XList::PopBack()

Removes an element at the end of a list.


XList::PopFront

Method XList::PopFront

void XList::PopFront()

Removes an element at the beginning of a list.


XList::PushBack

Method XList::PushBack

void XList::PushBack(const T& o)

Inserts an element at the end of a list.

Parameters

Input argument o

object to insert.


XList::PushFront

Method XList::PushFront

void XList::PushFront(const T& o)

Inserts an element at the start of a list.

Parameters

Input argument o

object to insert.


XList::Remove

Method XList::Remove

BOOL XList::Remove(const T& o)
XListIt<T> XList::Remove(XListIt<T>& i)

Removes an element.

Parameters

Input argument o | object to remove.
Input argument i | iterator on the object to remove.

Returns

an iterator on the element following the removed one.


XList::Size

Method XList::Size

int XList::Size() const

Returns the elements number.


XList::Swap

Method XList::Swap

void XList::Swap(XList<T>& a)

Swaps two lists.

Parameters

o: second list to swap with.


XList::Iterator

Type Definition XList::Iterator

typedef XListIt<T> XList::Iterator


XList::~XList

Method XList::~XList

XList::~XList()

Destructor.

Remarks

Release the elements contained in the array. If you were storing pointers, you need first to iterate on the list and call delete on each pointer.


XListIt

Class XListIt

Iterator on an XList.

Groups

Constructors
Method XListIt | Ctor
Operators
Method operator* | Returns a reference on the current element.
Method operator+ | Description: Addition Operator
Method operator++ | Go to the next element.
Method operator- | Description: Subtraction Operator
Method operator-- | Go to the previous element.
Comparison Operators
Method operator!= | Description: Not-Equals Operator
Method operator== | Operators

Example

Usage for itering on a list :
    for (XListIt<T> it = list.Begin(); it != list.End(); ++it) {
 Do whatever you want with *it, a reference on a T
    }


XListIt::XListIt

Method XListIt::XListIt

XListIt::XListIt()
XListIt::XListIt(XNode<T>* n)
XListIt::XListIt(const XListIt<T>& n)

Remarks

Ctor


XListIt::operator*

Method XListIt::operator*

T& XListIt::operator*() const

Returns a reference on the current element.

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


XListIt::operator+

Method XListIt::operator+

XListIt<T> XListIt::operator+ (int iOffset) const

Returns

The current object added with the value of the object on the right-hand-side of the operator.

Remarks

Description: Addition Operator


XListIt::operator++

Method XListIt::operator++

XListIt<T>& XListIt::operator++()
XListIt<T> XListIt::operator++(int)

Go to the next element.

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XListIt::operator-

Method XListIt::operator-

XListIt<T> XListIt::operator- (int iOffset) const

Returns

The result of subtracting the value of the object on the right from this object.

Remarks

Description: Subtraction Operator


XListIt::operator--

Method XListIt::operator--

XListIt<T>& XListIt::operator--()
XListIt<T> XListIt::operator--(int)

Go to the previous element.

Returns

A reference to the current object.

Remarks

Description: Prefix Decrement Operator

This decrements the current object.


XListIt::operator!=

Method XListIt::operator!=

int XListIt::operator!=(const XListIt<T>& it) const

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XListIt::operator==

Method XListIt::operator==

int XListIt::operator==(const XListIt<T>& it) const

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Operators


XNTree

Class XNTree

Class representation of a N tree.

Remarks

The tree can contains different types on its internal nodes and on its leaf. The typename N represent the internal node type, and the typename L the leaf type.

Groups

Operations
Method Clear | Clear the entire tree
Method DeleteSubTree |
Method ExtractNode | Extract a node from the tree
Method FindDirectLeaf | Find a Leaf in the chilren of iRoot
Method FindDirectNode | Find a Node in the children of iRoot
Method FindLeaf | Find a Leaf in the substree defined by iRoot
Method FindNode | Find a Node in the substree defined by iRoot
Method GetRoots | Return the i th root
Method GetRootsCount | Return the roots count
Method InsertLeaf | Insert a leaf into the tree
Method InsertNode | Insert an internal Node into a tree
Method MoveNode | Insert a leaf into the tree
Method Traverse |
Classes
Class INode | Generic Struct of a Node
Class Leaf |
Class Node |
Destructors
Method ~XNTree | Dtor

Example

class MyTrav
{
public:
    void TraverseNode(const int& a)
    {
        if (a == 4)
            int b = 0;
    }

    void TraverseLeaf(const float& a)
    {
        if (a == 4.0f)
            int b = 0;
    }
} myTrav;

void foo()
{
    XNTree<int,float> tree;
    XNTree<int,float>::INode* node = tree.InsertNode(NULL,4);
    tree.InsertLeaf(node,4.0f);
    tree.InsertLeaf(node,5.0f);
    tree.InsertLeaf(node,6.0f);

    tree.Traverse(NULL,myTrav);

    XNTree<int,float>::Leaf* lnode = tree.FindLeaf(NULL,6.0f);
    XNTree<int,float>::INode* inode = tree.FindNode(NULL,4);
}

See Also

XBinaryTree


XNTree::Clear

Method XNTree::Clear

void XNTree::Clear()

Remarks

Clear the entire tree


XNTree::DeleteSubTree

Method XNTree::DeleteSubTree

void XNTree::DeleteSubTree(Node* iRoot)


XNTree::ExtractNode

Method XNTree::ExtractNode

void XNTree::ExtractNode(Node* iNode)

Remarks

Extract a node from the tree


XNTree::FindDirectLeaf

Method XNTree::FindDirectLeaf

Leaf* XNTree::FindDirectLeaf(Node* iRoot, const L& iData) const

Remarks

Find a Leaf in the chilren of iRoot


XNTree::FindDirectNode

Method XNTree::FindDirectNode

INode* XNTree::FindDirectNode(Node* iRoot, const N& iData) const

Remarks

Find a Node in the children of iRoot


XNTree::FindLeaf

Method XNTree::FindLeaf

Leaf* XNTree::FindLeaf(Node* iRoot, const L& iData) const

Remarks

Find a Leaf in the substree defined by iRoot


XNTree::FindNode

Method XNTree::FindNode

INode* XNTree::FindNode(Node* iRoot, const N& iData) const

Remarks

Find a Node in the substree defined by iRoot


XNTree::GetRoots

Method XNTree::GetRoots

Node* XNTree::GetRoots(const int i) const

Remarks

Return the i th root


XNTree::GetRootsCount

Method XNTree::GetRootsCount

int XNTree::GetRootsCount() const

Remarks

Return the roots count


XNTree::InsertLeaf

Method XNTree::InsertLeaf

Leaf* XNTree::InsertLeaf(INode* iRoot, const L& iData)

Remarks

Insert a leaf into the tree


XNTree::InsertNode

Method XNTree::InsertNode

INode* XNTree::InsertNode(INode* iRoot, const N& iData)

Remarks

Insert an internal Node into a tree


XNTree::MoveNode

Method XNTree::MoveNode

void XNTree::MoveNode(Node* iNode, INode* iRoot)

Remarks

Insert a leaf into the tree


XNTree::Traverse

Method XNTree::Traverse

template <class Trav>
void XNTree::Traverse(Node* iRoot, Trav& iTraversal) const


XNTree::INode

Class XNTree::INode

Node
Show brief derivation trees

XNTree::INode

Node
Show full derivation trees

XNTree::INode

Remarks

Generic Struct of a Node

Groups

Operations
Method GetChildren
Method GetChildrenCount
Method GetData
Method GetParent
Method IsLeaf


XNTree::INode::GetChildren

Method XNTree::INode::GetChildren

Node*
XNTree::INode::GetChildren(int i) const


XNTree::INode::GetChildrenCount

Method XNTree::INode::GetChildrenCount

int
XNTree::INode::GetChildrenCount() const


XNTree::INode::GetData

Method XNTree::INode::GetData

N& XNTree::INode::GetData()


XNTree::Leaf

Class XNTree::Leaf

Node
Show brief derivation trees

XNTree::Leaf

Node
Show full derivation trees

XNTree::Leaf

Groups

Constructors
Method Leaf | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method GetData |
Method GetParent |
Method IsLeaf |


XNTree::Leaf::Leaf

Method XNTree::Leaf::Leaf

XNTree::Leaf::Leaf()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XNTree::Leaf::GetData

Method XNTree::Leaf::GetData

L& XNTree::Leaf::GetData()


XNTree::Node

Class XNTree::Node

Subclasses

INode, and Leaf

Groups

Constructors
Method Node | Ctor
Operations
Method GetParent |
Method IsLeaf |
Type Definitions
Enumerated Type Type | node type enumeration


XNTree::Node::Node

Method XNTree::Node::Node

XNTree::Node::Node(Type iType)

Remarks

Ctor


XNTree::Node::GetParent

Method XNTree::Node::GetParent

INode*
XNTree::Node::GetParent() const


XNTree::Node::IsLeaf

Method XNTree::Node::IsLeaf

bool
XNTree::Node::IsLeaf() const


XNTree::Node::Type

Enumerated Type XNTree::Node::Type

enum Type
{
NODE,
LEAF
}

Members

LEAF
NODE

Remarks

node type enumeration


XNTree::~XNTree

Method XNTree::~XNTree

XNTree::~XNTree()

Remarks

Dtor


XPriorityQueue

Class XPriorityQueue

Class representation of a priority queue.

Template Parameters: T : type of object to store into the queue PF : priority function, which is use to tell the priority (an int) of a T object.

Remarks

This container is used to fastly pop an object, sorted by a criterion, called here the priority of the object. Insertion and Pop are in O(log(n)) and the objects are stored flat, in an array, avoiding many small allocations. You can not store objects with ctor and dtor in it because they won't be called.

Groups

Constructors
Method XPriorityQueue | Constructors.
Operations
Method Clear | Removes all the elements from the queue.
Method GetMemoryOccupation | Returns the occupied size in memory in bytes
Method Insert |
Method Peek | Peeks the higher priority element of the queue.
Method Pop | Removes the higher priority element of the queue.

See Also

XArray, XList


XPriorityQueue::XPriorityQueue

Method XPriorityQueue::XPriorityQueue

XPriorityQueue::XPriorityQueue(int iBaseNumber = 0)

Constructors.

Parameters

Input argument iBaseNumber

Default number of reserved elements.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XPriorityQueue::Clear

Method XPriorityQueue::Clear

void XPriorityQueue::Clear()

Removes all the elements from the queue.

Remarks

The memory allocated is not freed by this call.


XPriorityQueue::GetMemoryOccupation

Method XPriorityQueue::GetMemoryOccupation

int XPriorityQueue::GetMemoryOccupation(XBOOL iAddStatic = FALSE) const

Returns the occupied size in memory in bytes

Parameters

addstatic: TRUE if you want to add the size occupied by the class itself.


XPriorityQueue::Insert

Method XPriorityQueue::Insert

void XPriorityQueue::Insert(const T& iT)


XPriorityQueue::Peek

Method XPriorityQueue::Peek

XBOOL
XPriorityQueue::Peek(T* oT) const

Peeks the higher priority element of the queue.

Parameters

Input argument oT

pointer to the T object that will be filled with the higher priority element. The pointer need to be valid.

Returns

TRUE if an object is popped.


XPriorityQueue::Pop

Method XPriorityQueue::Pop

XBOOL
XPriorityQueue::Pop(T* oT)

Removes the higher priority element of the queue.

Parameters

Input argument oT

pointer to the T object that will be filled with the higher priority element. The pointer need to be valid.

Returns

TRUE if an object is popped.


XString

XBaseString
Show full derivation trees

XString

Remarks

This class always duplicate the data it is given.

Groups

Constructors | Assignment | Operators | Operations | Comparison Operators | Destructors

Constructors
Method XString | Reserving constructor.
Assignment
Method operator= | Affectation operator.
Operators
Method operator+ | Description: Addition Operator
Method operator- | Description: Subtraction Operator
Method operator<< | Appends something to the string.
Method operator[] | access to a character (read/write)
Operations
Method Capacity | Returns the capacity (the allocated size) of the string.
Method CheckFileNameValidity | replaces all the occurrence of characters :*?"<>| into ' ' These characters are not valid in filenames
Method Compare | Compare two strings.
Method Contains | finds a string in the string
Method Create | Creates a string from a section of a string
Method CreateTail | Creates a string from the last section of a string
Method Crop | Crops the string.
Method CStr | Conversion to a const char* (read only).
Method Cut | Cuts the string.
Method Find | Look for the first occurence of a character in the string, given a starting position.
Method Format | Format the string sprintf style
Method FormatTime | Format a string using the current time.
Method ICompare | Compare two strings ignoring the case.
Method IContains | finds a string in the string (ignore the case).
Method IFind | finds a string in the string (ignore the case).
Method Length | Returns the length of the string.
Method NCompare | Compare the n first character of two strings.
Method Replace | replaces all the occurence of a character by another one.
Method Reserve | Sets the capacity of the string.
Method Resize |
Method RFind | Look for the last occurence of a character in the string.
Method Str | Conversion to a const char*.
Method Strip | Replaces space ( ' ', '\t' and '\n') sequences by one space.
Method Substring | Build a substring of the current string.
Method ToDouble | Conversion to a double.
Method ToFloat | Conversion to a float.
Method ToInt | Conversion to a int.
Method ToLower | Converts a string to lowercase.
Method ToUpper | Converts a string to uppercase.
Method Trim | Removes space ( ' ', '\t' and '\n') from the start and the end of the string.
Comparison Operators
Method operator!= | Description: Not-Equals Operator
Method operator< | Description: Less-Than Operator
Method operator<= | Description: Less-Than-Or-Equal Operator
Method operator== | Operators for strings comparisons.
Method operator> | Description: Greater-Than Operator
Method operator>= | Description: Greater-Than-Or-Equal-To Operator
Destructors
Method ~XString | Free ressources.

See Also

XBaseString.


XString::XString

Method XString::XString

XString::XString()
XString::XString(const char* iString, const int iLength)
XString::XString(const int iLength)
XString::XString(const XString& iSrc)
XString::XString(const XBaseString& iSrc)

Reserving constructor.

Parameters

Input argument iString | string to initialize the object.
Input argument iLength | size of the string given (if 0, reads the string to the final '\0' character.
Input argument iSrc | string to initialize the object.

Remarks

this function allow to do something like char buffer[size]; with size being dynamic.


XString::operator=

Method XString::operator=

XString& XString::operator= (const XBaseString& iSrc)
XString&
XString::operator= (const char* iSrc)
XString&
XString::operator= (const XString& iSrc)

Affectation operator.

Parameters

iSrc

string to initialize the object.

Returns

A reference to the current object.

Remarks

operator


XString::operator+

Method XString::operator+

XString XString::operator+ (const char* iString) const
XString XString::operator+ (const XBaseString& iString) const
XString XString::operator+ (const char iValue) const
XString XString::operator+ (const int iValue) const
XString XString::operator+ (const unsigned int iValue) const
XString XString::operator+ (const float iValue) const

Returns

The current object added with the value of the object on the right-hand-side of the operator.

Remarks

Description: Addition Operator


XString::operator-

Method XString::operator-

int XString::operator- (const char* iStr) const
int XString::operator- (const XBaseString& iStr) const

Returns

The result of subtracting the value of the object on the right from this object.

Remarks

Description: Subtraction Operator


XString::operator<<

Method XString::operator<<

XString& XString::operator<< (const XBaseString& iString)
XString& XString::operator<< (const char iValue)
XString& XString::operator<< (const int iValue)
XString& XString::operator<< (const unsigned int iValue)
XString& XString::operator<< (const float iValue)
XString& XString::operator<< (const void* iValue)
XString&
XString::operator<< (const char* iString)

Appends something to the string.

Parameters

iString

a string to append iChar: a character to append iInt: an integer to append iUInt: an unsigned integer to append iFloat: a float to append

Remarks

for more control on the formatting of the value, use Format instead


XString::operator[]

Method XString::operator[]

char& XString::operator[](XDWORD i)
char& XString::operator[](int i)
char XString::operator[](XDWORD i) const
char XString::operator[](int i) const

access to a character (read/write)

Parameters

i

index of the character to read/write.

Returns

The value that this object associates with the value of the object that is the parameter to this operator.

Remarks

Description: Indexing Operator


XString::Capacity

Method XString::Capacity

XDWORD XString::Capacity()

Returns the capacity (the allocated size) of the string.

See Also

Reserve.


XString::CheckFileNameValidity

Method XString::CheckFileNameValidity

void
XString::CheckFileNameValidity()

replaces all the occurrence of characters :*?"<>| into ' ' These characters are not valid in filenames


XString::Compare

Method XString::Compare

int XString::Compare(const XBaseString& iStr) const

Compare two strings.

Parameters

Input argument iStr

string to compare with the current object.

Returns

Value | Meaning
< 0 | the current string is lesser than iStr,
0 | the current string is identical to iStr,
> 0 | the current string is greater than iStr.

Remarks

Compare the strings.

See Also

ICompare.


XString::Contains

Method XString::Contains

XBOOL XString::Contains(const XBaseString& iStr) const

Remarks

finds a string in the string


XString::Create

Method XString::Create

XString&
XString::Create(const char* iString, const int iLength)

Creates a string from a section of a string

Parameters

Input argument iString | string to initialize the object.
Input argument iLength | size of the string given


XString::CreateTail

Method XString::CreateTail

XString&
XString::CreateTail(const XBaseString& iString, const int iStart)

Creates a string from the last section of a string

Parameters

Input argument iString | string to initialize the object.
Input argument iStart | starting position in the string given


XString::Crop

Method XString::Crop

XString&
XString::Crop(XDWORD iStart,XDWORD iLength)

Crops the string.

Parameters

Input argument iStart | The beginning indice of the substring in the string.
Input argument iLength | The length of the substring to crop from the string.

Returns

a reference on the current string.


XString::Cut

Method XString::Cut

XString&
XString::Cut(XDWORD iStart,XDWORD iLength)

Cuts the string.

Parameters

Input argument iStart | The beginning indice of the substring to cut in the string.
Input argument iLength | The length of the substring to cut in the string.

Returns

a reference on the current string.

Remarks

Imagine you have the string “Hello World!”, if you call Cut with iStart=5 and iLength=5, you'll have your string holding the string “Hello!”.


XString::Find

Method XString::Find

XDWORD
XString::Find(char iCar,XDWORD iStart) const
XDWORD
XString::Find(const XBaseString& iStr,XDWORD iStart) const

Look for the first occurence of a character in the string, given a starting position.

Parameters

Input argument iCar | The character to look for.
Input argument iStr | The string to look for.
Input argument iStart | The position the research must begin.

Returns

The position of the character or NOTFOUND if the character is not found.

Remarks

There is no check on the validity of the begin parameter. The IFind is the ignore case version


XString::Format

Method XString::Format

XString& XString::Format(const char* iFormat,...)

Remarks

Format the string sprintf style


XString::FormatTime

Method XString::FormatTime

XString& XString::FormatTime(int iTime, const char* iFormat)
XString&
XString::FormatTime(const char* iFormat)

Format a string using the current time.

Parameters

Input argument iTime

the time to format, given in seconds (function time() for ex.)
iFormat

format to build the string. Can contains the following formatting codes :

%a : Abbreviated weekday name %A : Full weekday name %b : Abbreviated month name %B : Full month name %c : Date and time representation appropriate for locale %d : Day of month as decimal number (01..31) %H : Hour in 24-hour format (00..23) %I : Hour in 12-hour format (01..12) %j : Day of year as decimal number (001..366) %m : Month as decimal number (01..12) %M : Minute as decimal number (00..59) %p : Current locale?s A.M./P.M. indicator for 12-hour clock %S : Second as decimal number (00..59) %U : Week of year as decimal number, with Sunday as first day of week (00..53) %w : Weekday as decimal number (0..6; Sunday is 0) %W : Week of year as decimal number, with Monday as first day of week (00..53) %x : Date representation for current locale %X : Time representation for current locale %y : Year without century, as decimal number (00..99) %Y : Year with century, as decimal number %z, %Z : Time-zone name or abbreviation; no characters if time zone is unknown %% : Percent sign

As in the printf function, the # flag may prefix any formatting code. In that case, the meaning of the format code is changed as follows.

Format Code Meaning %#a, %#A, %#b, %#B, %#p, %#X, %#z, %#Z, %#% # flag is ignored. %#c Long date and time representation, appropriate for current locale. For example: “Tuesday, March 14, 1995, 12:41:29”. %#x Long date representation, appropriate to current locale. For example: “Tuesday, March 14, 1995”. %#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y Remove leading zeros (if any).

Returns

A reference to the current string.

Remarks

The function with no arguments format the current time. The function calling string will be discarded. The final string is limited to 512 characters.


XString::ICompare

Method XString::ICompare

int
XString::ICompare(const XBaseString& iStr) const

Compare two strings ignoring the case.

Parameters

Input argument iStr

string to compare with the current string.

Returns

Value | Meaning
0 | if the string are equals,
<0 | if the current string is lesser than iStr,
>0 | if the current string is greater than iStr.

See Also

Compare.


XString::IContains

Method XString::IContains

XBOOL XString::IContains(const XBaseString& iStr) const

Remarks

finds a string in the string (ignore the case).


XString::IFind

Method XString::IFind

XDWORD XString::IFind(const XBaseString& iStr,XDWORD iStart=0) const

Remarks

finds a string in the string (ignore the case).


XString::NCompare

Method XString::NCompare

int XString::NCompare(const XBaseString& iStr, const int iN) const

Compare the n first character of two strings.

Parameters

Input argument iStr | string to compare with the current object.
Input argument iN | n first character to compare

Returns

Value | Meaning
< 0 | the current string is lesser than iStr,
0 | the current string is identical to iStr,
> 0 | the current string is greater than iStr.

See Also

ICompare.


XString::Replace

Method XString::Replace

int
XString::Replace(char iSrc,char iDest)
int
XString::Replace(const XBaseString& iSrc,const XBaseString& iDest)

replaces all the occurence of a character by another one.

Parameters

Input argument iSrc | The character to look for.
Input argument iDest | The string that will be written instead.

Returns

The number of characters replaced.


XString::Reserve

Method XString::Reserve

void
XString::Reserve(XDWORD iLength)

Sets the capacity of the string.

Parameters

Input argument iLength

size to allocate.

Remarks

Does not discard the currently hold string.

See Also

Capacity.


XString::Resize

Method XString::Resize

void XString::Resize(XDWORD iLength)


XString::RFind

Method XString::RFind

XDWORD
XString::RFind(char iCar,XDWORD iStart) const

Look for the last occurence of a character in the string.

Parameters

Input argument iCar | The character to look for.
Input argument iStart | The position the research must begin (giving NOTFOUND means to start from the end).

Returns

The position of the character or NOTFOUND if the character is not found.


XString::Str

Method XString::Str

char* XString::Str()
const char* XString::Str() const

Conversion to a const char*.


XString::Strip

Method XString::Strip

XString&
XString::Strip()

Replaces space ( ' ', '\t' and '\n') sequences by one space.

Returns

A reference to the current object.

See Also

Trim.


XString::Substring

Method XString::Substring

XString
XString::Substring(XDWORD iStart,XDWORD iLength) const

Build a substring of the current string.

Parameters

Input argument iStart | The beginning indice of the substring in the string.
Input argument iLength | The length of the substring to extract of the string. (0 means all the string till the end.)

Returns

The substring.

Remarks

If you have this string : “ti,vo,k” and you want build the substring “vo” you call SubString with iStart equal to 3 and iLength equal to 2.


XString::ToLower

Method XString::ToLower

XString&
XString::ToLower()

Converts a string to lowercase.

Returns

A reference to the current object.

See Also

ToUpper.


XString::ToUpper

Method XString::ToUpper

XString&
XString::ToUpper()

Converts a string to uppercase.

Returns

A reference to the current string.

See Also

ToLower.


XString::Trim

Method XString::Trim

XString&
XString::Trim()

Removes space ( ' ', '\t' and '\n') from the start and the end of the string.

Returns

A reference to the current string.

See Also

Strip.


XString::operator!=

Method XString::operator!=

int XString::operator!= (const char* iStr) const
int XString::operator!= (const XBaseString& iStr) const

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XString::operator<

Method XString::operator<

int XString::operator< (const char* iStr) const
int XString::operator< (const XBaseString& iStr) const

Returns

This returns true if this object is less than the one on the right-hand-side of the operator.

Remarks

Description: Less-Than Operator


XString::operator<=

Method XString::operator<=

int XString::operator<= (const char* iStr) const
int XString::operator<= (const XBaseString& iStr) const

Returns

This returns true if this object is not greater than the one on the right-hand-side of the operator.

Remarks

Description: Less-Than-Or-Equal Operator


XString::operator==

Method XString::operator==

int XString::operator== (const char* iStr) const
int XString::operator== (const XBaseString& iStr) const

Operators for strings comparisons.

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XString::operator>

Method XString::operator>

int XString::operator> (const char* iStr) const
int XString::operator> (const XBaseString& iStr) const

Returns

This returns true if this object is greater than the one on the right-hand-side of the operator.

Remarks

Description: Greater-Than Operator


XString::operator>=

Method XString::operator>=

int XString::operator>= (const char* iStr) const
int XString::operator>= (const XBaseString& iStr) const

Returns

This returns true if this object is not less than the one on the right-hand-side of the operator.

Remarks

Description: Greater-Than-Or-Equal-To Operator


XString::~XString

Method XString::~XString

XString::~XString()

Free ressources.

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


Strings

External Function CKStrdelete | Deletes a string
External Function CKStrdup | Copy a string
External Function CKStrlwr | Makes a string lowercase
External Function CKStrupr | Makes a string uppercase

See Also

Containers


CKStrdelete

External Function CKStrdelete

void CKStrdelete(CKSTRING str)

Deletes a string

Parameters

Input argument str

String to delete.

Remarks

This function deletes the memory allocated by the CKStrdup function

See Also

CKStrlwr,CKStrupr,CKStrdup


CKStrdup

External Function CKStrdup

CKSTRING CKStrdup(CKSTRING str)

Copy a string

Parameters

Input argument str

String to duplicate.

Returns

A pointer to a string containing the copy of str.

Remarks

+This function allocates the memory for the new string +The allocated pointer should be deleted with the CKStrdelete method.

See Also

CKStrlwr,CKStrupr,CKStrdelete


CKStrlwr

External Function CKStrlwr

CKSTRING CKStrlwr(CKSTRING str)

Makes a string lowercase

Parameters

Input argument str

String to make lowercase.

Returns

str.

Remarks

This method returns the same pointer you pass in argument.

See Also

CKStrupr,CKStrdup


CKStrupr

External Function CKStrupr

CKSTRING CKStrupr(CKSTRING str)

Makes a string uppercase

Parameters

Input argument str

String to make uppercase.

Returns

str.

Remarks

This method returns the same pointer you pass in argument.

See Also

CKStrlwr,CKStrdup


Hash Tables

Class XEqual | A serie of comparison function
Class XHashFun | A serie of hash functions
Class XHashTable | Class representation of an Hash Table container.
Class XNHashTable | Class representation of an Hash Table container.
Class XNHashTableConstIt | Constant Iterator on a hash table.
Class XNHashTableIt | Iterator on a hash table.
Class XNHashTablePair | Struct containing an iterator on an object inserted and a BOOL determining if it were really inserted (TRUE) or already there (FALSE).
Class XSHashTable | Class representation of an Hash Table container.
Class XSHashTableConstIt | Constant iterator on a hash table.
Class XSHashTableIt | Iterator on a hash table.
Class XSHashTablePair | Struct containing an iterator on an object inserted and a BOOL determining if it were really inserted (TRUE) or already there (FALSE).

See Also

Containers


XEqual

Class XEqual

A serie of comparison function

Groups

Operators
Method operator()
Method operator()
Method operator()


XEqualXStringI::operator()

Method XEqualXStringI::operator()

int XEqualXStringI::operator()(const XString& iS1,const XString& iS2) const


XEqualStringI::operator()

Method XEqualStringI::operator()

int XEqualStringI::operator()(const char* iS1,const char* iS2) const


XEqual::operator()

Method XEqual::operator()

int XEqual::operator()(const K& iK1,const K& iK2) const


XHashFun

Class XHashFun

A serie of hash functions

Remarks

These hash functions are designed to be used when declaring a hash table where the key is one of the following type :

  • XHashFunString : hash function for char* key

  • XHashFunXString : hash function for XString key

  • XHashFunChar : hash function for char key

  • XHashFunByte : hash function for BYTE key

  • XHashFunWord : hash function for WORD key

  • XHashFunDword : hash function for DWORD key

  • XHashFunInt : hash function for int key

  • XHashFunFloat : hash function for float key

  • XHashFunPtr : hash function for void* key

Groups

Operators
Method operator()
Method operator()
Method operator()


XHashFunXStringI::operator()

Method XHashFunXStringI::operator()

int XHashFunXStringI::operator()(const XString& __s) const


XHashFunStringI::operator()

Method XHashFunStringI::operator()

int XHashFunStringI::operator()(const char* __s) const


XHashFun::operator()

Method XHashFun::operator()

int XHashFun::operator()(const K& iK)


XHashTable

Class XHashTable

Class representation of an Hash Table container.

Remarks

T is the type of element to insert K is the type of the key H is the hash function to hash the key

Several hash functions for basic types are already defined in XHashFun.h

This implementation of the hash table uses Linked List in each bucket for element hashed to the same index, so there are memory allocation for each insertion. For a static implementation without dynamic allocation, look at XSHashTable.

There is a m_LoadFactor member which allow the user to decide at which occupation the hash table must be extended and rehashed.

Groups

Constructors | Assignment | Operators | Operations | Hash Tables | Type Definitions | Destructors

Constructors
Method XHashTable | Default Constructor.
Assignment
Method operator= | Affectation operator.
Operators
Method operator[] | Access to an hash table element.
Operations
Method Begin | Returns an iterator on the first element.
Method Clear | Removes all the elements from the table.
Method End | Returns an iterator out of the hash table.
Method Find | Access to a constant hash table element.
Method FindPtr | Access to an hash table element.
Method GetByIndex |
Method GetIteratorByIndex | Returns the index of the given key.
Method GetMemoryOccupation | Return the occupied size in bytes.
Method GetOccupation | Calculates the average occupation for the buckets by filling an array with the population for different bucket size (represented by the index of the array)
Method Index | Returns the index of the given key.
Method Insert | Inserts an element in the table.
Method IsHere | test for the presence of a key.
Method LookUp | search for an hash table element.
Method Remove | Removes an element.
Method Reserve | Reserve an estimation of future hash occupation.
Method Size | Returns the elements number.
Hash Tables
Class ConstIterator | Constant Iterator on a hash table.
Class Iterator | Iterator on a hash table.
Class Pair | Struct containing an iterator on an object inserted and a BOOL determining if it were really inserted (TRUE) or already there (FALSE).
Type Definitions
Type Definition pConstTable |
Type Definition pTable |
Type Definition Table |
Destructors
Method ~XHashTable | Destructor.


XHashTable::XHashTable

Method XHashTable::XHashTable

XHashTable::XHashTable(int initialsize = 16)
XHashTable::XHashTable(const XHashTable& a)

Default Constructor.

Parameters

Input argument initialsize | The default number of buckets (should be a power of 2, otherwise will be converted.) l: Load Factor (see Class Description).
Input argument a | hash table to copy.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XHashTable::operator=

Method XHashTable::operator=

Table& XHashTable::operator= (const Table& a)

Affectation operator.

Returns

A reference to the current object.

Remarks

The content of the table is enterely overwritten by the given table.


XHashTable::operator[]

Method XHashTable::operator[]

T& XHashTable::operator[] (const K& key)

Access to an hash table element.

Parameters

Input argument key

key of the element to access.

Returns

a copy of the element found.

Remarks

If no element correspond to the key, an element constructed with 0.


XHashTable::Begin

Method XHashTable::Begin

Iterator XHashTable::Begin()
ConstIterator XHashTable::Begin() const

Returns an iterator on the first element.

Example

       Typically, an algorithm iterating on an hash table
   looks like:

       XHashTable<T,K,H>::Iterator it = h.Begin();
       XHashTable<T,K,H>::Iterator itend = h.End();

       for(; it != itend; ++it) {
do something with *t
       }


XHashTable::Clear

Method XHashTable::Clear

void XHashTable::Clear()

Removes all the elements from the table.

Remarks

The hash table remains with the same number of buckets after a clear.


XHashTable::End

Method XHashTable::End

Iterator XHashTable::End()
ConstIterator XHashTable::End() const

Returns an iterator out of the hash table.


XHashTable::Find

Method XHashTable::Find

Iterator XHashTable::Find(const K& key)
ConstIterator XHashTable::Find(const K& key) const

Access to a constant hash table element.

Parameters

Input argument key

key of the element to access.

Returns

a constant iterator of the element found. End() if not found.


XHashTable::FindPtr

Method XHashTable::FindPtr

T *XHashTable::FindPtr(const K& key) const

Access to an hash table element.

Parameters

Input argument key

key of the element to access.

Returns

a pointer on the element found. NULL if not found.


XHashTable::GetByIndex

Method XHashTable::GetByIndex

Iterator XHashTable::GetByIndex(const int iIndex)


XHashTable::GetIteratorByIndex

Method XHashTable::GetIteratorByIndex

Iterator XHashTable::GetIteratorByIndex(int index) const

Returns the index of the given key.

Parameters

key: key of the element to find the index.


XHashTable::GetMemoryOccupation

Method XHashTable::GetMemoryOccupation

int XHashTable::GetMemoryOccupation(XBOOL addstatic=FALSE) const

Return the occupied size in bytes.

Parameters

addstatic

TRUE if you want to add the size occupied by the class itself.


XHashTable::GetOccupation

Method XHashTable::GetOccupation

void XHashTable::GetOccupation(XArray<int>& iBucketOccupation) const

Calculates the average occupation for the buckets by filling an array with the population for different bucket size (represented by the index of the array)


XHashTable::Index

Method XHashTable::Index

int XHashTable::Index(const K& key) const

Returns the index of the given key.

Parameters

Input argument key

key of the element to find the index.


XHashTable::Insert

Method XHashTable::Insert

XBOOL XHashTable::Insert(const K& key,const T& o,XBOOL override)
Iterator XHashTable::Insert(const K& key,const T& o)
Pair
XHashTable::TestInsert(const K& key,const T& o)
Iterator XHashTable::InsertUnique(const K& key,const T& o)

Inserts an element in the table.

Parameters

Input argument override | if the key is already present, should the old element be overriden ?
key | key of the element to insert.
o | element to insert.

Remarks

Insert will automatically override the old value and InsertUnique will not replace the old value. TestInsert returns a XHashPair, which allow you to know if the element was already present.


XHashTable::IsHere

Method XHashTable::IsHere

XBOOL XHashTable::IsHere(const K& key) const

test for the presence of a key.

Parameters

Input argument key

key of the element to access.

Returns

TRUE if the key was found, FALSE otherwise..


XHashTable::LookUp

Method XHashTable::LookUp

XBOOL XHashTable::LookUp(const K& key,T& value) const

search for an hash table element.

Parameters

Input argument key | key of the element to access.
Input argument value | value to receive the element found value.

Returns

TRUE if the key was found, FALSE otherwise..


XHashTable::Remove

Method XHashTable::Remove

void XHashTable::Remove(const K& key)
Iterator XHashTable::Remove(const Iterator& it)

Removes an element.

Parameters

Input argument key | key of the element to remove.
Input argument it | iterator on the object to remove.

Returns

iterator on the lement next to the one just removed.


XHashTable::Reserve

Method XHashTable::Reserve

void XHashTable::Reserve(const int iCount)

Reserve an estimation of future hash occupation.

Parameters

iCount

count of elements to reserve

Remarks

you need to call this function before populating the hash table.


XHashTable::Size

Method XHashTable::Size

int XHashTable::Size() const

Returns the elements number.


XHashTable::ConstIterator

Class XHashTable::ConstIterator

Constant Iterator on a hash table.

Remarks

This iterator is the only way to iterate on elements in a constant hash table. The iteration will be in no specific order, not in the insertion order. Here is an example of how to use it:

Groups

Constructors
Method ConstIterator | Default constructor of the iterator.
Operators
Method operator* | Returns a constant reference on the data pointed by the iterator.
Method operator++ | Jumps to next entry in the hashtable.
Operations
Method GetKey | Returns a const reference on the key of the pointed entry.
Comparison Operators
Method operator!= | Operator Not Equal of the iterator.
Method operator== | Operator Equal of the iterator.

Example

       void MyClass::MyMethod() const
       {
           XHashTable<T,K,H>::ConstIterator it = m_Hashtable.Begin();
           while (it != m_Hashtable.End()) {
access to the key
               it.GetKey();

access to the element
               *it;

next element
               ++it;
           }
       }


XHashTable::ConstIterator::ConstIterator

Method XHashTable::ConstIterator::ConstIterator

XHashTable::ConstIterator::ConstIterator()
XHashTable::ConstIterator::ConstIterator(const ConstIterator& n)

Default constructor of the iterator.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XHashTable::ConstIterator::operator*

Method XHashTable::ConstIterator::operator*

const T& XHashTable::ConstIterator::operator*() const

Returns a constant reference on the data pointed by the iterator.

Returns

The object pointed to by this object.

Remarks

The returned reference is constant, so you can't modify its value. Use the other * operator for this purpose.


XHashTable::ConstIterator::operator++

Method XHashTable::ConstIterator::operator++

ConstIterator& XHashTable::ConstIterator::operator++()
ConstIterator XHashTable::ConstIterator::operator++(int)

Jumps to next entry in the hashtable.

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XHashTable::ConstIterator::GetKey

Method XHashTable::ConstIterator::GetKey

const K& XHashTable::ConstIterator::GetKey() const

Returns a const reference on the key of the pointed entry.


XHashTable::ConstIterator::operator!=

Method XHashTable::ConstIterator::operator!=

int XHashTable::ConstIterator::operator!=(const ConstIterator& it) const

Operator Not Equal of the iterator.

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XHashTable::ConstIterator::operator==

Method XHashTable::ConstIterator::operator==

int XHashTable::ConstIterator::operator==(const ConstIterator& it) const

Operator Equal of the iterator.

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XHashTable::Iterator

Class XHashTable::Iterator

Iterator on a hash table.

Remarks

This iterator is the only way to iterate on elements in a hash table. The iteration will be in no specific order, not in the insertion order. Here is an example of how to use it:

Groups

Constructors
Method Iterator | Default constructor of the iterator.
Operators
Method operator* | Returns a constant reference on the data pointed by the iterator.
Method operator++ | Jumps to next entry in the hashtable.
Method operator-- | Jumps to next entry in the hashtable.
Operations
Method GetKey | Returns a const reference on the key of the pointed entry.
Comparison Operators
Method operator!= | Operator Not Equal of the iterator.
Method operator== | Operator Equal of the iterator.

Example

       XHashTable<T,K,H>::Iterator it = hashtable.Begin();
       while (it != hashtable.End()) {
access to the key
           it.GetKey();

access to the element
           *it;

next element
           ++it;
       }


XHashTable::Iterator::Iterator

Method XHashTable::Iterator::Iterator

XHashTable::Iterator::Iterator()
XHashTable::Iterator::Iterator(const Iterator& n)

Default constructor of the iterator.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XHashTable::Iterator::operator*

Method XHashTable::Iterator::operator*

const T& XHashTable::Iterator::operator*() const
T& XHashTable::Iterator::operator*()

Returns a constant reference on the data pointed by the iterator.

Returns

The object pointed to by this object.

Remarks

The returned reference is constant, so you can't modify its value. Use the other * operator for this purpose.


XHashTable::Iterator::operator++

Method XHashTable::Iterator::operator++

Iterator& XHashTable::Iterator::operator++()
Iterator XHashTable::Iterator::operator++(int)

Jumps to next entry in the hashtable.

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XHashTable::Iterator::operator--

Method XHashTable::Iterator::operator--

Iterator& XHashTable::Iterator::operator--()
Iterator XHashTable::Iterator::operator--(int)

Jumps to next entry in the hashtable.

Returns

A reference to the current object.

Remarks

Description: Prefix Decrement Operator

This decrements the current object.


XHashTable::Iterator::GetKey

Method XHashTable::Iterator::GetKey

const K& XHashTable::Iterator::GetKey() const
K& XHashTable::Iterator::GetKey()

Returns a const reference on the key of the pointed entry.


XHashTable::Iterator::operator!=

Method XHashTable::Iterator::operator!=

int XHashTable::Iterator::operator!=(const Iterator& it) const

Operator Not Equal of the iterator.

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XHashTable::Iterator::operator==

Method XHashTable::Iterator::operator==

int XHashTable::Iterator::operator==(const Iterator& it) const

Operator Equal of the iterator.

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XHashTable::Pair

Class XHashTable::Pair

Struct containing an iterator on an object inserted and a BOOL determining if it were really inserted (TRUE) or already there (FALSE).

Groups

Data Members
Member Variable m_Iterator |
Member Variable m_New |
Constructors
Method Pair | Description: Builds an instance of the object This builds an instance of the object out of its parameters.


XHashTable::Pair::m_Iterator

Member Variable XHashTable::Pair::m_Iterator

Iterator XHashTable::Pair::m_Iterator


XHashTable::Pair::m_New

Member Variable XHashTable::Pair::m_New

XBOOL XHashTable::Pair::m_New


XHashTable::Pair::Pair

Method XHashTable::Pair::Pair

XHashTable::Pair::Pair(Iterator it,int n)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XHashTable::pConstTable

Type Definition XHashTable::pConstTable

typedef const XHashTable* XHashTable::pConstTable


XHashTable::pTable

Type Definition XHashTable::pTable

typedef XHashTable* XHashTable::pTable


XHashTable::Table

Type Definition XHashTable::Table

typedef XHashTable XHashTable::Table


XHashTable::~XHashTable

Method XHashTable::~XHashTable

XHashTable::~XHashTable()

Destructor.

Remarks

Release the elements contained in the hash table. If you were storing pointers, you need first to iterate on the table and call delete on each pointer.


XNHashTable

Class XNHashTable

Class representation of an Hash Table container.

Remarks

T is the type of element to insert K is the type of the key H is the hash function to hash the key

Several hash functions for basic types are already defined in XHashFun.h

This implementation of the hash table uses Linked List in each bucket for element hashed to the same index, so there are memory allocation for each insertion. For a static implementation without dynamic allocation, look at XSHashTable.

There is a m_LoadFactor member which allow the user to decide at which occupation the hash table must be extended and rehashed.

Groups

Constructors | Assignment | Operators | Operations | Type Definitions | Destructors

Constructors
Method XNHashTable | Default Constructor.
Assignment
Method operator= | Affectation operator.
Operators
Method operator[] | Access to an hash table element.
Operations
Method Begin | Returns an iterator on the first element.
Method Clear | Removes all the elements from the table.
Method End | Returns an iterator out of the hash table.
Method Find | Access to a constant hash table element.
Method FindPtr | Access to an hash table element.
Method GetMemoryOccupation | Return the occupied size in bytes.
Method Index | Returns the index of the given key.
Method Insert | Inserts an element in the table.
Method IsHere | test for the presence of a key.
Method LookUp | search for an hash table element.
Method Remove | Removes an element.
Method Size | Returns the elements number.
Type Definitions
Type Definition ConstIterator |
Type Definition Iterator |
Type Definition Pair |
Destructors
Method ~XNHashTable | Destructor.


XNHashTable::XNHashTable

Method XNHashTable::XNHashTable

XNHashTable::XNHashTable(int initialsize = 16,float l = 0.75f)
XNHashTable::XNHashTable(const XNHashTable& a)

Default Constructor.

Parameters

Input argument initialsize | The default number of buckets (should be a power of 2, otherwise will be converted.)
Input argument l | Load Factor (see Class Description).
Input argument a | hash table to copy.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XNHashTable::operator=

Method XNHashTable::operator=

tTable& XNHashTable::operator= (const tTable& a)

Affectation operator.

Returns

A reference to the current object.

Remarks

The content of the table is enterely overwritten by the given table.


XNHashTable::operator[]

Method XNHashTable::operator[]

T& XNHashTable::operator[] (const K& key)

Access to an hash table element.

Parameters

Input argument key

key of the element to access.

Returns

a copy of the element found.

Remarks

If no element correspond to the key, an element constructed with 0.


XNHashTable::Begin

Method XNHashTable::Begin

tIterator XNHashTable::Begin()
tConstIterator XNHashTable::Begin() const

Returns an iterator on the first element.

Example

       Typically, an algorithm iterating on an hash table
   looks like:

       XNHashTableIt<T,K,H> it = h.Begin();
       XNHashTableIt<T,K,H> itend = h.End();

       for(; it != itend; ++it) {
do something with *t
       }


XNHashTable::Clear

Method XNHashTable::Clear

void XNHashTable::Clear()

Removes all the elements from the table.

Remarks

The hash table remains with the same number of buckets after a clear.


XNHashTable::End

Method XNHashTable::End

tIterator XNHashTable::End()
tConstIterator XNHashTable::End() const

Returns an iterator out of the hash table.


XNHashTable::Find

Method XNHashTable::Find

tIterator XNHashTable::Find(const K& key)
tConstIterator XNHashTable::Find(const K& key) const

Access to a constant hash table element.

Parameters

Input argument key

key of the element to access.

Returns

a constant iterator of the element found. End() if not found.


XNHashTable::FindPtr

Method XNHashTable::FindPtr

T *XNHashTable::FindPtr(const K& key) const

Access to an hash table element.

Parameters

Input argument key

key of the element to access.

Returns

a pointer on the element found. NULL if not found.


XNHashTable::GetMemoryOccupation

Method XNHashTable::GetMemoryOccupation

int XNHashTable::GetMemoryOccupation(XBOOL addstatic=FALSE) const

Return the occupied size in bytes.

Parameters

addstatic

TRUE if you want to add the size occupied by the class itself.


XNHashTable::Index

Method XNHashTable::Index

int XNHashTable::Index(const K& key) const

Returns the index of the given key.

Parameters

Input argument key

key of the element to find the index.


XNHashTable::Insert

Method XNHashTable::Insert

XBOOL XNHashTable::Insert(const K& key,const T& o,XBOOL override)
tIterator XNHashTable::Insert(const K& key,const T& o)
tPair XNHashTable::TestInsert(const K& key,const T& o)
tIterator XNHashTable::InsertUnique(const K& key,const T& o)

Inserts an element in the table.

Parameters

Input argument override | if the key is already present, should the old element be overriden ?
key | key of the element to insert.
o | element to insert.

Remarks

Insert will automatically override the old value and InsertUnique will not replace the old value. TestInsert returns a XHashPair, which allow you to know if the element was already present.


XNHashTable::IsHere

Method XNHashTable::IsHere

XBOOL XNHashTable::IsHere(const K& key) const

test for the presence of a key.

Parameters

Input argument key

key of the element to access.

Returns

TRUE if the key was found, FALSE otherwise..


XNHashTable::LookUp

Method XNHashTable::LookUp

XBOOL XNHashTable::LookUp(const K& key,T& value) const

search for an hash table element.

Parameters

Input argument key | key of the element to access.
Input argument value | value to receive the element found value.

Returns

TRUE if the key was found, FALSE otherwise..


XNHashTable::Remove

Method XNHashTable::Remove

void XNHashTable::Remove(const K& key)
tIterator XNHashTable::Remove(const tIterator& it)

Removes an element.

Parameters

Input argument key | key of the element to remove.
Input argument it | iterator on the object to remove.

Returns

iterator on the lement next to the one just removed.


XNHashTable::Size

Method XNHashTable::Size

int XNHashTable::Size() const

Returns the elements number.


XNHashTable::ConstIterator

Type Definition XNHashTable::ConstIterator

typedef XNHashTableConstIt<T,K,H,Eq> XNHashTable::ConstIterator


XNHashTable::Iterator

Type Definition XNHashTable::Iterator

typedef XNHashTableIt<T,K,H,Eq> XNHashTable::Iterator


XNHashTable::Pair

Type Definition XNHashTable::Pair

typedef XNHashTablePair<T,K,H,Eq> XNHashTable::Pair


XNHashTable::~XNHashTable

Method XNHashTable::~XNHashTable

XNHashTable::~XNHashTable()

Destructor.

Remarks

Release the elements contained in the hash table. If you were storing pointers, you need first to iterate on the table and call delete on each pointer.


XNHashTableConstIt

Class XNHashTableConstIt

Constant Iterator on a hash table.

Remarks

This iterator is the only way to iterate on elements in a constant hash table. The iteration will be in no specific order, not in the insertion order. Here is an example of how to use it:

Groups

Constructors | Operators | Operations | Coercion Operators | Comparison Operators

Constructors
Method XNHashTableConstIt | Default constructor of the iterator.
Operators
Method operator* | Returns a constant reference on the data pointed by the iterator.
Method operator++ | Jumps to next entry in the hashtable.
Operations
Method GetKey | Returns a const reference on the key of the pointed entry.
Coercion Operators
Method cast operator | Returns a pointer on a T object.
Comparison Operators
Method operator!= | Operator Not Equal of the iterator.
Method operator== | Operator Equal of the iterator.

Example

   void MyClass::MyMethod() const
   {
       XNHashTableConstIt<T,K,H> it = m_Hashtable.Begin();
       while (it != m_Hashtable.End()) {
access to the key
           it.GetKey();

access to the element
           *it;

next element
           ++it;
       }
   }


XNHashTableConstIt::XNHashTableConstIt

Method XNHashTableConstIt::XNHashTableConstIt

XNHashTableConstIt::XNHashTableConstIt()
XNHashTableConstIt::XNHashTableConstIt(const tConstIterator& n)

Default constructor of the iterator.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XNHashTableConstIt::operator*

Method XNHashTableConstIt::operator*

const T& XNHashTableConstIt::operator*() const

Returns a constant reference on the data pointed by the iterator.

Returns

The object pointed to by this object.

Remarks

The returned reference is constant, so you can't modify its value. Use the other * operator for this purpose.


XNHashTableConstIt::operator++

Method XNHashTableConstIt::operator++

tConstIterator& XNHashTableConstIt::operator++()
tConstIterator XNHashTableConstIt::operator++(int)

Jumps to next entry in the hashtable.

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XNHashTableConstIt::GetKey

Method XNHashTableConstIt::GetKey

const K& XNHashTableConstIt::GetKey() const

Returns a const reference on the key of the pointed entry.


XNHashTableConstIt::cast operator

Method XNHashTableConstIt::cast operator

XNHashTableConstIt::operator const T*() const

Returns a pointer on a T object.

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XNHashTableConstIt::operator!=

Method XNHashTableConstIt::operator!=

int XNHashTableConstIt::operator!=(const tConstIterator& it) const

Operator Not Equal of the iterator.

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XNHashTableConstIt::operator==

Method XNHashTableConstIt::operator==

int XNHashTableConstIt::operator==(const tConstIterator& it) const

Operator Equal of the iterator.

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XNHashTableIt

Class XNHashTableIt

Iterator on a hash table.

Remarks

This iterator is the only way to iterate on elements in a hash table. The iteration will be in no specific order, not in the insertion order. Here is an example of how to use it:

Groups

Constructors | Operators | Operations | Coercion Operators | Comparison Operators

Constructors
Method XNHashTableIt | Default constructor of the iterator.
Operators
Method operator* | Returns a constant reference on the data pointed by the iterator.
Method operator++ | Jumps to next entry in the hashtable.
Operations
Method GetKey | Returns a const reference on the key of the pointed entry.
Coercion Operators
Method cast operator | Returns a pointer on a T object.
Comparison Operators
Method operator!= | Operator Not Equal of the iterator.
Method operator== | Operator Equal of the iterator.

Example

   XNHashTableIt<T,K,H> it = hashtable.Begin();
   while (it != hashtable.End()) {
access to the key
       it.GetKey();

access to the element
       *it;

next element
       ++it;
   }


XNHashTableIt::XNHashTableIt

Method XNHashTableIt::XNHashTableIt

XNHashTableIt::XNHashTableIt()
XNHashTableIt::XNHashTableIt(const tIterator& n)

Default constructor of the iterator.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XNHashTableIt::operator*

Method XNHashTableIt::operator*

const T& XNHashTableIt::operator*() const
T& XNHashTableIt::operator*()

Returns a constant reference on the data pointed by the iterator.

Returns

The object pointed to by this object.

Remarks

The returned reference is constant, so you can't modify its value. Use the other * operator for this purpose.


XNHashTableIt::operator++

Method XNHashTableIt::operator++

tIterator& XNHashTableIt::operator++()
tIterator XNHashTableIt::operator++(int)

Jumps to next entry in the hashtable.

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XNHashTableIt::GetKey

Method XNHashTableIt::GetKey

const K& XNHashTableIt::GetKey() const

Returns a const reference on the key of the pointed entry.


XNHashTableIt::cast operator

Method XNHashTableIt::cast operator

XNHashTableIt::operator const T*() const
XNHashTableIt::operator T*()

Returns a pointer on a T object.

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XNHashTableIt::operator!=

Method XNHashTableIt::operator!=

int XNHashTableIt::operator!=(const tIterator& it) const

Operator Not Equal of the iterator.

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XNHashTableIt::operator==

Method XNHashTableIt::operator==

int XNHashTableIt::operator==(const tIterator& it) const

Operator Equal of the iterator.

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XNHashTablePair

Class XNHashTablePair

Struct containing an iterator on an object inserted and a BOOL determining if it were really inserted (TRUE) or already there (FALSE).

Groups

Data Members
Member Variable m_Iterator |
Member Variable m_New |
Constructors
Method XNHashTablePair | Description: Builds an instance of the object This builds an instance of the object out of its parameters.


XNHashTablePair::m_Iterator

Member Variable XNHashTablePair::m_Iterator

XNHashTableIt<T,K,H,Eq> XNHashTablePair::m_Iterator


XNHashTablePair::m_New

Member Variable XNHashTablePair::m_New

XBOOL XNHashTablePair::m_New


XNHashTablePair::XNHashTablePair

Method XNHashTablePair::XNHashTablePair

XNHashTablePair::XNHashTablePair(XNHashTableIt<T,K,H,Eq> it,int n)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XSHashTable

Class XSHashTable

Class representation of an Hash Table container.

Remarks

T is the type of element to insert K is the type of the key H is the hash function to hash the key

Several hash functions for basic types are already defined in XHashFun.h

This implementation of the hash table uses Linked List in each bucket for element hashed to the same index, so there are memory allocation for each insertion. For a static implementation without dynamic allocation, look at XSHashTable.

There is a m_LoadFactor member which allow the user to decide at which occupation the hash table must be extended and rehashed.

Groups

Constructors | Assignment | Operators | Operations | Type Definitions | Destructors

Constructors
Method XSHashTable | Copy Constructor.
Assignment
Method operator= | Affectation operator.
Operators
Method operator[] | Access to an hash table element.
Operations
Method Begin | Returns an iterator on the first element.
Method Clear | Removes all the elements from the table.
Method End | Returns an iterator out of the hash table.
Method Find | Access to an hash table element.
Method FindPtr | Access to an hash table element.
Method Index | Returns the index of the given key.
Method Insert | Inserts an element in the table.
Method IsHere | test for the presence of a key.
Method LookUp | search for an hash table element.
Method Remove | Removes an element.
Method Size | Returns the elements number.
Type Definitions
Type Definition ConstIterator |
Type Definition Iterator |
Destructors
Method ~XSHashTable | Destructor.


XSHashTable::XSHashTable

Method XSHashTable::XSHashTable

XSHashTable::XSHashTable(int initialsize = 8,float l = 0.75f)
XSHashTable::XSHashTable(const XSHashTable& a)

Copy Constructor.

Parameters

Input argument initialsize | The default number of buckets (should be a power of 2, otherwise will be converted.)
Input argument l | Load Factor (see Class Description).
Input argument a | hash table to copy.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XSHashTable::operator=

Method XSHashTable::operator=

tTable& XSHashTable::operator= (const tTable& a)

Affectation operator.

Returns

A reference to the current object.

Remarks

The content of the table is enterely overwritten by the given table.


XSHashTable::operator[]

Method XSHashTable::operator[]

T& XSHashTable::operator[] (const K& key)

Access to an hash table element.

Parameters

Input argument key

key of the element to access.

Returns

a reference of the element found.

Remarks

If no element correspond to the key, an exception.


XSHashTable::Begin

Method XSHashTable::Begin

tIterator XSHashTable::Begin()
tConstIterator XSHashTable::Begin() const

Returns an iterator on the first element.

Example

       Typically, an algorithm iterating on an hash table
   looks like:

       XSHashTableIt<T,K,H> it = h.Begin();
       XSHashTableIt<T,K,H> itend = h.End();

       for(; it != itend; ++it) {
do something with *t
       }


XSHashTable::Clear

Method XSHashTable::Clear

void XSHashTable::Clear()

Removes all the elements from the table.

Remarks

The hash table remains with the same number of buckets after a clear.


XSHashTable::End

Method XSHashTable::End

tIterator XSHashTable::End()
tConstIterator XSHashTable::End() const

Returns an iterator out of the hash table.


XSHashTable::Find

Method XSHashTable::Find

tIterator XSHashTable::Find(const K& key) const

Access to an hash table element.

Parameters

Input argument key

key of the element to access.

Returns

an iterator of the element found. End() if not found.


XSHashTable::FindPtr

Method XSHashTable::FindPtr

T *XSHashTable::FindPtr(const K& key) const

Access to an hash table element.

Parameters

Input argument key

key of the element to access.

Returns

a pointer on the element found. NULL if not found.


XSHashTable::Index

Method XSHashTable::Index

int XSHashTable::Index(const K& key) const

Returns the index of the given key.

Parameters

Input argument key

key of the element to find the index.


XSHashTable::Insert

Method XSHashTable::Insert

BOOL XSHashTable::Insert(const K& key,const T& o,BOOL override)
tIterator XSHashTable::InsertUnique(const K& key,const T& o)

Inserts an element in the table.

Parameters

Input argument key | key of the element to insert.
Input argument o | element to insert.
Input argument override | if the key is already present, should the old element be overriden ?

Returns

TRUE if the value was really inserted, else otherwise.

Remarks

Insert will automatically override the old value and InsertUnique will not replace the old value. TestInsert returns a XHashPair, which allow you to know if the element was already present.


XSHashTable::IsHere

Method XSHashTable::IsHere

int XSHashTable::IsHere(const K& key) const

test for the presence of a key.

Parameters

Input argument key

key of the element to access.

Returns

TRUE if the key was found, FALSE otherwise..


XSHashTable::LookUp

Method XSHashTable::LookUp

BOOL XSHashTable::LookUp(const K& key,T& value) const

search for an hash table element.

Parameters

Input argument key | key of the element to access.
Input argument value | value to receive the element found value.

Returns

TRUE if the key was found, FALSE otherwise..


XSHashTable::Remove

Method XSHashTable::Remove

void XSHashTable::Remove(const K& key)
tIterator XSHashTable::Remove(const tIterator& it)

Removes an element.

Parameters

Input argument key | key of the element to remove.
Input argument it | iterator on the object to remove.

Returns

iterator on the lement next to the one just removed.


XSHashTable::Size

Method XSHashTable::Size

int XSHashTable::Size() const

Returns the elements number.


XSHashTable::ConstIterator

Type Definition XSHashTable::ConstIterator

typedef XSHashTableConstIt<T,K,H,Eq> XSHashTable::ConstIterator


XSHashTable::Iterator

Type Definition XSHashTable::Iterator

typedef XSHashTableIt<T,K,H,Eq> XSHashTable::Iterator


XSHashTable::~XSHashTable

Method XSHashTable::~XSHashTable

XSHashTable::~XSHashTable()

Destructor.

Remarks

Release the elements contained in the hash table. If you were storing pointers, you need first to iterate on the table and call delete on each pointer.


XSHashTableConstIt

Class XSHashTableConstIt

Constant iterator on a hash table.

Remarks

This iterator is the only way to iterate on elements in a constant hash table. The iteration will be in no specific order, not in the insertion order. Here is an example of how to use it:

Groups

Constructors | Operators | Operations | Coercion Operators | Comparison Operators

Constructors
Method XSHashTableConstIt | Default constructor of the iterator.
Operators
Method operator* | Returns a constant reference on the data pointed by the iterator.
Method operator++ | Jumps to next entry in the hashtable.
Operations
Method GetKey | Returns a const reference on the key of the pointed entry.
Coercion Operators
Method cast operator | Returns a pointer on a T object.
Comparison Operators
Method operator!= | Operator Equal of the iterator.
Method operator== | Operator Equal of the iterator.

Example

   void MyClass::MyMethod() const
   {
       XSHashTableConstIt<T,K,H> it = m_Hashtable.Begin();
       while (it != m_Hashtable.End()) {
access to the key
           it.GetKey();

access to the element
           *it;

next element
           ++it;
       }
   }


XSHashTableConstIt::XSHashTableConstIt

Method XSHashTableConstIt::XSHashTableConstIt

XSHashTableConstIt::XSHashTableConstIt()
XSHashTableConstIt::XSHashTableConstIt(const tConstIterator& n)

Default constructor of the iterator.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XSHashTableConstIt::operator*

Method XSHashTableConstIt::operator*

const T& XSHashTableConstIt::operator*() const

Returns a constant reference on the data pointed by the iterator.

Returns

The object pointed to by this object.

Remarks

The returned reference is constant, so you can't modify its value. Use the other * operator for this purpose.


XSHashTableConstIt::operator++

Method XSHashTableConstIt::operator++

tConstIterator& XSHashTableConstIt::operator++()
tConstIterator XSHashTableConstIt::operator++(int)

Jumps to next entry in the hashtable.

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XSHashTableConstIt::GetKey

Method XSHashTableConstIt::GetKey

const K& XSHashTableConstIt::GetKey() const

Returns a const reference on the key of the pointed entry.


XSHashTableConstIt::cast operator

Method XSHashTableConstIt::cast operator

XSHashTableConstIt::operator const T*() const

Returns a pointer on a T object.

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XSHashTableConstIt::operator!=

Method XSHashTableConstIt::operator!=

int XSHashTableConstIt::operator!=(const tConstIterator& it) const

Operator Equal of the iterator.

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XSHashTableConstIt::operator==

Method XSHashTableConstIt::operator==

int XSHashTableConstIt::operator==(const tConstIterator& it) const

Operator Equal of the iterator.

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XSHashTableIt

Class XSHashTableIt

Iterator on a hash table.

Remarks

This iterator is the only way to iterate on elements in a hash table. The iteration will be in no specific order, not in the insertion order. Here is an example of how to use it:

Groups

Constructors | Operators | Operations | Coercion Operators | Comparison Operators

Constructors
Method XSHashTableIt | Default constructor of the iterator.
Operators
Method operator* | Returns a constant reference on the data pointed by the iterator.
Method operator++ | Jumps to next entry in the hashtable.
Operations
Method GetKey | Returns a const reference on the key of the pointed entry.
Coercion Operators
Method cast operator | Returns a pointer on a T object.
Comparison Operators
Method operator!= | Operator Equal of the iterator.
Method operator== | Operator Equal of the iterator.

Example

   XSHashTableIt<T,K,H> it = hashtable.Begin();
   while (it != hashtable.End()) {
access to the key
       it.GetKey();

access to the element
       *it;

next element
       ++it;
   }


XSHashTableIt::XSHashTableIt

Method XSHashTableIt::XSHashTableIt

XSHashTableIt::XSHashTableIt()
XSHashTableIt::XSHashTableIt(const tIterator& n)

Default constructor of the iterator.

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XSHashTableIt::operator*

Method XSHashTableIt::operator*

const T& XSHashTableIt::operator*() const
T& XSHashTableIt::operator*()

Returns a constant reference on the data pointed by the iterator.

Returns

The object pointed to by this object.

Remarks

The returned reference is constant, so you can't modify its value. Use the other * operator for this purpose.


XSHashTableIt::operator++

Method XSHashTableIt::operator++

tIterator& XSHashTableIt::operator++()
tIterator XSHashTableIt::operator++(int)

Jumps to next entry in the hashtable.

Returns

A reference to the current object.

Remarks

Description: Prefix Increment Operator

This increments the current object.


XSHashTableIt::GetKey

Method XSHashTableIt::GetKey

const K& XSHashTableIt::GetKey() const

Returns a const reference on the key of the pointed entry.


XSHashTableIt::cast operator

Method XSHashTableIt::cast operator

XSHashTableIt::operator const T*() const

Returns a pointer on a T object.

Remarks

Description: Converts to another type.

This converts the current object to a particular type.


XSHashTableIt::operator!=

Method XSHashTableIt::operator!=

int XSHashTableIt::operator!=(const tIterator& it) const

Operator Equal of the iterator.

Returns

This returns true if this object is not the same as the one on the right-hand-side of the operator.

Remarks

Description: Not-Equals Operator


XSHashTableIt::operator==

Method XSHashTableIt::operator==

int XSHashTableIt::operator==(const tIterator& it) const

Operator Equal of the iterator.

Returns

This returns true if this object is the same as the one on the right-hand-side of the operator.

Remarks

Description: Equality Operator


XSHashTablePair

Class XSHashTablePair

Struct containing an iterator on an object inserted and a BOOL determining if it were really inserted (TRUE) or already there (FALSE).

Groups

Data Members
Member Variable m_Iterator |
Member Variable m_New |
Constructors
Method XSHashTablePair | Description: Builds an instance of the object This builds an instance of the object out of its parameters.


XSHashTablePair::m_Iterator

Member Variable XSHashTablePair::m_Iterator

XSHashTableIt<T,K,H> XSHashTablePair::m_Iterator


XSHashTablePair::m_New

Member Variable XSHashTablePair::m_New

BOOL XSHashTablePair::m_New


XSHashTablePair::XSHashTablePair

Method XSHashTablePair::XSHashTablePair

XSHashTablePair::XSHashTablePair(XSHashTableIt<T,K,H> it,int n)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


Memory

Class VxAllocator | Memory management
Class VxMemoryPool | Memory buffer class.
Class VxPoolObject | A base class for fixed sized object that should be placed in fixed size pools.
Class VxScratch | Class to allocate some scratch memory.
Class VxScratchString | Class to allocate some scratch memory for a string.
Class XStringTokenizer | Tokenize a string.

See Also

VxMath Reference


VxAllocator

Class VxAllocator

Memory management

Groups

Constructors
Method VxAllocator | CTor
Operations
Method Allocate | Standard Allocation
Method AllocateMemory | allocate the general memory
Method AllocatePool | allocate memory in a fixed size pool
Method AllocatePoolObject | allocate an object from a fixed size pool
Method AllocateScratch | allocate a scratch (temporary usage) memory
Method AllocateScratchString | allocate a scratch (temporary usage) string
Method AllocateString | allocate a string
Method DeleteAllAllocatedDatas |
Method DumpStats | dump the stats into a file
Method GetAllocatedScratchCount | Returns the count of scratch pool
Method GetAllocatedScratchMemory | Returns the total memory allocated for scratch
Method GetGlobalStats |
Static Object Method Instance | Gets an instance on the allocator
Method Release | Standard Deallocation
Method ReleaseMemory | Release the general memory
Method ReleasePool | Release memory allocated by a fixed size pool
Method ReleasePoolObject | Release an object from a fixed size pool
Method ReleaseScratch | Release the scratch memory
Method ReleaseScratchString | allocate the scratch string
Method ReleaseString | string deallocation
Method ReleaseUnusedScratch | Free the memory allocated by unused scratch pools
Method UpdateSymbols | Updates the debug symbols
Classes
Class Stats | Types
Destructors
Method ~VxAllocator | Dtor


VxAllocator::VxAllocator

Method VxAllocator::VxAllocator

VxAllocator::VxAllocator()

Remarks

CTor


VxAllocator::Allocate

Method VxAllocator::Allocate

void* VxAllocator::Allocate(size_t iSize)

Remarks

Standard Allocation


VxAllocator::AllocateMemory

Method VxAllocator::AllocateMemory

void* VxAllocator::AllocateMemory(size_t iSize)

Remarks

allocate the general memory


VxAllocator::AllocatePool

Method VxAllocator::AllocatePool

void* VxAllocator::AllocatePool(size_t iSize)

Remarks

allocate memory in a fixed size pool


VxAllocator::AllocatePoolObject

Method VxAllocator::AllocatePoolObject

template <class T>
T* VxAllocator::AllocatePoolObject(T* iDummy)

Remarks

allocate an object from a fixed size pool


VxAllocator::AllocateScratch

Method VxAllocator::AllocateScratch

void* VxAllocator::AllocateScratch(size_t iSize)

Remarks

allocate a scratch (temporary usage) memory


VxAllocator::AllocateScratchString

Method VxAllocator::AllocateScratchString

XString* VxAllocator::AllocateScratchString()

Remarks

allocate a scratch (temporary usage) string


VxAllocator::AllocateString

Method VxAllocator::AllocateString

char* VxAllocator::AllocateString(const char* iString)
char* VxAllocator::AllocateString(unsigned int iSize)

Remarks

allocate a string


VxAllocator::DeleteAllAllocatedDatas

Method VxAllocator::DeleteAllAllocatedDatas

void VxAllocator::DeleteAllAllocatedDatas()


VxAllocator::DumpStats

Method VxAllocator::DumpStats

void VxAllocator::DumpStats(const char* iFile)

Remarks

dump the stats into a file


VxAllocator::GetAllocatedScratchCount

Method VxAllocator::GetAllocatedScratchCount

int VxAllocator::GetAllocatedScratchCount()

Remarks

Returns the count of scratch pool


VxAllocator::GetAllocatedScratchMemory

Method VxAllocator::GetAllocatedScratchMemory

size_t VxAllocator::GetAllocatedScratchMemory()

Remarks

Returns the total memory allocated for scratch


VxAllocator::GetGlobalStats

Method VxAllocator::GetGlobalStats

const Stats& VxAllocator::GetGlobalStats() const


VxAllocator::Instance

Static Object Method VxAllocator::Instance

static VxAllocator& VxAllocator::Instance()

Remarks

Gets an instance on the allocator


VxAllocator::Release

Method VxAllocator::Release

void VxAllocator::Release(void* iMem)

Remarks

Standard Deallocation


VxAllocator::ReleaseMemory

Method VxAllocator::ReleaseMemory

void VxAllocator::ReleaseMemory(void* iMem)

Remarks

Release the general memory


VxAllocator::ReleasePool

Method VxAllocator::ReleasePool

void VxAllocator::ReleasePool(size_t iSize, void* iMem)

Remarks

Release memory allocated by a fixed size pool


VxAllocator::ReleasePoolObject

Method VxAllocator::ReleasePoolObject

template <class T>
void VxAllocator::ReleasePoolObject(T* iMem)

Remarks

Release an object from a fixed size pool


VxAllocator::ReleaseScratch

Method VxAllocator::ReleaseScratch

void
VxAllocator::ReleaseScratch(void* iMemory)

Remarks

Release the scratch memory


VxAllocator::ReleaseScratchString

Method VxAllocator::ReleaseScratchString

void
VxAllocator::ReleaseScratchString(XString* iString)

Remarks

allocate the scratch string


VxAllocator::ReleaseString

Method VxAllocator::ReleaseString

void
VxAllocator::ReleaseString(char* iString)

Remarks

string deallocation


VxAllocator::ReleaseUnusedScratch

Method VxAllocator::ReleaseUnusedScratch

void VxAllocator::ReleaseUnusedScratch()

Remarks

Free the memory allocated by unused scratch pools


VxAllocator::UpdateSymbols

Method VxAllocator::UpdateSymbols

void VxAllocator::UpdateSymbols(const char* iModule)

Remarks

Updates the debug symbols


VxAllocator::Stats

Class VxAllocator::Stats

Remarks

Types

Groups

Data Members
Member Variable accumulated |
Member Variable peak |
Member Variable size |
Member Variable total |
Constructors
Method Stats | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method Add |
Method Remove |
Comparison Operators
Method operator< | Description: Less-Than Operator


VxAllocator::Stats::accumulated

Member Variable VxAllocator::Stats::accumulated

int VxAllocator::Stats::accumulated


VxAllocator::Stats::peak

Member Variable VxAllocator::Stats::peak

int VxAllocator::Stats::peak


VxAllocator::Stats::size

Member Variable VxAllocator::Stats::size

int VxAllocator::Stats::size


VxAllocator::Stats::total

Member Variable VxAllocator::Stats::total

int VxAllocator::Stats::total


VxAllocator::Stats::Stats

Method VxAllocator::Stats::Stats

VxAllocator::Stats::Stats()

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxAllocator::Stats::Add

Method VxAllocator::Stats::Add

void VxAllocator::Stats::Add(int i=1)


VxAllocator::Stats::Remove

Method VxAllocator::Stats::Remove

void VxAllocator::Stats::Remove(int i=1)


VxAllocator::Stats::operator<

Method VxAllocator::Stats::operator<

int VxAllocator::Stats::operator< (const Stats& iS) const

Returns

This returns true if this object is less than the one on the right-hand-side of the operator.

Remarks

Description: Less-Than Operator


VxAllocator::~VxAllocator

Method VxAllocator::~VxAllocator

VxAllocator::~VxAllocator()

Remarks

Dtor


VxMemoryPool

Class VxMemoryPool

Memory buffer class.

Remarks

  • This class is designed to be used as a local or global variable that handles a memory buffer that will be automatically deleted on destruction.

  • The memory buffer is aligned on a 16 bytes boundary (64 on a PS2 system)

  • Do not call delete on the buffer returned by Buffer() method.

Groups

Constructors
Method VxMemoryPool | Constructs the class allocating the buffer to ByteCount bytes.
Operations
Method Allocate | Allocates the number of bytes if not yet allocated.
Method AllocatedSize | Returns allocated size of this memory pool.
Method Buffer | Returns access to the memory buffer.

See Also

VxNewAligned,VxDeleteAligned


VxMemoryPool::VxMemoryPool

Method VxMemoryPool::VxMemoryPool

VxMemoryPool::VxMemoryPool(size_t ByteCount=0)

Remarks

Constructs the class allocating the buffer to ByteCount bytes.


VxMemoryPool::Allocate

Method VxMemoryPool::Allocate

void VxMemoryPool::Allocate(size_t ByteCount)

Remarks

Allocates the number of bytes if not yet allocated.


VxMemoryPool::AllocatedSize

Method VxMemoryPool::AllocatedSize

size_t VxMemoryPool::AllocatedSize() const

Remarks

Returns allocated size of this memory pool.


VxMemoryPool::Buffer

Method VxMemoryPool::Buffer

void* VxMemoryPool::Buffer() const

Remarks

Returns access to the memory buffer.


VxPoolObject

Class VxPoolObject

A base class for fixed sized object that should be placed in fixed size pools.

Subclasses

CKAnimController, CKBufferParser, and CKSkin

Remarks

This class force the usage of a virtual destructor so it should not be used with small structures of known size that does not need a virtual table. Instead for a class to be automatically placed in a fixed size pool use the IMPLEMENT_POOL macro that will redefines the new and delete operator for this class

Groups

Destructors
Virtual Method Method ~VxPoolObject

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxPoolObject::~VxPoolObject

Virtual Method Method VxPoolObject::~VxPoolObject

virtual VxPoolObject::~VxPoolObject()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxScratch

Class VxScratch

Class to allocate some scratch memory.

Remarks

Allocates a scratch for temporary needs. This class release the memory when it has finished

Groups

Constructors
Method VxScratch | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method Check |
Method Mem |
Destructors
Method ~VxScratch | Description: Destroys the object This destroys all the subordinate objects for this object.


VxScratch::VxScratch

Method VxScratch::VxScratch

VxScratch::VxScratch(size_t iSize=0)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxScratch::Check

Method VxScratch::Check

void* VxScratch::Check(size_t iSize)


VxScratch::Mem

Method VxScratch::Mem

void* VxScratch::Mem()


VxScratch::~VxScratch

Method VxScratch::~VxScratch

VxScratch::~VxScratch()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


VxScratchString

Class VxScratchString

Class to allocate some scratch memory for a string.

Remarks

Allocates a scratch for temporary needs. This class release the memory when it has finished

Groups

Constructors
Method VxScratchString | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operators
Method operator* | Description: Dereference Operator
Method operator-> | Description: Dereference Operator
Destructors
Method ~VxScratchString | Description: Destroys the object This destroys all the subordinate objects for this object.


VxScratchString::VxScratchString

Method VxScratchString::VxScratchString

VxScratchString::VxScratchString(const char* iString = "")

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


VxScratchString::operator*

Method VxScratchString::operator*

XString& VxScratchString::operator* () const

Returns

The object pointed to by this object.

Remarks

Description: Dereference Operator


VxScratchString::operator->

Method VxScratchString::operator->

XString* VxScratchString::operator-> () const

Returns

The object pointed to this object when it is being dereferenced for the purposes of finding a component of the pointed-to object.

Remarks

Description: Dereference Operator


VxScratchString::~VxScratchString

Method VxScratchString::~VxScratchString

VxScratchString::~VxScratchString()

Remarks

Description: Destroys the object

This destroys all the subordinate objects for this object.


XStringTokenizer

Class XStringTokenizer

Tokenize a string.

Groups

Constructors
Method XStringTokenizer | Description: Builds an instance of the object This builds an instance of the object out of its parameters.
Operations
Method NextToken |


XStringTokenizer::XStringTokenizer

Method XStringTokenizer::XStringTokenizer

XStringTokenizer::XStringTokenizer(const char* iString, const char* iSeparators)

Remarks

Description: Builds an instance of the object

This builds an instance of the object out of its parameters.


XStringTokenizer::NextToken

Method XStringTokenizer::NextToken

const char*
XStringTokenizer::NextToken(const char* iPrevToken)


Type definitions

Enumerated Type VX_OSINFO | Operating systems enumeration.
Enumerated Type VX_PIXELFORMAT | Pixel format types.
Enumerated Type VX_PLATFORMINFO | Platform enumeration.
Enumerated Type VXCLIP_FLAGS | Vertex clipping flags.
Enumerated Type VXCURSOR_POINTER | Appearance of mouse cursor.
Enumerated Type VxMMF_Error | Possible return value when opening a memory mapped file.
Type Definition VxSortFunc | Sort function prototype for XArray,XBinaryTree sort operations
Enumerated Type VXTHREAD_PRIORITY | Enumeration of possible priority for a thread.
Enumerated Type VXTHREAD_STATE | VxThread state
Type Definition VxThreadFunction | Prototype of a function which will be executed by a VxThread.
Enumerated Type VXTHREADWIN32_FLAGS | VxThread FLAGS

See Also

VxMath Reference


VX_OSINFO

Enumerated Type VX_OSINFO

enum VX_OSINFO {
VXOS_UNKNOWN,
VXOS_WIN31,
VXOS_WIN95,
VXOS_WIN98,
VXOS_WINME,
VXOS_WINNT4,
VXOS_WIN2K,
VXOS_WINXP,
VXOS_MACOS9,
VXOS_MACOSX,
VXOS_XBOX,
VXOS_LINUXX86,
VXOS_WINCE1,
VXOS_WINCE2,
VXOS_WINCE3,
VXOS_PSX2,
VXOS_XBOX2,
VXOS_WINVISTA,
VXOS_PSP,
VXOS_XBOX360,
VXOS_WII,
VXOS_WINSEVEN
}

Operating systems enumeration.

Members

VXOS_LINUXX86
VXOS_MACOS9
VXOS_MACOSX
VXOS_PSP
VXOS_PSX2
VXOS_UNKNOWN
VXOS_WII
VXOS_WIN2K
VXOS_WIN31
VXOS_WIN95
VXOS_WIN98
VXOS_WINCE1
VXOS_WINCE2
VXOS_WINCE3
VXOS_WINME
VXOS_WINNT4
VXOS_WINSEVEN
VXOS_WINVISTA
VXOS_WINXP
VXOS_XBOX
VXOS_XBOX2
VXOS_XBOX360

See Also

VxGetOs


VX_PIXELFORMAT

Enumerated Type VX_PIXELFORMAT

#define NB_STDPIXEL_FORMATS 19
#define MAX_PIXEL_FORMATS 34
enum VX_PIXELFORMAT {
UNKNOWN_PF = 0,
_32_ARGB8888 = 1,
_32_RGB888 = 2,
_24_RGB888 = 3,
_16_RGB565 = 4,
_16_RGB555 = 5,
_16_ARGB1555 = 6,
_16_ARGB4444 = 7,
_8_RGB332 = 8,
_8_ARGB2222 = 9,
_32_ABGR8888 = 10,
_32_RGBA8888 = 11,
_32_BGRA8888 = 12,
_32_BGR888 = 13,
_24_BGR888 = 14,
_16_BGR565 = 15,
_16_BGR555 = 16,
_16_ABGR1555 = 17,
_16_ABGR4444 = 18,
_DXT1 = 19,
_DXT2 = 20,
_DXT3 = 21,
_DXT4 = 22,
_DXT5 = 23,
_16_V8U8 = 24,
_32_V16U16 = 25,
_16_L6V5U5 = 26,
_32_X8L8V8U8 = 27,

_16_R16F = 28,
_32_GR16F = 29,
_64_ABGR16F = 30,

_32_R32F = 31,
_64_GR32F = 32,
_128_ABGR32F = 33,

_8_ABGR8888_CLUT = 34,
_8_ARGB8888_CLUT = 35,
_4_ABGR8888_CLUT = 36,
_4_ARGB8888_CLUT = 37,

_32_D24_S8 = 38,
_16_D16 = 39

}

Pixel format types.

Members

_128_ABGR32F | 4*32 bits floating point IEEE
_16_ABGR1555 | 16-bit ABGR pixel format (5 bits per color + 1 bit for alpha)
_16_ABGR4444 | 16-bit ABGR pixel format (4 bits per color)
_16_ARGB1555 | 16-bit ARGB pixel format (5 bits per color + 1 bit for alpha)
_16_ARGB4444 | 16-bit ARGB pixel format (4 bits per color)
_16_BGR555 | 16-bit BGR pixel format (5 bits per color)
_16_BGR565 | 16-bit BGR pixel format
_16_D16 |
_16_L6V5U5 | 16-bit Bump Map format format with luminance
_16_R16F | 1*16 bits floating point
_16_RGB555 | 16-bit RGB pixel format (5 bits per color)
_16_RGB565 | 16-bit RGB pixel format
_16_V8U8 | 16-bit Bump Map format format (8 bits per color)
_24_BGR888 | 24-bit BGR pixel format
_24_RGB888 | 24-bit RGB pixel format
_32_ABGR8888 | 32-bit ABGR pixel format
_32_ARGB8888 | 32-bit ARGB pixel format with alpha
_32_BGR888 | 32-bit BGR pixel format
_32_BGRA8888 | 32-bit BGRA pixel format
_32_D24_S8 | 24 bits shadow map with 8 bits for stencil
_32_GR16F | 2*16 bits floating point
_32_R32F | 1*32 bits floating point IEEE
_32_RGB888 | 32-bit RGB pixel format without alpha
_32_RGBA8888 | 32-bit RGBA pixel format
_32_V16U16 | 32-bit Bump Map format format (16 bits per color)
_32_X8L8V8U8 | 32-bit Bump Map format format with luminance
_4_ABGR8888_CLUT | 4 bits indexed CLUT (ABGR)
_4_ARGB8888_CLUT | 4 bits indexed CLUT (ARGB)
_64_ABGR16F | 4*16 bits floating point
_64_GR32F | 2*32 bits floating point IEEE
_8_ABGR8888_CLUT | 8 bits indexed CLUT (ABGR)
_8_ARGB2222 | 8-bit ARGB pixel format
_8_ARGB8888_CLUT | 8 bits indexed CLUT (ARGB)
_8_RGB332 | 8-bit RGB pixel format
_DXT1 | S3/DirectX Texture Compression 1
_DXT2 | S3/DirectX Texture Compression 2
_DXT3 | S3/DirectX Texture Compression 3
_DXT4 | S3/DirectX Texture Compression 4
_DXT5 | S3/DirectX Texture Compression 5
UNKNOWN_PF | Unknown pixel format

See Also

VxImageDesc2PixelFormat,VxPixelFormat2ImageDesc


VX_PLATFORMINFO

Enumerated Type VX_PLATFORMINFO

enum VX_PLATFORMINFO {
VXPLATFORM_UNKNOWN = -1,
VXPLATFORM_WINDOWS = 0,
VXPLATFORM_MAC = 1,
VXPLATFORM_XBOX = 2,
VXPLATFORM_WINCE = 3,
VXPLATFORM_LINUX = 4,
VXPLATFORM_PSX2 = 5,
VXPLATFORM_XBOX2 = 6,
VXPLATFORM_PSP = 7,
VXPLATFORM_WII = 8,
}

Platform enumeration.

Members

VXPLATFORM_LINUX
VXPLATFORM_MAC
VXPLATFORM_PSP
VXPLATFORM_PSX2
VXPLATFORM_UNKNOWN
VXPLATFORM_WII
VXPLATFORM_WINCE
VXPLATFORM_WINDOWS
VXPLATFORM_XBOX
VXPLATFORM_XBOX2

See Also

VxGetPlatform


VXCLIP_FLAGS

Enumerated Type VXCLIP_FLAGS

enum VXCLIP_FLAGS
{
VXCLIP_LEFT = 0x00000010,
VXCLIP_RIGHT = 0x00000020,
VXCLIP_TOP = 0x00000040,
VXCLIP_BOTTOM = 0x00000080,
VXCLIP_FRONT = 0x00000100,
VXCLIP_BACK = 0x00000200,
VXCLIP_BACKFRONT= 0x00000300,
VXCLIP_ALL = 0x000003F0,
}

Vertex clipping flags.

Members

VXCLIP_ALL | All flags Combined
VXCLIP_BACK | Vertex is clipped by the rear viewing plane
VXCLIP_BACKFRONT | Combination of BACK and FRONT flags
VXCLIP_BOTTOM | Vertex is clipped by the bottom viewing plane
VXCLIP_FRONT | Vertex is clipped by the front viewing plane
VXCLIP_LEFT | Vertex is clipped by the left viewing plane
VXCLIP_RIGHT | Vertex is clipped by the right viewing plane
VXCLIP_TOP | Vertex is clipped by the top viewing plane

Remarks

When using functions such as VxTransformBox2D which performs frustum tests, vertices are assigned clipping flags to indicate in which part of the viewing frustum they are.

See Also

VxTransformBox2D


VXCURSOR_POINTER

Enumerated Type VXCURSOR_POINTER

enum VXCURSOR_POINTER {
VXCURSOR_NORMALSELECT=1,
VXCURSOR_BUSY=2,
VXCURSOR_MOVE=3,
VXCURSOR_LINKSELECT=4
}

Appearance of mouse cursor.

Members

VXCURSOR_BUSY | Display the busy (hourglass) cursor
VXCURSOR_LINKSELECT | Display the link select (hand) cursor
VXCURSOR_MOVE | Display the move cursor
VXCURSOR_NORMALSELECT | Display the standard arrow cursor

Remarks

Cursor function

See Also

VxSetCursor


VxMMF_Error

Enumerated Type VxMMF_Error

enum VxMMF_Error {
VxMMF_NoError,
VxMMF_FileOpen,
VxMMF_FileMapping,
VxMMF_MapView
}

Possible return value when opening a memory mapped file.

Members

VxMMF_FileMapping | Cannot create file mapping
VxMMF_FileOpen | Cannot open file
VxMMF_MapView | Cannot get a pointer to start of map
VxMMF_NoError | No error

See Also

VxMemoryMappedFile::GetErrorType


VxSortFunc

Type Definition VxSortFunc

typedef int (__cdecl *VxSortFunc)(const void *elem1, const void *elem2 )

Sort function prototype for XArray,XBinaryTree sort operations


VXTHREAD_PRIORITY

Enumerated Type VXTHREAD_PRIORITY

enum VXTHREAD_PRIORITY
{
VXTP_NORMAL = 0,
VXTP_ABOVENORMAL = 1,
VXTP_BELOWNORMAL = 2,
VXTP_HIGHLEVEL = 3,
VXTP_LOWLEVEL = 4,
VXTP_IDLE = 5,
VXTP_TIMECRITICAL = 6,
}

Enumeration of possible priority for a thread.

Members

VXTP_ABOVENORMAL
VXTP_BELOWNORMAL
VXTP_HIGHLEVEL
VXTP_IDLE
VXTP_LOWLEVEL
VXTP_NORMAL
VXTP_TIMECRITICAL

See Also

VxThread,VxThread::SetPriority(unsigned int priority).


VXTHREAD_STATE

Enumerated Type VXTHREAD_STATE

enum VXTHREAD_STATE
{
VXTS_INITIALE = 0x00000000L,
VXTS_MAIN = 0x00000001L,
VXTS_CREATED = 0x00000002L,
VXTS_STARTED = 0x00000004L,
VXTS_JOINABLE = 0x00000008L
}

VxThread state

Members

VXTS_CREATED | The system thread associated with the current thread object was correctly created.
VXTS_INITIALE | Initiale state of a thread object (at this time the system thread isn't created).
VXTS_JOINABLE | The thread is joinable (it means you can call VxThread::Join). Under Windows thread are always joinable.
VXTS_MAIN | The thread is the main thread
VXTS_STARTED | The thread has been started.

See Also

VxThread, VxThread::Join.


VxThreadFunction

Type Definition VxThreadFunction

typedef unsigned int VxThreadFunction(void* args)

Prototype of a function which will be executed by a VxThread.

Returns

You must return a value greater than 0 if you want define your own return value. Otherwise you can return a NKERROR value.

Remarks

if !defined(_LINUX) && !defined(macintosh)

You can also overload VxThread::Run instead of creating an external function

See Also

VxThread, VxThread::Run, NKERROR.


VXTHREADWIN32_FLAGS

Enumerated Type VXTHREADWIN32_FLAGS

enum VXTHREADWIN32_FLAGS
{
VXTF_USECOINITIALIZEEX = 0x00000001,
VXTF_USECOINITIALIZE = 0x00000002,
VXTF_NOCOINITIALIZE = 0x00000004,
}

VxThread FLAGS

Members

VXTF_NOCOINITIALIZE | The ThreadFunc will call neither CoInitialize, nor CoInitializeEx, nor CoUninitialize.
VXTF_USECOINITIALIZE | The ThreadFunc will call CoInitialize and CoUninitialize. (default)
VXTF_USECOINITIALIZEEX | The ThreadFunc will call CoInitializeEx and CoUninitialize.

Remarks

Win32 specific

See Also

VxThread, VxThread::Join.


Available Source Code

Behaviors Plugins :

The Behaviors.sln solution is a good entry point to examine the source code of the behaviors : you can find the source code for almost all the behaviors available in the standard edition in the "Virtools SDK"\Samples\Behaviors" directory.

Other Plugins:

The plugins.sln solutions contains the following samples:

In the "Virtools SDK"\Samples\Plugins" directory you will find the source code for the 4 types of Media Plugins available in Virtools :

  • Avi Reader : A .avi movie file reader.
  • DDS Reader: A .dds (DirectDrawSurface) bitmap reader.
  • Wav Reader: A .wav (Sound file) sound reader.
  • X Loader : A DirectX .X model file reader.

  • Sound Manager: For those who would be intersted in using another sound engine or for a sample manager (others are availables in the behaviors samples). Project is located in "Virtools SDK"\Samples\DX7 Sound Manager"

Shader Editor:

High Level Language shaders were introduced as an external plugin using the Interface SDK in Dev 3.0. The complete source code for both the editor used to edit shaders in the interface("Virtools SDK"\Samples\Plugins\Interface Plugins\Shader Editor"), manager and behaviors ("Virtools SDK"\Samples\Behaviors\Shader") are available.

3DSMax 8 Exporter:

If you are interested in creating your own exporter for another modeling software, these sources are definitely the good starting point. The 3DSMax Exporter project is available though the MaxEporter.Sln solution

Standalone Player:

A good starting for creating your standalone application is to use this sample player in the Player.sln solution.Fully commented source code for a new standalone Player is now available, explaining how a stand alone player can communicate with Virtools content using attributes to go fullscreen, change resolution, etc. The sample source code can be used to compile your own stand alone player. NOTE: Licensing Agreement for Custom Players is still required.


_CKStartUp

Class Hierarchy

External Function _CKStartUp

CKERROR _CKStartUp(INSTANCE_HANDLE hInstance)


CKInitCustomPlayer

Class Hierarchy

External Function CKInitCustomPlayer

extern "C" void CKInitCustomPlayer(BOOL iDebug)


CKStartUp

Class Hierarchy

External Function CKStartUp

inline CKERROR CKStartUp(INSTANCE_HANDLE hInstance=NULL)


GetTempFileName

Class Hierarchy

External Function GetTempFileName

BOOL GetTempFileName(const char* Path,const char * prefixe,int , char*oName)


getWindowsOffset

Class Hierarchy

External Function getWindowsOffset

Vx2DVector& getWindowsOffset()


SetWindowsOffset

Class Hierarchy

External Function SetWindowsOffset

void SetWindowsOffset(int x, int y)


VxClientToScreen

Class Hierarchy

External Function VxClientToScreen

BOOL VxClientToScreen (WIN_HANDLE Win,CKPOINT* pt)


VxConvertBitmap

Class Hierarchy

External Function VxConvertBitmap

BYTE* VxConvertBitmap (BITMAP_HANDLE Bitmap,VxImageDescEx& desc)


VxConvertBitmapTo24

Class Hierarchy

External Function VxConvertBitmapTo24

BITMAP_HANDLE VxConvertBitmapTo24 (BITMAP_HANDLE _Bitmap)


VxConvertEndianArray16

Class Hierarchy

External Function VxConvertEndianArray16

void VxConvertEndianArray16(void* buf,unsigned int DwordCount)


VxConvertEndianArray32

Class Hierarchy

External Function VxConvertEndianArray32

void VxConvertEndianArray32(void* buf,unsigned int DwordCount)


VxCopyBitmap

Class Hierarchy

External Function VxCopyBitmap

BOOL VxCopyBitmap (BITMAP_HANDLE Bitmap,const VxImageDescEx& desc)


VxCreateBitmap

Class Hierarchy

External Function VxCreateBitmap

BITMAP_HANDLE VxCreateBitmap (const VxImageDescEx& desc)

Remarks

Bitmap Functions


VxCreateFileTree

Class Hierarchy

External Function VxCreateFileTree

BOOL VxCreateFileTree(char *file)

Remarks

Recreates the whole file path (not the file itself)


VxCreateFont

Class Hierarchy

External Function VxCreateFont

FONT_HANDLE VxCreateFont (char* FontName,int FontSize,int Weight,BOOL italic,BOOL underline)

Remarks

Font Functions


VxDeleteBitmap

Class Hierarchy

External Function VxDeleteBitmap

void VxDeleteBitmap (BITMAP_HANDLE BitmapHandle)


VxDeleteDirectory

Class Hierarchy

External Function VxDeleteDirectory

BOOL VxDeleteDirectory(char* path)


VxDeleteFile

Class Hierarchy

External Function VxDeleteFile

BOOL VxDeleteFile(const char* iPath)


VxDeleteFont

Class Hierarchy

External Function VxDeleteFont

void VxDeleteFont (FONT_HANDLE Font)


VxDrawBitmapTextW

Class Hierarchy

External Function VxDrawBitmapTextW

BOOL VxDrawBitmapTextW (BITMAP_HANDLE Bitmap,FONT_HANDLE Font,unsigned short* string,CKRECT* rect,DWORD Align,DWORD BkColor,DWORD FontColor)


VxEndian16Swap

Class Hierarchy

External Function VxEndian16Swap

unsigned short int VxEndian16Swap(unsigned short int x)


VxEndian32Swap

Class Hierarchy

External Function VxEndian32Swap

unsigned int VxEndian32Swap(unsigned int x)


VxGetClientRect

Class Hierarchy

External Function VxGetClientRect

BOOL VxGetClientRect (WIN_HANDLE Win,CKRECT* rect)


VxGetDirectory

Class Hierarchy

External Function VxGetDirectory

XString VxGetDirectory(int FolderType)


VxGetModuleFileName

Class Hierarchy

External Function VxGetModuleFileName

DWORD VxGetModuleFileName(INSTANCE_HANDLE Handle,char* string,DWORD StringSize)

Remarks

Process access


VxGetMouseButtonsSwapped

Class Hierarchy

External Function VxGetMouseButtonsSwapped

BOOL VxGetMouseButtonsSwapped ()


VxGetParent

Class Hierarchy

External Function VxGetParent

WIN_HANDLE VxGetParent(WIN_HANDLE Win)


VxGetTempPath

Class Hierarchy

External Function VxGetTempPath

XString VxGetTempPath()


VxGetV3DLAppSupportDirectory

Class Hierarchy

External Function VxGetV3DLAppSupportDirectory

BOOL VxGetV3DLAppSupportDirectory(char* Path)


VxGetWindowRect

Class Hierarchy

External Function VxGetWindowRect

BOOL VxGetWindowRect (WIN_HANDLE Win,CKRECT* rect)


VxMakeDirectory

Class Hierarchy

External Function VxMakeDirectory

BOOL VxMakeDirectory(char* path)


VxMoveWindow

Class Hierarchy

External Function VxMoveWindow

BOOL VxMoveWindow(WIN_HANDLE Win,int x,int y,int Width,int Height,BOOL Repaint)


VxRemoveDirectory

Class Hierarchy

External Function VxRemoveDirectory

BOOL VxRemoveDirectory(char* path)


VxScreenToClient

Class Hierarchy

External Function VxScreenToClient

BOOL VxScreenToClient (WIN_HANDLE Win,CKPOINT* pt)


VxSetParent

Class Hierarchy

External Function VxSetParent

WIN_HANDLE VxSetParent(WIN_HANDLE Child,WIN_HANDLE Parent)


VxTestDiskSpace

Class Hierarchy

External Function VxTestDiskSpace

BOOL VxTestDiskSpace(const char* dir,DWORD size)


VxWindowFromPoint

Class Hierarchy

External Function VxWindowFromPoint

WIN_HANDLE VxWindowFromPoint(CKPOINT pt)

Remarks

Window Functions


CK_PARAMETERGETCUSTOMOBJECTFUNCTION

Class Hierarchy

Type Definition CK_PARAMETERGETCUSTOMOBJECTFUNCTION

typedef int (*CK_PARAMETERGETCUSTOMOBJECTFUNCTION)(CKParameter* iParam,int iIndex,CKCustomParameter* ioObject)

Remarks

if iIndex<0 || oObjec==0, the function shall return object count otherwise, shall return 0 if failed, 1 otherwise, adress of an existing instance of CKCustomParameter should be given


CKCustomParameter

Class Hierarchy

Structure CKCustomParameter

struct CKCustomParameter
{
int id;
const char* name;
}

Members

id
name

Remarks

for custom parameters, in use with CustomObjectParameterDialog


CKMessageHandler

Class Hierarchy

Type Definition CKMessageHandler

typedef XBOOL (CKMessageHandler)(CKMessage* msg)

A message handler used to override CKMessageManager::SendMessage behavior.

Remarks

A message handler taking a CKMessage and returning a XBOOL If no handler is set, the message manager will behave normally If a handler is set, the CKMessageManager::SendMessage will call it, unless specified otherwise If the handler returns true, the message won't be processed by SendMessage

See Also

CKContext::GetMessageManager,CKMessage,CKMessageManager


CKRST_STRETCHRECT_ERROR

Class Hierarchy

Enumerated Type CKRST_STRETCHRECT_ERROR

enum CKRST_STRETCHRECT_ERROR {
CKRST_STRETCHRECT_NO_ERROR = 0,
CKRST_STRETCHRECT_UNSUPPORTED,
CKRST_STRETCHRECT_DEST_EQUAL_SOURCE_ERROR,
CKRST_STRETCHRECT_BLIT_FROM_MULTISAMPLED_BACKBUFFER_ERROR,
CKRST_STRETCHRECT_BLIT_TO_MULTISAMPLED_BACKBUFFER_ERROR,
CKRST_STRETCHRECT_NONPOW2_SRC_TEX_ERROR,
CKRST_STRETCHRECT_NONPOW2_DEST_TEX_ERROR,
CKRST_STRETCHRECT_SRC_RECT_ERROR,
CKRST_STRETCHRECT_DEST_RECT_ERROR,
CKRST_STRETCHRECT_BAD_CUBE_FACE_ERROR,
CKRST_STRETCHRECT_OPERATION_FAILED_ERROR
}

Return from the stretch rect method

Members

CKRST_STRETCHRECT_BAD_CUBE_FACE_ERROR | Dest/Src cube face is invalid
CKRST_STRETCHRECT_BLIT_FROM_MULTISAMPLED_BACKBUFFER_ERROR | Tried to blit from a multisampled rendertarget. See CKRasterizerContext::ResumeMultisampling
CKRST_STRETCHRECT_BLIT_TO_MULTISAMPLED_BACKBUFFER_ERROR | Tried to into a multisampled rendertarget. See CKRasterizerContext::ResumeMultisampling
CKRST_STRETCHRECT_DEST_EQUAL_SOURCE_ERROR | Can't blit inside the same texture/backbuffer
CKRST_STRETCHRECT_DEST_RECT_ERROR | Dest rect is outside the dest texture / backbuffer
CKRST_STRETCHRECT_NO_ERROR |
CKRST_STRETCHRECT_NONPOW2_DEST_TEX_ERROR | The destination texture dimensions should be powers of 2 (no such restriction when blitting to backbuffer)
CKRST_STRETCHRECT_NONPOW2_SRC_TEX_ERROR | The source texture dimensions should be powers of 2 (no such restriction when blitting from backbuffer)
CKRST_STRETCHRECT_OPERATION_FAILED_ERROR | Operation failed under current multisampling / texture format conditions
CKRST_STRETCHRECT_SRC_RECT_ERROR | Source rect is outside the source texture / backbuffer
CKRST_STRETCHRECT_UNSUPPORTED | Not supported by rasterizer


VxDrawBitmapText

Class Hierarchy

External Function VxDrawBitmapText

enum VXTEXT_ALIGNMENT {
VXTEXT_CENTER =0x00000001,
VXTEXT_LEFT =0x00000002,
VXTEXT_RIGHT =0x00000004,
VXTEXT_TOP =0x00000008,
VXTEXT_BOTTOM =0x00000010,
VXTEXT_VCENTER =0x00000020,
VXTEXT_HCENTER =0x00000040,
}
BOOL VxDrawBitmapText (BITMAP_HANDLE Bitmap,FONT_HANDLE Font,char* string,CKRECT* rect,DWORD Align,DWORD BkColor,DWORD FontColor)

Members

VXTEXT_BOTTOM | Text is aligned to the bottom of the rectangle
VXTEXT_CENTER | Text is centered when written
VXTEXT_HCENTER | Text is centered horizontaly
VXTEXT_LEFT | Text is aligned to the left of the rectangle
VXTEXT_RIGHT | Text is aligned to the right of the rectangle
VXTEXT_TOP | Text is aligned to the top of the rectangle
VXTEXT_VCENTER | Text is centered verticaly


VxGetFontInfo

Class Hierarchy

External Function VxGetFontInfo

struct VXFONTINFO {
XString FaceName;
int Height;
int Weight;
BOOL Italic;
BOOL Underline;
}
BOOL VxGetFontInfo (FONT_HANDLE Font,VXFONTINFO& desc)

Members

FaceName
Height
Italic
Underline
Weight


VXSHADOWMAP_ATTENUATIONMODE

Class Hierarchy

Enumerated Type VXSHADOWMAP_ATTENUATIONMODE

enum VXSHADOWMAP_ATTENUATIONMODE
{
VXSHADOWMAP_NOATTENUATION = 0,
VXSHADOWMAP_LIGHTFACTORS,
VXSHADOWMAP_DIRECTIONALATTENUATION
}

Members

VXSHADOWMAP_DIRECTIONALATTENUATION | directionnal attenuation starting from the light casting shadows
VXSHADOWMAP_LIGHTFACTORS | use light attenuation factor and range
VXSHADOWMAP_NOATTENUATION |

Remarks

Number of taps when sampling a shadow map


VXSHADOWMAP_FALLBACKPOLICY

Class Hierarchy

Enumerated Type VXSHADOWMAP_FALLBACKPOLICY

enum VXSHADOWMAP_FALLBACKPOLICY
{
VXSHADOWMAP_NOFALLBACK = 0,
VXSHADOWMAP_PREFERSAMPLING,
VXSHADOWMAP_PREFERFILTERING,
}

Members

VXSHADOWMAP_NOFALLBACK
VXSHADOWMAP_PREFERFILTERING
VXSHADOWMAP_PREFERSAMPLING


VXSHADOWMAP_TAPCOUNT

Class Hierarchy

Enumerated Type VXSHADOWMAP_TAPCOUNT

enum VXSHADOWMAP_TAPCOUNT
{
VXSHADOWMAP_1TAP = 0,
VXSHADOWMAP_5TAPS,
VXSHADOWMAP_9TAPS,
VXSHADOWMAP_13TAPS
}

Members

VXSHADOWMAP_13TAPS
VXSHADOWMAP_1TAP
VXSHADOWMAP_5TAPS
VXSHADOWMAP_9TAPS

Remarks

Number of taps when sampling a shadow map


Class Hierarchy

Class Hierarchy

CK2dCurve

CK2dCurvePoint

CKBaseManager

CKAttributeManager

CKBehaviorManager

CKCollisionManager

CKFloorManager

CKGridManager

CKInputManager

CKMessageManager

CKMidiManager

CKParameterManager

CKPathManager

CKRenderManager

CKShaderManager

CKSoundManager

CKTimeManager

CKVariableManager

CKVideoManager

CKBehaviorContext

CKBehaviorPrototype

CKBitmapData

CKBitmapProperties

CKBlendShapeSet

CKBlendShapeVertexDelta

CKContext

CKDataReader

CKBitmapReader

CKModelReader

CKMovieReader

CKSoundReader

CKDependenciesContext

CKDirectoryParser

CKFile

CKFileExtension

CKFileExtensionShort

CKFileObject

CKFloorPoint

CKGUID

CKKey

CKFloatKey

CKBezierFloatKey

CKTCBFloatKey

CKMorphKey

CKPositionKey

CKBezierPositionKey

CKTCBPositionKey

CKRotationKey

CKTCBRotationKey

CKListenerSettings

CKMaterialShader

CKMessage

CKMovieProperties

CKObject

CKBehaviorIO

CKBehaviorLink

CKCriticalSectionObject

CKKinematicChain

CKLayer

CKParameter

CKParameterLocal

CKParameterVariable

CKParameterOut

CKParameterIn

CKParameterOperation

CKRenderContext

CKSceneObject

CKAnimation

CKKeyedAnimation

CKBehavior

CKBeObject

CKDataArray

CKGroup

CKLevel

CKMaterial

CKMesh

CKPatchMesh

CKRenderObject

CK2dEntity

CKSprite

CKSpriteText

CK3dEntity

CK3dObject

CKBodyPart

CK3dPointCloud

CKCamera

CKTargetCamera

CKCharacter

CKCurve

CKCurvePoint

CKGrid

CKLight

CKTargetLight

CKPlace

CKSprite3D

CKScene

CKSound

CKMidiSound

CKWaveSound

CKTexture

CKVideo

CKObjectAnimation

CKStateObject

CKSynchroObject

CKObjectArray

CKObjectDeclaration

CKParameterTypeDesc

CKPatch

CKPathMaker

CKPathSplitter

CKPluginDll

CKPluginEntry

CKPluginEntryReadersData

CKPluginInfo

CKPluginManager

CKProtectable

CKShader

CKSceneObjectIterator

CKSkinBoneData

CKSkinVertexData

CKStateChunk

CKStreamWriter

CKStructHelper

CKUICallbackStruct

Iterator

Variable

Watcher

CKVertexBuffer

CKWaveSound3DSettings

CKWaveSoundSettings

CloudAttributeDescription

CloudIterator

CloudSelection

OverridenMaterial

QuasiRandomGenerator

StandardRandomGenerator

Vx2DVector

VxAllocator

Stats

VxBbox

VxBigFile

Chunk

ProgressionCallback

VxColor

VxCompressedVector

VxCone

VxDataMutexed

Accessor

ConstAccessor

VxDistance

VxDrawPrimitiveDataSimple

VxEffectDescription

VxFrustum

VxImageDescEx

VxIntersect

VxLog

VxLogListener

VxConsoleListener

VxFileListener

VxOutputDebugListener

VxMatrix

VxMemoryMappedFile

VxMemoryPool

VxMutex

VxMutexLock

VxOBB

VxPlane

VxPoolObject

CKAnimController

CKMorphController

CKSkin

VxQuaternion

VxRay

VxRDTSCProfiler

VxRect

VxScratch

VxScratchString

VxSharedLibrary

VxSphere

VxStream

VxFile

VxSubFile

VxStridedDataBase

VxStridedData

XPtrStrided

VxThread

VxTimeProfiler

VxUV

VxVector

VxVector4

XAP

XArray

XObjectArray

XObjectPointerArray

XBaseString

XString

XBinaryTree

XBinaryTreeIt

XBinaryTreeNode

XBitArray

XBTree

ConstIterator

Iterator

XClassArray

XEqual

XGUID

XHashFun

XHashTable

ConstIterator

Iterator

Pair

XList

XListIt

XMatrix

XNHashTable

XNHashTableConstIt

XNHashTableIt

XNHashTablePair

XNTree

Node

INode

Leaf

XP

XPriority

XPriorityQueue

XRefCount

XSArray

CKDependencies

XSObjectArray

XSObjectPointerArray

XSHashTable

XSHashTableConstIt

XSHashTableIt

XSHashTablePair

XSmartPtr

XStringTokenizer


CKBaseManager::m_ManagerGuid

Member Variable CKBaseManager::m_ManagerGuid

CKGUID CKBaseManager::m_ManagerGuid

Remarks

Manager GUID


CKBaseManager::m_ManagerName

Member Variable CKBaseManager::m_ManagerName

CKSTRING CKBaseManager::m_ManagerName

Remarks

Manager Name


CKCharacter::FlushSecondaryAnimations

Virtual Method Method CKCharacter::FlushSecondaryAnimations

virtual void CKCharacter::FlushSecondaryAnimations() CK_PURE

Removes all secondary animations.

Remarks

Stops and removes all secondary animations of a character.

See Also

PlaySecondaryAnimation, StopSecondaryAnimation


CKCharacter::SetAutomaticProcess

Virtual Method Method CKCharacter::SetAutomaticProcess

virtual void CKCharacter::SetAutomaticProcess(CKBOOL process=TRUE) CK_PURE

Sets whether character animations are processed by the engine.

Parameters

Input argument process

FALSE to prevent animations from being processed by the engine each frame.

See Also

IsAutomaticProcess, ProcessAnimation


CKBaseManager::m_ProcessingTime

Member Variable CKBaseManager::m_ProcessingTime

float CKBaseManager::m_ProcessingTime

Remarks

Time elapsed during profiling. (Reset each frame before behavioral processing starts)


CKPatchMesh::SetIterationCount

Virtual Method Method CKPatchMesh::SetIterationCount

virtual void CKPatchMesh::SetIterationCount(int count) CK_PURE

Sets the number of iteration steps to be used for tesselation.

Parameters

Input argument count

Step count for tesselation

See Also

GetIterationCount


CKCharacter::GetSecondaryAnimation

Virtual Method Method CKCharacter::GetSecondaryAnimation

virtual CKAnimation* CKCharacter::GetSecondaryAnimation(int index) CK_PURE

Gets a secondary animation according to its index.

Parameters

Input argument index

Index of the animation to be obtained.

Returns

A pointer to a CKAnimation.

See Also

PlaySecondaryAnimation, GetSecondaryAnimationCount, StopSecondaryAnimation


operator+

Class Hierarchy

Method operator+

inline const VxVector operator+ (const VxVector& v)
inline const VxVector operator+ (const VxVector& v1, const VxVector& v2)
inline const VxVector4 operator+ (const VxVector4& v)
inline const VxVector4 operator+ (const VxVector4& v1, const VxVector4& v2)
inline VxColor operator+ (const VxColor& col1, const VxColor& col2)
inline XString operator+(const char* lhs, const XString &rhs)

Returns

The positive of the current object.

Remarks

Description: Positive Operator


CKCharacter::IsAutomaticProcess

Virtual Method Method CKCharacter::IsAutomaticProcess

virtual CKBOOL CKCharacter::IsAutomaticProcess() CK_PURE

Checks whether animations are processed by the engine.

Returns

TRUE if animations are processed by the engine.

See Also

SetAutomaticProcess, ProcessAnimation


CKPatchMesh::Cast

Static Object Method CKPatchMesh::Cast

static CKPatchMesh* CKPatchMesh::Cast(CKObject* iO)

Dynamic cast operator.

Parameters

Input argument iO

A pointer to a CKObject to cast.

Returns

iO casted to the appropriate class or NULL if iO is not from the required class .

Example

CKObject* Object;
CKAnimation* anim = CKAnimation::Cast(Object);


CKBaseManager::StopProfile

Method CKBaseManager::StopProfile

void CKBaseManager::StopProfile()

Stops profiling.

Remarks

The time taken by the manager between the StartProfile / StopProfile sequence will be added to m_ProcessingTime member of CKBaseManager and will appear in the Profiler in the Virtools Interface. The time taken by a manager on the PreProcess,PostProcess,PreRender,PostRender and PostSpriteRender method is automatically computed so you should use these methods if there are other parts of your manager you would like to be profiled.

See Also

StopProfile


CKPatchMesh::GetIterationCount

Virtual Method Method CKPatchMesh::GetIterationCount

virtual int CKPatchMesh::GetIterationCount() CK_PURE

Gets the number of iteration steps used for tesselation.

Returns

Step count for tesselation.

See Also

SetIterationCount


CKBaseManager::m_Context

Member Variable CKBaseManager::m_Context

CKContext* CKBaseManager::m_Context

Remarks

A pointer to the CKContext on which this manager is valid.


CKBaseManager::StartProfile

Method CKBaseManager::StartProfile

void CKBaseManager::StartProfile()

Starts profiling.

Remarks

The time taken by the manager between the StartProfile / StopProfile sequence will be added to m_ProcessingTime member of CKBaseManager and will appear in the Profiler in the Virtools Interface.

The time taken by a manager on the PreProcess,PostProcess,PreRender,PostRender and PostSpriteRender method is automatically computed so you should use these methods if there are other parts of your manager you would like to be profiled.

See Also

StopProfile


Table of Contents

Virtools SDK Documentation

Virtools SDK Architecture and Principles

Virtools API Architecture

Presentation of the Process Loop

Presentation of the Behavioral Engine

What are Behaviors ?

What are Parameters ?

What are Behavioral Objects ?

Level Organization

Presentation of the Render Engine

Changing the Render Engine

About the Rendering Loop

Presentation of the Rasterizers

Virtools Plugins Overview

Main Virtools Events

Using Virtools SDK

Changes in New Version

Compilation Settings

Using Base Classes and Tools

The Context

Base Object Class

The VxMath Library

Using X Containers

Dynamic Objects

Using Groups

Using Arrays

Using State Chunks

Creating Building Blocks

Using the Visual C++ AppWizard to Create a Building Block

Main Steps of Building Block Creation

Declaration of the Building Block

Behavior Prototype Creation

Writing the Execution Function

Writing the Behavior Callback Function

Building Block Classes

Creating a Custom Building Block Dialog Box

Using the Behavior Engine

Behaviors and Objects Activation

Using Parameters

Using Attributes

Using Messages

Time Management

Using the Render Engine

Understanding the Render Loop

Using 2D Entities

Using 3D Entities

Using Materials

Using Textures

Using Meshes

Using Render Contexts

Using Portals

Custom Rendering

Using Sounds

Creating New Plugins

Creating Extensions Plugins

Creating New Parameter Types

Creation of new Parameter Operations

Creation of Media Plugins

Creation of Bitmap Media Plugins

Creation of Model Media Plugins

Creation of Movie Media Plugins

Creation of Sound Media Plugins

Creation of a New Manager

Using the Visual C++ AppWizard to Create a Manager

Creating a Standalone Application

VSL Binding new C/C++ functionality

FAQ

Additionnal Tools

Virtools SDK Reference

Classes

Base

CKContext

CKGroup

CKLevel

CKObject

CKSceneObject

Behavior Engine

Behaviors

CKBehavior

CKBehaviorIO

CKBehaviorLink

CKBehaviorPrototype

CKMessage

CKObjectDeclaration

CKScene

CKSceneObjectIterator

CKAttributeManager

CKBehaviorManager

CKBeObject

CKMessageManager

CKParameterManager

CKTimeManager

Parameters

CKParameter

CKParameterIn

CKParameterLocal

CKParameterOperation

CKParameterOut

CKStructHelper

CKFileExtensionShort

CKGUID

CloudAttributeDescription

CloudIterator

CloudSelection

Render Engine

Animation classes

Animation controllers

Animation Keys

CKBezierFloatKey

CKBezierPositionKey

CKFloatKey

CKKey

CKMorphKey

CKPositionKey

CKRotationKey

CKTCBFloatKey

CKTCBPositionKey

CKTCBRotationKey

CKAnimController

CKMorphController

CKAnimation

CKKeyedAnimation

CKKinematicChain

CKObjectAnimation

CK2dEntity

CK3dEntity

CK3dObject

CK3dPointCloud

CKBodyPart

CKCamera

CKCharacter

CKCollisionManager

CKCurve

CKCurvePoint

CKFloorManager

CKGrid

CKGridManager

CKLayer

CKLight

CKMaterial

CKMesh

CKPatchMesh

CKPlace

CKRenderContext

CKRenderManager

CKRenderObject

CKSkin

CKSkinBoneData

CKSkinVertexData

CKSprite

CKSprite3D

CKSpriteText

CKTargetCamera

CKTargetLight

CKTexture

CKVertexBuffer

Shaders and Effects

CK_OVERRIDE_RENDERING

CKMaterialShader

CKShader

CKShaderManager

Point Clouds

Sound Engine

CKMidiManager

CKMidiSound

CKSound

CKSoundManager

CKWaveSound

Plugins

CKPluginDll

CKPluginEntry

CKPluginEntryBehaviorsData

CKPluginEntryReadersData

CKPluginInfo

CKPluginManager

External Managers classes

CKInputManager

External Readers classes

CKBitmapProperties

CKBitmapReader

CKDataReader

CKModelReader

CKMovieProperties

CKMovieReader

CKSoundReader

Miscellaneous Classes

CK2dCurve

CK2dCurvePoint

CKBaseManager

CKBitmapData

CKCriticalSectionObject

CKDataArray

CKDependencies

CKDependenciesContext

CKFile

CKPathManager

CKStateChunk

CKStateObject

CKSynchroObject

Container classes

CKObjectArray

XObjectArray

XObjectPointerArray

XSObjectArray

XSObjectPointerArray

Variables

CKParameterVariable

CKVariableManager

Video Engine

CKVideo

CKVideoInputFormatDesc

CKVideoManager

VxBigFile

VxConsoleListener

VxFileListener

VxLog

VxOutputDebugListener

VxRDTSCProfiler

VxStream

VxSubFile

XMatrix

XPriority

CKBlendShapeSet

CKBlendShapeVertexDelta

OverridenMaterial

Global Functions

Initializations

CKCloseContext

CKCreateContext

CKGetStartPath

CKGetVersion

CKShutdown

Class Hierarchy

CKClassIDToCppClassName

CKClassIDToString

CKGetClassCount

CKGetCommonParent

CKGetParentClassID

CKIsChildClassOf

CKStringToClassID

CKObjects

CKSaveObjectState

Miscellaneous functions

CKCopyDefaultClassDependencies

CKDeletePointer

CKErrorToString

CKGetDefaultClassDependencies

CKGetPluginManager

CreateCKObjectArray

CreateCKStateChunk

DeleteCKObjectArray

DeleteCKStateChunk

Behavior declarations

CKGetObjectDeclarationFromGuid

CKGetPrototypeDeclaration

CKGetPrototypeDeclarationCount

CKGetPrototypeFromGuid

CreateCKBehaviorPrototype

CreateCKObjectDeclaration

Bitmaps

CKCopyBitmapProperties

CKLoadBitmap

CKSaveBitmap

Compression

CKComputeDataCRC

CKPackData

CKUnPackData

Endianness

CKConvertEndian16

CKConvertEndian32

CKConvertEndianArray16

CKConvertEndianArray32

String functions

Enumerations

ChannelType

CK_2DENTITY_FLAGS

CK_3DENTITY_FLAGS

CK_ANIMATION_FLAGS

CK_ANIMATION_TRANSITION_MODE

CK_ARRAYTYPE

CK_ATTRIBUT_FLAGS

CK_BEHAVIOR_CALLBACKMASK

CK_BEHAVIOR_FLAGS

CK_BEHAVIOR_RETURN

CK_BEHAVIOR_TYPE

CK_BINARYOPERATOR

CK_BITMAP_SAVEOPTIONS

CK_BITMAP_SYSTEMCACHING

CK_BITMAPREADER_ERROR

CK_BONES_REFERENTIAL

CK_COMPOPERATOR

CK_CONFIG_FLAGS

CK_DATAREADER_FLAGS

CK_DEPENDENCIES_FLAGS

CK_DEPENDENCIES_OPMODE

CK_DESTROY_FLAGS

CK_FILE_WRITEMODE

CK_FLOORGEOMETRY

CK_FLOORNEAREST

CK_FOCUSLOST_BEHAVIOR

CK_FRAMERATE_LIMITS

CK_GEOMETRICPRECISION

CK_GRIDORIENTATION

CK_IMPACTINFO

CK_LOAD_FLAGS

CK_MOUSEBUTTON

CK_MOVIEREADER_ERROR

CK_OBJECT_FLAGS

CK_OBJECTANIMATION_FLAGS

CK_OBJECTCREATION_OPTIONS

CK_PARAMETERTYPE_FLAGS

CK_PATCH_FLAGS

CK_PATHMANAGER_CATEGORY

CK_PLUGIN_TYPE

CK_RAYINTERSECTION

CK_RENDER_FLAGS

CK_SCENEOBJECT_FLAGS

CK_SCENEOBJECTACTIVITY_FLAGS

CK_SCENEOBJECTRESET_FLAGS

CK_SECONDARYANIMATION_FLAGS

CK_SOUND_SAVEOPTIONS

CK_SOUNDMANAGER_CAPS

CK_SOUNDREADER_ERROR

CK_TEXTURE_SAVEOPTIONS

CK_VIDEO_AUTHOR_FLAGS

CK_VIDEO_DISPLAY

CK_VIDEO_ERRORS

CK_VIDEO_EVENT

CK_VIDEO_MANAGERSAVEOPTION

CK_VIDEO_RUNTIME_FLAGS

CK_VIDEO_SAVEOPTION

CK_VIDEO_STATE

CK_VIDEO_TYPE

CK_WAVESOUND_LOCKMODE

CK_WAVESOUND_STATE

CK_WAVESOUND_TYPE

CKANIMATION_CONTROLLER

CKGRID_LAYER_FORMAT

CKMANAGER_FUNCTIONS

CKSPRITETEXT_ALIGNMENT

Render Engine Enumerations

CKLOCKFLAGS

CKRST_DPFLAGS

CKRST_EVENTS

CKRST_TEXTURESTAGESTATETYPE

CKVB_STATE

Driver Caps

CKRST_2DCAPS

CKRST_BLENDCAPS

CKRST_CMPCAPS

CKRST_MISCCAPS

CKRST_RASTERCAPS

CKRST_SPECIFICCAPS

CKRST_STENCILCAPS

CKRST_TADDRESSCAPS

CKRST_TEXTURECAPS

CKRST_TFILTERCAPS

CKRST_VTXCAPS

VX_EFFECT

VX_EFFECTCALLBACK_RETVAL

VX_LOCKFLAGS

VX_MOVEABLE_FLAGS

VXBLEND_MODE

VxBpps

VXBUFFER_TYPE

VXCHANNEL_FLAGS

VXCMPFUNC

VXCULL

VxEffectDescription

VXFILL_MODE

VXFOG_MODE

VXLIGHT_TYPE

VXMESH_FLAGS

VXMESH_LITMODE

VXPRIMITIVETYPE

VXRENDERSTATETYPE

VXSHADE_MODE

VxShadeType

VXSPRITE3D_TYPE

VXSPRITE_RENDEROPTIONS

VXSPRITE_RENDEROPTIONS2

VXSTENCILOP

VXTEXTURE_ADDRESSMODE

VXTEXTURE_BLENDMODE

VXTEXTURE_FILTERMODE

VXTEXTURE_WRAPMODE

VXWRAP_MODE

VXSHADOWMAP_FORMAT

Structures

CKAttributeVal

CKBehaviorContext

CKFileInfo

CKFileObject

CKFilePluginDependencies

CKFloorPoint

CKListenerSettings

CKOperationDesc

CKParameterTypeDesc

CKPatch

CKPatchEdge

CKStats

CKStreamWriter

CKTVPatch

CKUICallbackStruct

CKVideoInfo

CKWaveFormat

CKWaveSound3DSettings

CKWaveSoundSettings

ImpactDesc

Vx2DCapsDesc

Vx3DCapsDesc

VxDirectXData

VxDisplayMode

VxDrawPrimitiveDataSimple

VxDriverDesc

VxIntersectionDesc

VxSpriteRenderOptions

VxStats

VxTransformData

VxUV

Callback Functions prototypes

CK_EFFECTCALLBACK

CK_INITINSTANCEFCT

CK_MESHRENDERCALLBACK

CK_PARAMETEROPERATION

CK_RENDERCALLBACK

CK_RENDEROBJECT_CALLBACK

CKATTRIBUTECALLBACK

CKBEHAVIORCALLBACKFCT

CKBEHAVIORFCT

CKDLL_CREATEPROTOFUNCTION

CKDLL_OBJECTDECLARATIONFUNCTION

CKPluginGetInfoCountFunction

CKPluginGetInfoFunction

CKReaderGetReaderFunction

CKRRCALLBACKFCT

CKUICALLBACKFCT

Macro definitions

CKOBJID

RegisterBehavior

Types definitions

CK_CLASSID

CK_ID

Pre-Registred Parameter Types

ParameterOperation Types

Object Dependencies Options

Class Identifiers

Error Codes

VxMath Reference

Math Utilities

VxBbox

VxProjectBoxZExtents

VxTransformBox2D

XCos

XSin

Vectors

Absolute

CrossProduct

DotProduct

Interpolate

InterpolateFloatArray

InterpolateVectorArray

InvMagnitude

InvSquareMagnitude

Magnitude

Max

Maximize

Min

Minimize

MultiplyAdd

MultiplyVectorArray

Normalize

Reflect

Rotate

SquareMagnitude

Vx2DVector

VxCompressedVector

VxVector

VxVector4

Matrix

Vx3DDecomposeMatrix

Vx3DDecomposeMatrixTotal

Vx3DInterpolateMatrix

Vx3DInverseMatrix

Vx3DInverseMatrix44

Vx3DMatrixDeterminant

Vx3DMatrixFromEulerAngles

Vx3DMatrixFromRotation

Vx3DMatrixFromRotationAndOrigin

Vx3DMatrixIdentity

Vx3DMatrixPolarDecomposition

Vx3DMatrixSpectralDecomposition

Vx3DMultiplyMatrix

Vx3DMultiplyMatrixVector

Vx3DMultiplyMatrixVector4

Vx3DRotateVector

Vx3DTransposeMatrix

VxInverseProject

VxMatrix

Quaternions

Exp

Ln

LnDif

Slerp

Squad

Vx3DQuaternionConjugate

Vx3DQuaternionDivide

Vx3DQuaternionFromMatrix

Vx3DQuaternionMultiply

VxQuaternion

Intersections

VxCone

VxDistance

VxFrustum

VxIntersect

VxOBB

VxPlane

VxRay

System Utilities

CKDirectoryParser

CKFileExtension

CKPathMaker

CKPathSplitter

VxDataMutexed

VxFile

VxLogListener

VxMemoryMappedFile

VxMutex

VxMutexLock

VxSharedLibrary

VxThread

VxTimeProfiler

XGUID

System Functions

VxAddLibrarySearchPath

VxGetEnvironmentVariable

VxGetOs

VxGetPlatform

VxScanCodeToAscii

VxScanCodeToName

VxSetCursor

VxSetEnvironmentVariable

VxShowCursor

VxURLDownloadToCacheFile

Windows functions

Directories functions

VxFileExist

VxGetCurrentDirectory

VxMakePath

VxRenameFile

VxSetCurrentDirectory

VxAddDirectorySeparator

VxConvertPathToSystemPath

Processor Identification

GetProcessorDescription

GetProcessorFeatures

GetProcessorFrequency

GetProcessorType

ModifyProcessorFeatures

ProcessorsFeatures

ProcessorsType

VxGetFPUControlWord

VxSetBaseFPUControlWord

VxSetFPUControlWord

sizeofarray

XRemoveIf

Graphic Utilities

BGRAFTOCOLOR

GetBitCount

GetBitShift

GetQuantizationSamplingFactor

RGBAFTOCOLOR

SetQuantizationSamplingFactor

VxBppToMask

VxColor

VxConvertToBumpMap

VxConvertToNormalMap

VxDoAlphaBlit

VxDoBlit

VxGenerateMipMap

VxGetBitCounts

VxGetBitShifts

VxImageDesc2PixelFormat

VxImageDescEx

VxPixelFormat2ImageDesc

VxPixelFormat2String

VxResizeImage32

Bitmaps & Fonts functions

Macros

ASM_SUPPORTED

CKPGUID_CUSTOMIZEDPARAM

CKVERSION

ColorGetAlpha

ColorGetBlue

ColorGetGreen

ColorGetRed

ColorSetAlpha

ColorSetBlue

ColorSetGreen

ColorSetRed

DIRECTORY_SEP_CHAR

DIRECTORY_SEP_STRING

DLL_EXPORT

IMPLEMENT_POOL

IMPLEMENT_POOL_CLASS

INV_RANDMAX

INVHALF_RANDMAX

MAC_USE_ANSI_FOR_VXFILE

MUPREVSIZE

MUSIZE

RGBAITOCOLOR

SIMD_SUPPORTED

SPEEDSTEP_SAFE

USE_PIX

VIRTOOLS_MAX_EXTENSION_SIZE

VXRDTSCPROFILER

Overloaded Operators

operator!=

operator*

operator-

operator/

operator<

operator<=

operator==

Misc Utilities

_rotl

_rotr

ChooseRef

GaussianDistribution

GetQuasiRandomGenerator

Is2Power

Near2Power

QuasiRandomGenerator

StandardRandomGenerator

VxComputeBestFitBBox

VxCopyDwords2Words

VxCopyStructure

VxCopyWords2Dwords

VxDeleteAligned

VxFillStructure

VxIndexedCopy

VxIsAllocatedByNewAligned

VxNewAligned

VxPtInRect

VxRect

VxSphere

VxStridedData

VxStridedDataBase

XAbs

XAP

XFabs

XMax

XMin

XMinMax

XP

XPtrStrided

XRefCount

XSmartPtr

XSqrt

XSwap

XThreshold

Containers

XArray

XBaseString

XBinaryTree

XBinaryTreeIt

XBinaryTreeNode

XBitArray

XBTree

XClassArray

XList

XListIt

XNTree

XPriorityQueue

XString

Strings

CKStrdelete

CKStrdup

CKStrlwr

CKStrupr

Hash Tables

XEqual

XHashFun

XHashTable

XNHashTable

XNHashTableConstIt

XNHashTableIt

XNHashTablePair

XSHashTable

XSHashTableConstIt

XSHashTableIt

XSHashTablePair

Memory

VxAllocator

VxMemoryPool

VxPoolObject

VxScratch

VxScratchString

XStringTokenizer

Type definitions

VX_OSINFO

VX_PIXELFORMAT

VX_PLATFORMINFO

VXCLIP_FLAGS

VXCURSOR_POINTER

VxMMF_Error

VxSortFunc

VXTHREAD_PRIORITY

VXTHREAD_STATE

VxThreadFunction

VXTHREADWIN32_FLAGS

Available Source Code

External Functions

_CKStartUp

CKInitCustomPlayer

CKStartUp

GetTempFileName

getWindowsOffset

SetWindowsOffset

VxClientToScreen

VxConvertBitmap

VxConvertBitmapTo24

VxConvertEndianArray16

VxConvertEndianArray32

VxCopyBitmap

VxCreateBitmap

VxCreateFileTree

VxCreateFont

VxDeleteBitmap

VxDeleteDirectory

VxDeleteFile

VxDeleteFont

VxDrawBitmapTextW

VxEndian16Swap

VxEndian32Swap

VxGetClientRect

VxGetDirectory

VxGetModuleFileName

VxGetMouseButtonsSwapped

VxGetParent

VxGetTempPath

VxGetV3DLAppSupportDirectory

VxGetWindowRect

VxMakeDirectory

VxMoveWindow

VxRemoveDirectory

VxScreenToClient

VxSetParent

VxTestDiskSpace

VxWindowFromPoint

Operators

operator+

Type Definitions

CK_PARAMETERGETCUSTOMOBJECTFUNCTION

CKBlendShape

CKBlendShapeInitialVertex

CKCustomParameter

CKMessageHandler

CKRST_STRETCHRECT_ERROR

VxDrawBitmapText

VxGetFontInfo

VXSHADOWMAP_ATTENUATIONMODE

VXSHADOWMAP_FALLBACKPOLICY

VXSHADOWMAP_TAPCOUNT

Class Hierarchy


Glossary

Generated by the DocJet Source Code Documentation System version 6.1.3 Thursday, February 26, 2009


When you pressed the

When you pressed the "Edit" button in the browser window, you asked to be taken to the source code for the object you were looking at. The web page knows the relative path to the source code for the object - relative to the root of the project tree. What you are being asked to supply in this dialog is the path to the root of the project tree.

After you supply this directory, it will be stored away so that the next time you press "Edit" in the documentation for this project, you will not be bothered with this dialog.


Index

_128_ABGR32F

_16_ABGR1555

_16_ABGR4444

_16_ARGB1555

_16_ARGB4444

_16_BGR555

_16_BGR565

_16_D16

_16_L6V5U5

_16_R16F

_16_RGB555

_16_RGB565

_16_V8U8

_24_BGR888

_24_RGB888

_32_ABGR8888

_32_ARGB8888

_32_BGR888

_32_BGRA8888

_32_D24_S8

_32_GR16F

_32_R32F

_32_RGB888

_32_RGBA8888

_32_V16U16

_32_X8L8V8U8

_4_ABGR8888_CLUT

_4_ARGB8888_CLUT

_64_ABGR16F

_64_GR32F

_8_ABGR8888_CLUT

_8_ARGB2222

_8_ARGB8888_CLUT

_8_RGB332

_CKStartUp

_DXT1

_DXT2

_DXT3

_DXT4

_DXT5

_MatchStereoTextureRightToLeft

_rotl

_rotr

AABBAABB

AABBFace

AABBOBB

About the Rendering Loop

Absolute - see

VxVector::Absolute

Absolute

Accessor

accumulated

Activate - see

CKScene::Activate

CKBehaviorIO::Activate

CKBehavior::Activate

ActivateAllChannels

ActivateChannel

ActivateInput

ActivateManager

ActivateOutput

Active

ActiveObjectsExecuted

Add

AddAnimation - see

CKKeyedAnimation::AddAnimation

CKCharacter::AddAnimation

AddBigFile

AddBodyPart

AddCategory - see

CKPluginManager::AddCategory

CKPathManager::AddCategory

CKAttributeManager::AddCategory

AddChannel

AddChannelExt

AddChild

AddChildren

AddChunk

AddChunkAndDelete

AddClassification

AddControlPoint - see

CKCurve::AddControlPoint

CK2dCurve::AddControlPoint

AddDestination

AddEffect

AddEscapedSpace

AddEventCallBack

AddFloorObject

AddFloorObjectsByName

AddIfNotHere - see

XSObjectPointerArray::AddIfNotHere

XSObjectArray::AddIfNotHere

XObjectPointerArray::AddIfNotHere

XObjectArray::AddIfNotHere

CKObjectArray::AddIfNotHere

AddIfNotHereSorted

AddInput

AddInputParameter

Additionnal Tools

AddKey - see

CKMorphController::AddKey

CKAnimController::AddKey

AddLayer

AddLocalParameter

AddMesh

AddMessageType

AddModule

AddObject - see

CKRenderContext::AddObject

CKLevel::AddObject

CKGroup::AddObject

CKBehaviorManager::AddObject

AddObjectAnimation

AddObjectFront

AddObjectNextFrame

AddObjects

AddObjectToScene

AddObjectWithHierarchy

AddObstacle

AddObstaclesByName

AddOutput

AddOutputParameter

AddParameter

AddParameterOperation

AddPath

AddPlace

AddPortal

AddPositionKey

AddPostRenderCallBack - see

CKRenderObject::AddPostRenderCallBack

CKRenderContext::AddPostRenderCallBack

CKMesh::AddPostRenderCallBack

AddPostSpriteRenderCallBack

AddPreRenderCallBack - see

CKRenderObject::AddPreRenderCallBack

CKRenderContext::AddPreRenderCallBack

CKMesh::AddPreRenderCallBack

AddRemoveSequence

AddRenderContext

AddRotationKey

AddRow

AddScale

AddScaleAxisKey

AddScaleKey

AddScene

AddScript

AddSubBehavior

AddSubBehaviorLink

AddTemporaryPostProcessCallBack

AddTemporaryPreProcessCallBack

AlignCharacterWithRootPosition

ALL

Allocate - see

VxMemoryPool::Allocate

VxAllocator::Allocate

Allocated - see

XClassArray::Allocated

XArray::Allocated

AllocatedSize

AllocateMemory

AllocatePool

AllocatePoolObject

AllocateScratch

AllocateScratchString

AllocateString

AlphaBlendEnabled

AlphaCmpCaps

AlphaMask

AlphaRefValue

AlphaTestEnabled - see

CKSprite::SetAlphaTest

CKMaterial::AlphaTestEnabled

AlphaTestFunc

And

Animation classes

Animation controllers

Animation Keys

AnimationManagement

APPEND

Append - see

VxBigFile::Append

CKObjectArray::Append

AppendBits

ApplyEnvironmentSettings

ApplyGlobalMaterial

AreAnimationIgnored

Array

ASM_SUPPORTED

assignment operator - see

XString::operator=

XSmartPtr::operator=

XSHashTable::operator=

XRefCount::operator=

XPtrStrided::operator=

XP::operator=

XNHashTable::operator=

XList::operator=

XHashTable::operator=

XClassArray::operator=

XBitArray::operator=

XBTree::operator=

XArray::operator=

XAP::operator=

VxVector4::operator=

VxVector::operator=

VxMatrix::operator=

VxCompressedVector::operator=

CKPathSplitter::operator=

At - see

XClassArray::At

XArray::At

Attach - see

XArray::Attach

VxSharedLibrary::Attach

AttachViewpointToCamera

AttribType

AttributeManager

AuthorizeConditionalNonPow2

Available Source Code

AvailableVideoMemory

axis0

axis1

axisX

axisY

axisZ

Back - see

XList::Back

XClassArray::Back

XArray::Back

BackIterate

BackToFront

BackToFrontTime

Base Object Class

BaseClasses

Begin - see

XSHashTable::Begin

XNHashTable::Begin

XList::Begin

XHashTable::Begin

XClassArray::Begin

XBinaryTree::Begin

XBTree::Begin

XArray::Begin

CKShader::Begin

BeginAddSequence - see

CKScene::BeginAddSequence

CKLevel::BeginAddSequence

BeginPass

BeginRemoveSequence - see

CKScene::BeginRemoveSequence

CKLevel::BeginRemoveSequence

BeginShaders

Behavior

Behavior declarations

Behavior Prototype Creation

BehaviorCodeExecution

BehaviorDelayedLinks

BehaviorEngineClasses

BehaviorLinksParsed

Behaviors and Objects Activation

BehaviorsClasses

BehaviorsExecuted

BGRAFTOCOLOR

bias - see

CKTCBRotationKey::bias

CKTCBPositionKey::bias

CKTCBFloatKey::bias

BinaryFind

Bind - see

CKVariableManager::Bind

CKParameterVariable::Bind

Binding New C/C++ functionality for VSL

BITMAP_HANDLE

BITMAP_PATH_IDX

Bitmaps & Fonts functions

BitmapsFunctions

BitSet

BitsPerPixel

BitsPerValue

BlendingEnabled

BOOL

bottom

Bounding

BoxBoxIntersection

BoxFaceIntersection

BoxPlane

Bpp

BubbleSort

Buffer

buffersize

BuildFaceNormals

Building Block Classes

BuildingBlockExecuted

BuildNormals

BuildRenderMesh

BYTE

CalcPoints

Callback Functions prototypes

CallbackArg

CallbackMessage

CallBehaviorCallbackFunction

CanBeHide

CanBeInterrupt

CanIPassRendezVous

Capacity

Caps

Caps2D

Caps3D

CaptureImage

Cast - see

CKTexture::Cast

CKTargetLight::Cast

CKTargetCamera::Cast

CKSpriteText::Cast

CKSprite3D::Cast

CKSprite::Cast

CKRenderObject::Cast

CKRenderContext::Cast

CKPlace::Cast

CKPatchMesh::Cast

CKObjectAnimation::Cast

CKMesh::Cast

CKMaterial::Cast

CKLight::Cast

CKLayer::Cast

CKKinematicChain::Cast

CKKeyedAnimation::Cast

CKGrid::Cast

CKCurvePoint::Cast

CKCurve::Cast

CKCharacter::Cast

CKCamera::Cast

CKBodyPart::Cast

CKAnimation::Cast

CK3dPointCloud::Cast

CK3dObject::Cast

CK3dEntity::Cast

CK2dEntity::Cast

cast operator - see

XSmartPtr::cast operator

XSHashTableIt::cast operator

XSHashTableConstIt::cast operator

XPtrStrided::cast operator

XP::cast operator

XNHashTableIt::cast operator

XNHashTableConstIt::cast operator

XAP::cast operator

VxVector4::cast operator

VxStridedDataBase::cast operator

VxMatrix::cast operator

CKFileExtensionShort::cast operator

CKFileExtension::cast operator

cbSize

Center

CenterAnimation

ChangeCurrentRenderOptions

ChangeDriver

ChangeEnumDeclaration

ChangeFlagsDeclaration

ChangeLimitOptions

ChangeObjectDynamic

ChangeParametersGuid

ChangeReferential

Changes in New Version

Changing the Render Engine

ChannelType

CHANNELTYPE_COUNT

CHANNELTYPE_FLOAT1

CHANNELTYPE_FLOAT2

CHANNELTYPE_FLOAT3

CHANNELTYPE_FLOAT4

CHANNELTYPE_MATERIAL

Check - see

XSObjectPointerArray::Check

XSObjectArray::Check

XObjectPointerArray::Check

XObjectArray::Check

VxScratch::Check

VxColor::Check

CKVertexBuffer::Check

CKObjectArray::Check

CheckClass - see

CKParameterVariable::CheckClass

CKParameterLocal::CheckClass

CKParameter::CheckClass

CheckCommon

CheckFileNameValidity

CheckFunction

CheckIfSameKindOfHierarchy

CheckJoystickConnected

CheckSize

ChooseRef

Chunk

ChunkTable

Cid

CK2dCurve

CK2dCurvePoint

CK2dEntity

CK3dEntity

CK3dObject

CK3dPointCloud

CK_2DENTITY_BACKGROUND

CK_2DENTITY_CLIPTOCAMERAVIEW

CK_2DENTITY_CLIPTOPARENT

CK_2DENTITY_FLAGS

CK_2DENTITY_NOTPICKABLE

CK_2DENTITY_POSITIONCHANGED

CK_2DENTITY_RATIOOFFSET

CK_2DENTITY_SIZECHANGED

CK_2DENTITY_STICKBOTTOM

CK_2DENTITY_STICKLEFT

CK_2DENTITY_STICKRIGHT

CK_2DENTITY_STICKTOP

CK_2DENTITY_UPDATEHOMOGENEOUSCOORD

CK_2DENTITY_USEHOMOGENEOUSCOORD

CK_2DENTITY_USESIZE

CK_2DENTITY_USESRCRECT

CK_2DENTITY_VIRTOOLS

CK_3DENTITY_CAMERAIGNOREASPECT

CK_3DENTITY_CHARACTERDOPROCESS

CK_3DENTITY_DEPRECATEDIK

CK_3DENTITY_DISABLESKINPROCESS

CK_3DENTITY_DUMMY

CK_3DENTITY_ENABLESKINOFFSET

CK_3DENTITY_FLAGS

CK_3DENTITY_FRAME

CK_3DENTITY_HIERARCHICALOBSTACLE

CK_3DENTITY_HWSKINING

CK_3DENTITY_IGNOREANIMATION

CK_3DENTITY_IKJOINTVALID

CK_3DENTITY_PARENTVALID

CK_3DENTITY_PLACEVALID

CK_3DENTITY_PORTAL

CK_3DENTITY_RESERVED0

CK_3DENTITY_TARGETCAMERA

CK_3DENTITY_TARGETLIGHT

CK_3DENTITY_UPDATELASTFRAME

CK_3DENTITY_ZORDERVALID

CK_ANAGLYPH_COLOR

CK_ANAGLYPH_GRAY

CK_ANAGLYPH_HALFCOLOR

CK_ANAGLYPH_MANUAL

CK_ANAGLYPH_MODE

CK_ANAGLYPH_OPTIMIZED

CK_ANIMATION_FLAGS

CK_ANIMATION_TRANSITION_MODE

CK_ARRAYTYPE

CK_ATTRIBUT_CAN_DELETE

CK_ATTRIBUT_CAN_MODIFY

CK_ATTRIBUT_DONOTCOPY

CK_ATTRIBUT_DONOTSAVE

CK_ATTRIBUT_FLAGS

CK_ATTRIBUT_HIDDEN

CK_ATTRIBUT_SYSTEM

CK_ATTRIBUT_TOSAVE

CK_ATTRIBUT_USER

CK_BEHAVIOR_CALLBACKMASK

CK_BEHAVIOR_FLAGS

CK_BEHAVIOR_RETURN

CK_BEHAVIOR_TYPE

CK_BEHAVIORIO_ACTIVE

CK_BEHAVIORIO_IN

CK_BEHAVIORIO_OUT

CK_BEHAVIORPROTOTYPE_FLAGS

CK_BEHAVIORPROTOTYPE_HIDDEN

CK_BEHAVIORPROTOTYPE_NORMAL

CK_BEHAVIORPROTOTYPE_OBSOLETE

CK_BEHRATE_LIMIT

CK_BEHRATE_MASK

CK_BEHRATE_SYNC

CK_BINARYOPERATOR

CK_BITMAP_SAVEOPTIONS

CK_BITMAP_SYSTEMCACHING

CK_BITMAPREADER_ERROR

CK_BONE_LOCAL

CK_BONE_WORLD

CK_BONE_WORLDVIEW

CK_BONES_REFERENTIAL

CK_CLASSID

CK_COMPOPERATOR

CK_CONFIG_DISABLEDINPUT

CK_CONFIG_DISABLEDSOUND

CK_CONFIG_DOWARN

CK_CONFIG_FLAGS

CK_DATAREADER_FILELOAD

CK_DATAREADER_FILESAVE

CK_DATAREADER_FLAGS

CK_DATAREADER_MEMORYLOAD

CK_DATAREADER_MEMORYSAVE

CK_DATAREADER_STREAMFILE

CK_DATAREADER_STREAMURL

CK_DATAREADER_VXSTREAMLOAD

CK_DEPENDENCIES_BUILD

CK_DEPENDENCIES_COPY

CK_DEPENDENCIES_CUSTOM

CK_DEPENDENCIES_DELETE

CK_DEPENDENCIES_FLAGS

CK_DEPENDENCIES_FULL

CK_DEPENDENCIES_NONE

CK_DEPENDENCIES_OPERATIONMODE

CK_DEPENDENCIES_OPMODE

CK_DEPENDENCIES_SAVE

CK_DESTROY_FLAGS

CK_DESTROY_FREEID

CK_DESTROY_NONOTIFY

CK_DESTROY_TEMPOBJECT

CK_EFFECTCALLBACK

CK_EXITINSTANCEFCT

CK_FILE_WRITEMODE

CK_FLOORGEOMETRY

CK_FLOORNEAREST

CK_FO_DEFAULT

CK_FO_DONTLOADOBJECT

CK_FO_OPTIONS

CK_FO_RENAMEOBJECT

CK_FO_REPLACEOBJECT

CK_FOCUSLOST_BEHAVIOR

CK_FOCUSLOST_NONE

CK_FOCUSLOST_PAUSEALL

CK_FOCUSLOST_PAUSEINPUT_MAIN

CK_FOCUSLOST_PAUSEINPUT_PLAYER

CK_FOCUSLOST_PAUSEINPUT_WHENOUT

CK_FRAMERATE_FREE

CK_FRAMERATE_LIMIT

CK_FRAMERATE_LIMITS

CK_FRAMERATE_MASK

CK_FRAMERATE_SYNC

CK_GEOMETRICPRECISION

CK_GRIDORIENTATION

CK_ID

CK_IMPACTINFO

CK_INITINSTANCEFCT

CK_LISTENERSETTINGS_ALL

CK_LISTENERSETTINGS_DISTANCE

CK_LISTENERSETTINGS_DOPPLER

CK_LISTENERSETTINGS_EQ

CK_LISTENERSETTINGS_GAIN

CK_LISTENERSETTINGS_PRIORITY

CK_LISTENERSETTINGS_ROLLOFF

CK_LISTENERSETTINGS_SOFTWARESOURCES

CK_LISTENERSETTINGS_UNITS

CK_LOAD_ANIMATION

CK_LOAD_AS_DYNAMIC_OBJECT

CK_LOAD_ASCHARACTER

CK_LOAD_AUTOMATICMODE

CK_LOAD_CHECKDEPENDENCIES

CK_LOAD_CHECKDUPLICATES

CK_LOAD_DEFAULT

CK_LOAD_DODIALOG

CK_LOAD_FLAGS

CK_LOAD_GEOMETRY

CK_LOAD_KEEP_CKFILE_OBJECT_AFTER_LOAD

CK_LOAD_ONLYBEHAVIORS

CK_LOAD_REPLACEALL_WITHSCRIPT

CK_LOCK_DEFAULT

CK_LOCK_DISCARD

CK_LOCK_NOOVERWRITE

CK_MESHRENDERCALLBACK

CK_MESSAGE_BROADCAST

CK_MESSAGE_GROUP

CK_MESSAGE_SENDINGTYPE

CK_MESSAGE_SINGLE

CK_MOUSEBUTTON

CK_MOUSEBUTTON_4

CK_MOUSEBUTTON_LEFT

CK_MOUSEBUTTON_MIDDLE

CK_MOUSEBUTTON_RIGHT

CK_MOVIEREADER_ERROR

CK_OBJECT_APPDATA

CK_OBJECT_DYNAMIC

CK_OBJECT_FLAGS

CK_OBJECT_FREEID

CK_OBJECT_HIERACHICALHIDE

CK_OBJECT_INTERFACEOBJ

CK_OBJECT_KEEPSINGLEACTIVITY

CK_OBJECT_LOADREPLACINGOBJECT

CK_OBJECT_LOADSKIPBEOBJECT

CK_OBJECT_NAMESHARED

CK_OBJECT_NOTTOBEDELETED

CK_OBJECT_NOTTOBELISTEDANDSAVED

CK_OBJECT_NOTTOBESAVED

CK_OBJECT_PARAMMASK

CK_OBJECT_PRIVATE

CK_OBJECT_SELECTIONSET

CK_OBJECT_SHOWOPTION

CK_OBJECT_SINGLEACTIVITY

CK_OBJECT_TOBEDELETED

CK_OBJECT_UPTODATE

CK_OBJECT_VISIBLE

CK_OBJECT_VR_DISTRIBUTED

CK_OBJECTANIMATION_FLAGS

CK_OBJECTANIMATION_IGNOREMORPH

CK_OBJECTANIMATION_IGNOREPOS

CK_OBJECTANIMATION_IGNOREROT

CK_OBJECTANIMATION_IGNORESCALE

CK_OBJECTANIMATION_IGNORESCALEROT

CK_OBJECTANIMATION_MERGED

CK_OBJECTANIMATION_RESERVED

CK_OBJECTANIMATION_WARPER

CK_OBJECTCREATION_ACTIVATE

CK_OBJECTCREATION_ASK

CK_OBJECTCREATION_DYNAMIC

CK_OBJECTCREATION_FLAGSMASK

CK_OBJECTCREATION_NONAMECHECK

CK_OBJECTCREATION_NONAMECOPY

CK_OBJECTCREATION_OPTIONS

CK_OBJECTCREATION_RENAME

CK_OBJECTCREATION_REPLACE

CK_OBJECTCREATION_USECURRENT

CK_OK

CK_ORTHOGRAPHICPROJECTION

CK_OVERRIDE_MATERIAL

CK_OVERRIDE_NONE

CK_OVERRIDE_PASS

CK_OVERRIDE_RENDERING

CK_OVERRIDE_TECHNIQUE

CK_OVERRIDE_USECURRENT

CK_PARAMETERCHECKFUNCTION

CK_PARAMETERCOPYFUNCTION

CK_PARAMETERCREATEDEFAULTFUNCTION

CK_PARAMETERDELETEFUNCTION

CK_PARAMETERGETCUSTOMOBJECTFUNCTION

CK_PARAMETERIN_DISABLED

CK_PARAMETERIN_THIS

CK_PARAMETEROPERATION

CK_PARAMETEROUT_DELETEAFTERUSE

CK_PARAMETEROUT_PARAMOP

CK_PARAMETERREMAPFUNCTION

CK_PARAMETERSAVELOADFUNCTION

CK_PARAMETERSTRINGFUNCTION

CK_PARAMETERTYPE_FLAGS

CK_PARAMETERUICREATORFUNCTION

CK_PATCH_FLAGS

CK_PATCH_QUAD

CK_PATCH_TRI

CK_PATHMANAGER_CATEGORY

CK_PERSPECTIVEPROJECTION

CK_PLUGIN_TYPE

CK_RAYINTERSECTION

CK_READSUBCHUNK_FLAGS

CK_RENDER_BACKGROUNDSPRITES

CK_RENDER_CLEARBACK

CK_RENDER_CLEARSTENCIL

CK_RENDER_CLEARVIEWPORT

CK_RENDER_CLEARZ

CK_RENDER_DEFAULTSETTINGS

CK_RENDER_DOBACKTOFRONT

CK_RENDER_DONOTUPDATEEXTENTS

CK_RENDER_FLAGS

CK_RENDER_FOREGROUNDSPRITES

CK_RENDER_HINTRENDERATTRIBTEX

CK_RENDER_OPTIONSMASK

CK_RENDER_PLAYERCONTEXT

CK_RENDER_RESTORENEXTFRAME

CK_RENDER_SKIP3D

CK_RENDER_SKIPDRAWSCENE

CK_RENDER_SKIPTRANSPARENT

CK_RENDER_USECAMERARATIO

CK_RENDER_USECURRENTSETTINGS

CK_RENDER_WAITVBL

CK_RENDERCALLBACK

CK_RENDEROBJECT_CALLBACK

CK_RSC_DEFAULT

CK_RSC_SCRATCH

CK_RSC_SKIP

CK_SCENEOBJECT_ACTIVE

CK_SCENEOBJECT_FLAGS

CK_SCENEOBJECT_START_ACTIVATE

CK_SCENEOBJECT_START_DEACTIVATE

CK_SCENEOBJECT_START_LEAVE

CK_SCENEOBJECT_START_RESET

CK_SCENEOBJECTACTIVITY_ACTIVATE

CK_SCENEOBJECTACTIVITY_DEACTIVATE

CK_SCENEOBJECTACTIVITY_DONOTHING

CK_SCENEOBJECTACTIVITY_FLAGS

CK_SCENEOBJECTACTIVITY_SCENEDEFAULT

CK_SCENEOBJECTRESET_DONOTHING

CK_SCENEOBJECTRESET_FLAGS

CK_SCENEOBJECTRESET_RESET

CK_SCENEOBJECTRESET_SCENEDEFAULT

CK_SECONDARYANIMATION_FLAGS

CK_SOUND_SAVEOPTIONS

CK_SOUNDMANAGER_ALL

CK_SOUNDMANAGER_CAPS

CK_SOUNDMANAGER_OCCLUSION

CK_SOUNDMANAGER_ONFLYTYPE

CK_SOUNDMANAGER_REFLECTION

CK_SOUNDREADER_ERROR

CK_STEREO_ACTIVE

CK_STEREO_ANAGLYPH

CK_STEREO_CHECKERBOARD

CK_STEREO_DEFAULT

CK_STEREO_LEFT

CK_STEREO_MODE

CK_STEREO_RIGHT

CK_TEXTURE_SAVEOPTIONS

CK_TRANSITION_BREAK

CK_TRANSITION_FROMANIMATION

CK_TRANSITION_FROMNOW

CK_TRANSITION_FROMWARPFROMCURRENT

CK_TRANSITION_LOOP

CK_TRANSITION_LOOPIFEQUAL

CK_TRANSITION_TOSTART

CK_TRANSITION_USEVELOCITY

CK_TRANSITION_WARPBEST

CK_TRANSITION_WARPMASK

CK_TRANSITION_WARPPOS

CK_TRANSITION_WARPSAMEPOS

CK_TRANSITION_WARPSTART

CK_TRANSITION_WARPTOBEST

CK_TRANSITION_WARPTOPOS

CK_TRANSITION_WARPTOSAMEPOS

CK_TRANSITION_WARPTOSTART

CK_VB_FAILED

CK_VB_LOST

CK_VB_OK

CK_VIDEO_ASYNCLOAD

CK_VIDEO_AUTHOR_FLAGS

CK_VIDEO_AUTHORMASK

CK_VIDEO_CANLOOP

CK_VIDEO_CANSEEK

CK_VIDEO_CANSPEED

CK_VIDEO_CANSPEEDBACK

CK_VIDEO_DISPLAY

CK_VIDEO_DISPLAYMASK

CK_VIDEO_ERRORS

CK_VIDEO_EVENT

CK_VIDEO_FILE

CK_VIDEO_FINISHED

CK_VIDEO_HASSOUND

CK_VIDEO_INVALID

CK_VIDEO_LIVE

CK_VIDEO_LOADING

CK_VIDEO_LOGOFF

CK_VIDEO_LOOP

CK_VIDEO_MANAGERSAVEOPTION

CK_VIDEO_PAUSED

CK_VIDEO_PLAYING

CK_VIDEO_PREVIEWMASK

CK_VIDEO_RESERVEDAFLAG0

CK_VIDEO_RESERVEDAFLAG1

CK_VIDEO_RESERVEDAFLAG2

CK_VIDEO_RESERVEDAFLAG3

CK_VIDEO_RESERVEDAFLAG4

CK_VIDEO_RESERVEDRFLAG0

CK_VIDEO_RESERVEDRFLAG1

CK_VIDEO_RESERVEDRFLAG2

CK_VIDEO_RESERVEDRFLAG3

CK_VIDEO_RESERVEDRFLAG4

CK_VIDEO_RUNTIME_FLAGS

CK_VIDEO_RUNTIMEMASK

CK_VIDEO_SAVEOPTION

CK_VIDEO_SAVEOPTIONMASK

CK_VIDEO_SCREEN

CK_VIDEO_SOUND

CK_VIDEO_STATE

CK_VIDEO_STATEMASK

CK_VIDEO_STOPPED

CK_VIDEO_STREAM

CK_VIDEO_TEXAUTOFORMAT

CK_VIDEO_TEXAUTOSIZE

CK_VIDEO_TEXFILL

CK_VIDEO_TEXNONPOW2

CK_VIDEO_TEXTURE

CK_VIDEO_TEXTUREREADY

CK_VIDEO_TYPE

CK_VIDEO_TYPEMASK

CK_VIDEO_UNLOADING

CK_VIDEOERR_GENERIC

CK_VIDEOERR_IMPSTART

CK_VIDEOERR_INFO

CK_VIDEOERR_INPUTTYPE

CK_VIDEOERR_LOADED

CK_VIDEOERR_LOADING

CK_VIDEOERR_MAXCOUNT

CK_VIDEOERR_NOPLUGIN

CK_VIDEOERR_NOTLOADED

CK_VIDEOERR_OUTPUTTYPE

CK_VIDEOERR_PLUGINCAPS

CK_VIDEOERR_PREVIEWSTATE

CK_VIDEOERR_PROTOCOL

CK_VIDEOERR_RESERVED0

CK_VIDEOERR_RESERVED1

CK_VIDEOERR_RESERVED2

CK_VIDEOERR_RESERVED3

CK_VIDEOERR_RESERVED4

CK_VIDEOERR_RESERVED5

CK_VIDEOERR_RESERVED6

CK_VIDEOERR_RESERVED7

CK_VIDEOERR_RESERVED8

CK_VIDEOERR_RESERVED9

CK_VIDEOERR_SEEKTIME

CK_VIDEOERR_STATE

CK_VIDEOERR_TEXTURE

CK_VIDEOERR_TEXTURELOCK

CK_VIDEOERR_TEXTUREUSED

CK_VIDEOERR_TIMEOUT

CK_VIDEOERR_UNLOADING

CK_VIDEOERR_VIDEOCAPS

CK_VIDEOEVENT_COUNT

CK_VIDEOEVENT_LOADED

CK_VIDEOEVENT_NEWIMAGE

CK_VIDEOEVENT_PROCESSIMAGE

CK_VIDEOEVENT_UNLOADED

CK_VIDEOSAVE_EXTERNAL

CK_VIDEOSAVE_GLOBAL

CK_VIDEOSAVE_IDBYINDEX

CK_VIDEOSAVE_IDBYNAME

CK_VIDEOSAVE_INTERNAL

CK_WAVESOUND_1ST_REFLECTIONS

CK_WAVESOUND_3DSETTINGS_ALL

CK_WAVESOUND_3DSETTINGS_CONE

CK_WAVESOUND_3DSETTINGS_DISTANCEFACTOR

CK_WAVESOUND_3DSETTINGS_DOPPLERFACTOR

CK_WAVESOUND_3DSETTINGS_HEADRELATIVE

CK_WAVESOUND_3DSETTINGS_MINMAXDISTANCE

CK_WAVESOUND_3DSETTINGS_ORIENTATION

CK_WAVESOUND_3DSETTINGS_POSITION

CK_WAVESOUND_3DSETTINGS_VELOCITY

CK_WAVESOUND_ALLTYPE

CK_WAVESOUND_BACKGROUND

CK_WAVESOUND_CONE

CK_WAVESOUND_COULDBERESTARTED

CK_WAVESOUND_FADE

CK_WAVESOUND_FADEIN

CK_WAVESOUND_FADEOUT

CK_WAVESOUND_FILESTREAMED

CK_WAVESOUND_HASMOVED

CK_WAVESOUND_LOCKENTIREBUFFER

CK_WAVESOUND_LOCKFROMWRITE

CK_WAVESOUND_LOCKMODE

CK_WAVESOUND_LOOPED

CK_WAVESOUND_MONO

CK_WAVESOUND_NEEDREWIND

CK_WAVESOUND_NODUPLICATE

CK_WAVESOUND_OCCLUSIONS

CK_WAVESOUND_PAUSED

CK_WAVESOUND_POINT

CK_WAVESOUND_SETTINGS_ALL

CK_WAVESOUND_SETTINGS_EQUALIZATION

CK_WAVESOUND_SETTINGS_GAIN

CK_WAVESOUND_SETTINGS_PAN

CK_WAVESOUND_SETTINGS_PITCH

CK_WAVESOUND_SETTINGS_PRIORITY

CK_WAVESOUND_STATE

CK_WAVESOUND_STREAMFULLYLOADED

CK_WAVESOUND_STREAMOVERLAP

CK_WAVESOUND_TYPE

CKADD

CKAnimation

CKANIMATION_ALIGNORIENTATION

CKANIMATION_ALLOWTURN

CKANIMATION_BEZIERFLOAT_CONTROL

CKANIMATION_BEZIERPOS_CONTROL

CKANIMATION_BEZIERSCL_CONTROL

CKANIMATION_CANBEBREAK

CKANIMATION_CONTROLLER

CKANIMATION_CONTROLLER_FLOAT

CKANIMATION_CONTROLLER_MASK

CKANIMATION_CONTROLLER_MORPH

CKANIMATION_CONTROLLER_POS

CKANIMATION_CONTROLLER_ROT

CKANIMATION_CONTROLLER_SCL

CKANIMATION_CONTROLLER_SCLAXIS

CKANIMATION_FORCESETSTEP

CKANIMATION_HANDLELOD

CKANIMATION_LINFLOAT_CONTROL

CKANIMATION_LINKTOFRAMERATE

CKANIMATION_LINPOS_CONTROL

CKANIMATION_LINROT_CONTROL

CKANIMATION_LINSCL_CONTROL

CKANIMATION_LINSCLAXIS_CONTROL

CKANIMATION_MORPH_CONTROL

CKANIMATION_SECONDARY_ALL

CKANIMATION_SECONDARY_DOWARP

CKANIMATION_SECONDARY_LASTFRAME

CKANIMATION_SECONDARY_LOOP

CKANIMATION_SECONDARY_LOOPNTIMES

CKANIMATION_SECONDARY_ONESHOT

CKANIMATION_SECONDARY_PRESET

CKANIMATION_SECONDARYWARPER

CKANIMATION_SUBANIMSSORTED

CKANIMATION_TCBFLOAT_CONTROL

CKANIMATION_TCBPOS_CONTROL

CKANIMATION_TCBROT_CONTROL

CKANIMATION_TCBSCL_CONTROL

CKANIMATION_TCBSCLAXIS_CONTROL

CKANIMATION_TRANSITION_ALL

CKANIMATION_TRANSITION_FROMNOW

CKANIMATION_TRANSITION_FROMWARPFROMCURRENT

CKANIMATION_TRANSITION_LOOPIFEQUAL

CKANIMATION_TRANSITION_PRESET

CKANIMATION_TRANSITION_TOSTART

CKANIMATION_TRANSITION_USEVELOCITY

CKANIMATION_TRANSITION_WARPBEST

CKANIMATION_TRANSITION_WARPPOS

CKANIMATION_TRANSITION_WARPSAMEPOS

CKANIMATION_TRANSITION_WARPSTART

CKANIMATION_TRANSITION_WARPTOBEST

CKANIMATION_TRANSITION_WARPTOPOS

CKANIMATION_TRANSITION_WARPTOSAMEPOS

CKANIMATION_TRANSITION_WARPTOSTART

CKAnimController

CKARRAYTYPE_FLOAT

CKARRAYTYPE_INT

CKARRAYTYPE_OBJECT

CKARRAYTYPE_PARAMETER

CKARRAYTYPE_STRING

CKATTRIBUTECALLBACK

CKAttributeCategory

CKAttributeManager

CKAttributeType

CKAttributeVal

CKBaseManager

CKBehavior

CKBEHAVIOR_ACTIVATENEXTFRAME

CKBEHAVIOR_ACTIVE

CKBEHAVIOR_BUILDINGBLOCK

CKBEHAVIOR_CUSTOMEDITDIALOG

CKBEHAVIOR_CUSTOMSETTINGSEDITDIALOG

CKBEHAVIOR_DEACTIVATENEXTFRAME

CKBEHAVIOR_EXECUTEDLASTFRAME

CKBEHAVIOR_INTERNALLYCREATEDINPUTPARAMS

CKBEHAVIOR_INTERNALLYCREATEDINPUTS

CKBEHAVIOR_INTERNALLYCREATEDLOCALPARAMS

CKBEHAVIOR_INTERNALLYCREATEDOUTPUTPARAMS

CKBEHAVIOR_INTERNALLYCREATEDOUTPUTS

CKBEHAVIOR_LAUNCHEDONCE

CKBEHAVIOR_LOCKED

CKBEHAVIOR_MESSAGERECEIVER

CKBEHAVIOR_MESSAGESENDER

CKBEHAVIOR_NONE

CKBEHAVIOR_PRIORITYMAX

CKBEHAVIOR_PRIORITYMIN

CKBEHAVIOR_RESERVED0

CKBEHAVIOR_RESERVED1

CKBEHAVIOR_RESERVED2

CKBEHAVIOR_RESETNEXTFRAME

CKBEHAVIOR_SCRIPT

CKBEHAVIOR_TARGETABLE

CKBEHAVIOR_TOPMOST

CKBEHAVIOR_USEFUNCTION

CKBEHAVIOR_VARIABLEINPUTS

CKBEHAVIOR_VARIABLEOUTPUTS

CKBEHAVIOR_VARIABLEPARAMETERINPUTS

CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS

CKBEHAVIOR_WAITSFORMESSAGE

CKBEHAVIORCALLBACKFCT

CKBehaviorContext

CKBEHAVIORFCT

CKBehaviorIO

CKBehaviorLink

CKBEHAVIORLINK_ACTIVATEDLASTFRAME

CKBEHAVIORLINK_RESERVED

CKBehaviorManager

CKBehaviorPrototype

CKBEHAVIORTYPE_BASE

CKBEHAVIORTYPE_BEHAVIOR

CKBEHAVIORTYPE_SCRIPT

CKBeObject

CKBezierFloatKey

CKBEZIERKEY_FLAGS

CKBezierKeyFlags

CKBezierPositionKey

CKBezierScaleKey

CKBITMAP_DISCARD

CKBITMAP_PROCEDURAL

CKBITMAP_VIDEOSHADOW

CKBitmapData

CKBITMAPERROR_FILECORRUPTED

CKBITMAPERROR_GENERIC

CKBITMAPERROR_READERROR

CKBITMAPERROR_SAVEERROR

CKBITMAPERROR_UNSUPPORTEDFILE

CKBITMAPERROR_UNSUPPORTEDFUNCTION

CKBITMAPERROR_UNSUPPORTEDSAVEFORMAT

CKBitmapProperties

CKBitmapReader

CKBlendShape

CKBlendShapeInitialVertex

CKBlendShapeSet

CKBlendShapeVertexDelta

CKBodyPart

CKBOOL

CKBR_ACTIVATENEXTFRAME

CKBR_ATTACHFAILED

CKBR_BEHAVIORERROR

CKBR_BEHAVIORERROR_RETRY

CKBR_BREAK

CKBR_DETACHFAILED

CKBR_GENERICERROR

CKBR_GENERICERROR_RETRY

CKBR_INFINITELOOP

CKBR_LOCKED

CKBR_OK

CKBR_OWNERERROR

CKBR_OWNERERROR_RETRY

CKBR_PARAMETERERROR

CKBR_PARAMETERERROR_RETRY

CKBYTE

CKCamera

CKCB_BEHAVIORACTIVATESCRIPT

CKCB_BEHAVIORALL

CKCB_BEHAVIORATTACH

CKCB_BEHAVIORBASE

CKCB_BEHAVIORCREATE

CKCB_BEHAVIORDEACTIVATESCRIPT

CKCB_BEHAVIORDELETE

CKCB_BEHAVIORDETACH

CKCB_BEHAVIOREDITED

CKCB_BEHAVIOREDITIONS

CKCB_BEHAVIORLOAD

CKCB_BEHAVIORNEWSCENE

CKCB_BEHAVIORPAUSE

CKCB_BEHAVIORPOSTSAVE

CKCB_BEHAVIORPPR

CKCB_BEHAVIORPRESAVE

CKCB_BEHAVIORREADSTATE

CKCB_BEHAVIORRENAME

CKCB_BEHAVIORRESET

CKCB_BEHAVIORRESETINBREAKPOINT

CKCB_BEHAVIORRESUME

CKCB_BEHAVIORSAVELOAD

CKCB_BEHAVIORSETTINGSEDITED

CKCHAR

CKCharacter

CKCID_2DENTITY

CKCID_3DENTITY

CKCID_3DOBJECT

CKCID_ANIMATION

CKCID_BEHAVIOR

CKCID_BEHAVIORIO

CKCID_BEHAVIORLINK

CKCID_BEOBJECT

CKCID_BODYPART

CKCID_CAMERA

CKCID_CHARACTER

CKCID_CRITICALSECTION

CKCID_CURVE

CKCID_CURVEPOINT

CKCID_DATAARRAY

CKCID_GRID

CKCID_GROUP

CKCID_KEYEDANIMATION

CKCID_KINEMATICCHAIN

CKCID_LAYER

CKCID_LEVEL

CKCID_LIGHT

CKCID_MATERIAL

CKCID_MAXCLASSID

CKCID_MESH

CKCID_MIDISOUND

CKCID_OBJECT

CKCID_OBJECTANIMATION

CKCID_PARAMETER

CKCID_PARAMETERIN

CKCID_PARAMETERLOCAL

CKCID_PARAMETEROPERATION

CKCID_PARAMETEROUT

CKCID_PARAMETERVARIABLE

CKCID_PATCHMESH

CKCID_PLACE

CKCID_PROGRESSIVEMESH

CKCID_RENDERCONTEXT

CKCID_RENDEROBJECT

CKCID_SCENE

CKCID_SCENEOBJECT

CKCID_SOUND

CKCID_SPRITE

CKCID_SPRITE3D

CKCID_SPRITETEXT

CKCID_STATE

CKCID_SYNCHRO

CKCID_TARGETCAMERA

CKCID_TARGETLIGHT

CKCID_TEXTURE

CKCID_WAVESOUND

CKClassIDToCppClassName

CKClassIDToString

CKCloseContext

CKCOLLISION_BOX

CKCOLLISION_FACE

CKCOLLISION_NONE

CKCollisionManager

CKComputeDataCRC

CKContext

CKConvertEndian16

CKConvertEndian32

CKConvertEndianArray16

CKConvertEndianArray32

CKCopyBitmapProperties

CKCopyDefaultClassDependencies

CKCreateContext

CKCriticalSectionObject

CKCurve

CKCurvePoint

CKCustomParameter

CKDataArray

CKDataReader

CKDeletePointer

CKDependencies

CKDependenciesContext

CKDestroyObject

CKDirectoryParser

CKDIV

CKDLL_CREATEPROTOFUNCTION

CKDLL_OBJECTDECLARATIONFUNCTION

CKDWORD

CKEQUAL

CKERR_ALREADYFULLSCREEN

CKERR_ALREADYPRESENT

CKERR_ALREADYREGISTREDDLL

CKERR_BEHAVIORADDDENIEDBYCB

CKERR_CANCELLED

CKERR_CANCREATERENDERCONTEXT

CKERR_CANTWRITETOFILE

CKERR_DINPUTDISABLED

CKERR_FILECRCERROR

CKERR_INCOMPATIBLECLASSID

CKERR_INCOMPATIBLEPARAMETERS

CKERR_INVALIDANIMATION

CKERR_INVALIDCONDSOLEWINDOW

CKERR_INVALIDDLL

CKERR_INVALIDFILE

CKERR_INVALIDGUID

CKERR_INVALIDINDEX

CKERR_INVALIDKINEMATICCHAIN

CKERR_INVALIDMESSAGE

CKERR_INVALIDOBJECT

CKERR_INVALIDOPERATION

CKERR_INVALIDPARAMETER

CKERR_INVALIDPARAMETERTYPE

CKERR_INVALIDPLUGIN

CKERR_INVALIDPROTOTYPE

CKERR_INVALIDRENDERCONTEXT

CKERR_INVALIDSIZE

CKERR_MANAGERALREADYEXISTS

CKERR_NOANIMATIONKEY

CKERR_NOCURRENTLEVEL

CKERR_NODLLFOUND

CKERR_NOJOYSTICK

CKERR_NOKEYBOARD

CKERR_NOLEVEL

CKERR_NOLOADPLUGINS

CKERR_NOMOUSE

CKERR_NORENDERENGINE

CKERR_NOSAVEPLUGINS

CKERR_NOTENOUGHDISKPLACE

CKERR_NOTFOUND

CKERR_NOTIFICATIONNOTHANDLED

CKERR_NOTIMPLEMENTED

CKERR_NOTINITIALIZED

CKERR_OBSOLETEVIRTOOLS

CKERR_OPERATIONNOTIMPLEMENTED

CKERR_OUTOFMEMORY

CKERR_PAUSED

CKERR_PLUGINSMISSING

CKERR_RENDERCONTEXTINACTIVE

CKERR_SOUNDDISABLED

CKERROR

CKErrorToString

CKFile

CKFILE_CHUNKCOMPRESSED_OLD

CKFILE_EXTERNALTEXTURES_OLD

CKFILE_FORVIEWER

CKFILE_UNCOMPRESSED

CKFILE_WHOLECOMPRESSED

CKFileExtension

CKFileExtensionShort

CKFileInfo

CKFileObject

CKFilePluginDependencies

CKFillObjectsUnused

CKFloatKey

CKFLOOR_BOX

CKFLOOR_DOWN

CKFLOOR_FACES

CKFLOOR_NOFLOOR

CKFLOOR_UP

CKFloorManager

CKFloorPoint

CKGetClassCount

CKGetCommonParent

CKGetDefaultClassDependencies

CKGetObjectDeclarationFromGuid

CKGetParentClassID

CKGetPluginManager

CKGetPrototypeDeclaration

CKGetPrototypeDeclarationCount

CKGetPrototypeFromGuid

CKGetStartPath

CKGetVersion

CKGREATER

CKGREATEREQUAL

CKGrid

CKGRID_FREE

CKGRID_LAYER_FORMAT

CKGRID_LAYER_FORMAT_NORMAL

CKGRID_XY

CKGRID_XZ

CKGRID_YZ

CKGridManager

CKGroup

CKGUID

CKHIDE

CKHIERARCHICALHIDE

CKInitCustomPlayer

CKInputManager

CKIsChildClassOf

CKKey

CKKeyedAnimation

CKKinematicChain

CKLayer

CKLESSER

CKLESSEREQUAL

CKLevel

CKLight

CKListenerSettings

CKLoadBitmap

CKLOCKFLAGS

CKM_BEHAVIORACTIVATESCRIPT

CKM_BEHAVIORATTACH

CKM_BEHAVIORCREATE

CKM_BEHAVIORDEACTIVATESCRIPT

CKM_BEHAVIORDELETE

CKM_BEHAVIORDETACH

CKM_BEHAVIOREDITED

CKM_BEHAVIORLOAD

CKM_BEHAVIORNEWSCENE

CKM_BEHAVIORPAUSE

CKM_BEHAVIORPOSTSAVE

CKM_BEHAVIORPRESAVE

CKM_BEHAVIORREADSTATE

CKM_BEHAVIORRENAMED

CKM_BEHAVIORRESET

CKM_BEHAVIORRESETINBREAKBPOINT

CKM_BEHAVIORRESUME

CKM_BEHAVIORSETTINGSEDITED

CKM_MAX_BEHAVIOR_CALLBACKS

CKMANAGER_FUNC_OnCKEnd

CKMANAGER_FUNC_OnCKInit

CKMANAGER_FUNC_OnCKPause

CKMANAGER_FUNC_OnCKPlay

CKMANAGER_FUNC_OnCKPostReset

CKMANAGER_FUNC_OnCKReset

CKMANAGER_FUNC_OnPostBackToFront

CKMANAGER_FUNC_OnPostCopy

CKMANAGER_FUNC_OnPostFullScreen

CKMANAGER_FUNC_OnPostRender

CKMANAGER_FUNC_OnPostSpriteRender

CKMANAGER_FUNC_OnPreBackToFront

CKMANAGER_FUNC_OnPreCopy

CKMANAGER_FUNC_OnPreFullScreen

CKMANAGER_FUNC_OnPreRender

CKMANAGER_FUNC_OnPreSpriteRender

CKMANAGER_FUNC_OnRasterizerEvent

CKMANAGER_FUNC_OnSequenceAddedToScene

CKMANAGER_FUNC_OnSequenceDeleted

CKMANAGER_FUNC_OnSequenceRemovedFromScene

CKMANAGER_FUNC_OnSequenceToBeDeleted

CKMANAGER_FUNC_PostClearAll

CKMANAGER_FUNC_PostLaunchScene

CKMANAGER_FUNC_PostLoad

CKMANAGER_FUNC_PostProcess

CKMANAGER_FUNC_PostSave

CKMANAGER_FUNC_PreClearAll

CKMANAGER_FUNC_PreLaunchScene

CKMANAGER_FUNC_PreLoad

CKMANAGER_FUNC_PreProcess

CKMANAGER_FUNC_PreSave

CKMANAGER_FUNCTIONS

CKMaterial

CKMaterialShader

CKMesh

CKMessage

CKMessageHandler

CKMessageManager

CKMessageType

CKMidiManager

CKMidiSound

CKModelReader

CKMorphController

CKMorphKey

CKMOVIEERROR_FILECORRUPTED

CKMOVIEERROR_GENERIC

CKMOVIEERROR_READERROR

CKMOVIEERROR_SAVEERROR

CKMOVIEERROR_UNSUPPORTEDFILE

CKMOVIEERROR_UNSUPPORTEDSAVEFORMAT

CKMovieProperties

CKMovieReader

CKMUL

CKNOTEQUAL

CKObject

CKOBJECT_PRIORITYDEFAULT

CKOBJECT_PRIORITYLEVEL

CKOBJECT_PRIORITYMAX

CKOBJECT_PRIORITYMIN

CKOBJECT_PRIORITYPLACE

CKOBJECT_PRIORITYSCENE

CKObjectAnimation

CKObjectArray

CKObjectDeclaration

CKObjectsFunctions

CKOBJID

CKOperationDesc

CKOperationType

CKPackData

CKParameter

CKParameterIn

CKParameterLocal

CKParameterManager

CKParameterOperation

CKParameterOut

CKParameterType

CKPARAMETERTYPE_ENUMS

CKPARAMETERTYPE_FLAGS

CKPARAMETERTYPE_HIDDEN

CKPARAMETERTYPE_NOENDIANCONV

CKPARAMETERTYPE_RESERVED

CKPARAMETERTYPE_STRUCT

CKPARAMETERTYPE_TOSAVE

CKPARAMETERTYPE_USER

CKPARAMETERTYPE_VARIABLESIZE

CKParameterTypeDesc

CKParameterVariable

CKPatch

CKPatchEdge

CKPatchMesh

CKPathMaker

CKPathManager

CKPathSplitter

CKPGUID_2DCURVE

CKPGUID_2DENTITY

CKPGUID_2DVECTOR

CKPGUID_3DENTITY

CKPGUID_3DPOINTCLOUD

CKPGUID_3DSPRITEMODE

CKPGUID_ADDRESSMODE

CKPGUID_ANGLE

CKPGUID_ANIMATION

CKPGUID_ARRAYTYPE

CKPGUID_ATTRIBUTE

CKPGUID_AXIS

CKPGUID_BEHAVIOR

CKPGUID_BEOBJECT

CKPGUID_BINARYOPERATOR

CKPGUID_BITMAP_SYSTEMCACHING

CKPGUID_BLENDFACTOR

CKPGUID_BLENDMODE

CKPGUID_BODYPART

CKPGUID_BOOL

CKPGUID_BOX

CKPGUID_BUMPMAPPARAM

CKPGUID_CAMERA

CKPGUID_CHARACTER

CKPGUID_CLASSID

CKPGUID_COLOR

CKPGUID_COMBINE2TEX

CKPGUID_COMBINE3TEX

CKPGUID_COMPOPERATOR

CKPGUID_COPYDEPENDENCIES

CKPGUID_CRITICALSECTION

CKPGUID_CURVE

CKPGUID_CURVEPOINT

CKPGUID_CUSTOMIZEDPARAM

CKPGUID_DATAARRAY

CKPGUID_DELETEDEPENDENCIES

CKPGUID_DIRECTION

CKPGUID_ENUMS

CKPGUID_EULERANGLES

CKPGUID_FILLMODE

CKPGUID_FILTER

CKPGUID_FILTERMODE

CKPGUID_FLAGS

CKPGUID_FLOAT

CKPGUID_FLOATSLIDER

CKPGUID_FLOOR

CKPGUID_FLOORGEOMETRY

CKPGUID_FOCUSLOST_BEHAVIOR

CKPGUID_FOGMODE

CKPGUID_GLOBALEXMODE

CKPGUID_GROUP

CKPGUID_HOST_PLATFORM

CKPGUID_ID

CKPGUID_INT

CKPGUID_KERNELERROR

CKPGUID_KEY

CKPGUID_KINEMATICCHAIN

CKPGUID_LAYERTYPE

CKPGUID_LEVEL

CKPGUID_LIGHT

CKPGUID_LIGHTTYPE

CKPGUID_LITMODE

CKPGUID_MATERIAL

CKPGUID_MATERIALEFFECT

CKPGUID_MATRIX

CKPGUID_MESH

CKPGUID_MESSAGE

CKPGUID_MIDISOUND

CKPGUID_NONE

CKPGUID_OBJECT

CKPGUID_OBJECT3D

CKPGUID_OBJECTANIMATION

CKPGUID_OBJECTARRAY

CKPGUID_OBSTACLE

CKPGUID_OBSTACLEPRECISION

CKPGUID_OBSTACLEPRECISIONBEH

CKPGUID_OLDTIME

CKPGUID_PARAMETERTYPE

CKPGUID_PASS

CKPGUID_PATCHMESH

CKPGUID_PERCENTAGE

CKPGUID_PIXELFORMAT

CKPGUID_PLACE

CKPGUID_POINTER

CKPGUID_QUATERNION

CKPGUID_RECT

CKPGUID_RENDEROBJECT

CKPGUID_RENDEROPTIONS

CKPGUID_REPLACEDEPENDENCIES

CKPGUID_SAVEDEPENDENCIES

CKPGUID_SCENE

CKPGUID_SCENEACTIVITYFLAGS

CKPGUID_SCENEOBJECT

CKPGUID_SCENERESETFLAGS

CKPGUID_SCRIPT

CKPGUID_SETOPERATOR

CKPGUID_SHADEMODE

CKPGUID_SHADER

CKPGUID_SHADOWMAPATTENUATIONMODE

CKPGUID_SHADOWMAPFALLBACKPOLICY

CKPGUID_SHADOWMAPFORMAT

CKPGUID_SHADOWMAPTAPCOUNT

CKPGUID_SOUND

CKPGUID_SPRITE

CKPGUID_SPRITE3D

CKPGUID_SPRITEALIGN

CKPGUID_SPRITETEXT

CKPGUID_SPRITETEXTALIGNMENT

CKPGUID_STATE

CKPGUID_STATECHUNK

CKPGUID_STRING

CKPGUID_STRUCTS

CKPGUID_SUPPORT

CKPGUID_SYNCHRO

CKPGUID_TARGETCAMERA

CKPGUID_TARGETLIGHT

CKPGUID_TECHENUM

CKPGUID_TECHNIQUE

CKPGUID_TEXCOMBINE

CKPGUID_TEXGENEFFECT

CKPGUID_TEXGENREFEFFECT

CKPGUID_TEXTURE

CKPGUID_TIME

CKPGUID_UNICODESTRING

CKPGUID_VECTOR

CKPGUID_VECTOR4

CKPGUID_VIDEO

CKPGUID_VOIDBUF

CKPGUID_WAVESOUND

CKPGUID_WRAPMODE

CKPGUID_ZFUNC

CKPlace

CKPLUGIN_BEHAVIOR

CKPLUGIN_BEHAVIOR_DLL

CKPLUGIN_BITMAP

CKPLUGIN_BITMAP_READER

CKPLUGIN_EXTENSION_DLL

CKPLUGIN_EXTENSIONS

CKPLUGIN_MANAGER

CKPLUGIN_MANAGER_DLL

CKPLUGIN_MODEL

CKPLUGIN_MODEL_READER

CKPLUGIN_MOVIE

CKPLUGIN_MOVIE_READER

CKPLUGIN_RENDERENGINE

CKPLUGIN_RENDERENGINE_DLL

CKPLUGIN_SOUND

CKPLUGIN_SOUND_READER

CKPluginDll

CKPluginEntry

CKPluginEntryBehaviorsData

CKPluginEntryReadersData

CKPluginGetInfoCountFunction

CKPluginGetInfoFunction

CKPluginInfo

CKPluginManager

CKPOINT

CKPositionKey

CKRasterizerSpecificCaps

CKRAYINTERSECTION_DEFAULT

CKRAYINTERSECTION_FIRSTCONTACT

CKRAYINTERSECTION_IGNOREALPHA

CKRAYINTERSECTION_IGNOREBOTHSIDED

CKRAYINTERSECTION_IGNORECULLING

CKRAYINTERSECTION_SEGMENT

CKReaderGetReaderFunction

CKReadObjectState

CKRECT

CKRenderContext

CKRenderManager

CKRenderObject

CKRotationKey

CKRRCALLBACKFCT

CKRST_2DCAPS

CKRST_2DCAPS_3D

CKRST_2DCAPS_GDI

CKRST_2DCAPS_WINDOWED

CKRST_ALCHEMY

CKRST_BLENDCAPS

CKRST_BLENDCAPS_BOTHINVSRCALPHA

CKRST_BLENDCAPS_BOTHSRCALPHA

CKRST_BLENDCAPS_DESTALPHA

CKRST_BLENDCAPS_DESTCOLOR

CKRST_BLENDCAPS_INVDESTALPHA

CKRST_BLENDCAPS_INVDESTCOLOR

CKRST_BLENDCAPS_INVSRCALPHA

CKRST_BLENDCAPS_INVSRCCOLOR

CKRST_BLENDCAPS_ONE

CKRST_BLENDCAPS_SRCALPHA

CKRST_BLENDCAPS_SRCALPHASAT

CKRST_BLENDCAPS_SRCCOLOR

CKRST_BLENDCAPS_ZERO

CKRST_CMPCAPS

CKRST_CMPCAPS_ALWAYS

CKRST_CMPCAPS_EQUAL

CKRST_CMPCAPS_GREATER

CKRST_CMPCAPS_GREATEREQUAL

CKRST_CMPCAPS_LESS

CKRST_CMPCAPS_LESSEQUAL

CKRST_CMPCAPS_NEVER

CKRST_CMPCAPS_NOTEQUAL

CKRST_DIRECTX

CKRST_DP_CL_V

CKRST_DP_CL_VC

CKRST_DP_CL_VCST

CKRST_DP_CL_VCT

CKRST_DP_DIFFUSE

CKRST_DP_DOCLIP

CKRST_DP_IWEIGHT

CKRST_DP_LIGHT

CKRST_DP_MATRIXPAL

CKRST_DP_SPECULAR

CKRST_DP_STAGE

CKRST_DP_STAGEFLAGS

CKRST_DP_STAGES0

CKRST_DP_STAGES1

CKRST_DP_STAGES2

CKRST_DP_STAGES3

CKRST_DP_STAGES4

CKRST_DP_STAGES5

CKRST_DP_STAGES6

CKRST_DP_STAGES7

CKRST_DP_STAGESMASK

CKRST_DP_TANSPACE

CKRST_DP_TR_CL_V

CKRST_DP_TR_CL_VC

CKRST_DP_TR_CL_VCS

CKRST_DP_TR_CL_VCST

CKRST_DP_TR_CL_VCT

CKRST_DP_TR_CL_VNT

CKRST_DP_TR_V

CKRST_DP_TR_VC

CKRST_DP_TR_VCS

CKRST_DP_TR_VCST

CKRST_DP_TR_VCT

CKRST_DP_TR_VNT

CKRST_DP_TRANSFORM

CKRST_DP_TRANSFORMW

CKRST_DP_V

CKRST_DP_VBUFFER

CKRST_DP_VC

CKRST_DP_VCST

CKRST_DP_VCT

CKRST_DP_WEIGHT

CKRST_DP_WEIGHTMASK

CKRST_DP_WEIGHTS1

CKRST_DP_WEIGHTS2

CKRST_DP_WEIGHTS3

CKRST_DP_WEIGHTS4

CKRST_DP_WEIGHTS5

CKRST_DPFLAGS

CKRST_EVENT_CREATE

CKRST_EVENT_DESTROY

CKRST_EVENT_LOST

CKRST_EVENT_RESET

CKRST_EVENT_RESIZED

CKRST_EVENT_RESIZING

CKRST_EVENTS

CKRST_MAX_STAGES

CKRST_MISCCAPS

CKRST_MISCCAPS_CONFORMANT

CKRST_MISCCAPS_CULLCCW

CKRST_MISCCAPS_CULLCW

CKRST_MISCCAPS_CULLNONE

CKRST_MISCCAPS_MASKZ

CKRST_OPENGL

CKRST_RASTERCAPS

CKRST_RASTERCAPS_ANISOTROPY

CKRST_RASTERCAPS_DITHER

CKRST_RASTERCAPS_FOGPIXEL

CKRST_RASTERCAPS_FOGRANGE

CKRST_RASTERCAPS_FOGVERTEX

CKRST_RASTERCAPS_SUBPIXEL

CKRST_RASTERCAPS_WBUFFER

CKRST_RASTERCAPS_WFOG

CKRST_RASTERCAPS_ZBIAS

CKRST_RASTERCAPS_ZBUFFERLESSHSR

CKRST_RASTERCAPS_ZFOG

CKRST_RASTERCAPS_ZTEST

CKRST_RSTFAMILY

CKRST_SOFT

CKRST_SPECIFICCAPS

CKRST_SPECIFICCAPS_AUTGENMIPMAP

CKRST_SPECIFICCAPS_BLENDTEXTEFFECT

CKRST_SPECIFICCAPS_CANDOINDEXBUFFER

CKRST_SPECIFICCAPS_CANDOVERTEXBUFFER

CKRST_SPECIFICCAPS_CLAMPEDGEALPHA

CKRST_SPECIFICCAPS_COPYTEXTURE

CKRST_SPECIFICCAPS_DX5

CKRST_SPECIFICCAPS_DX7

CKRST_SPECIFICCAPS_DX8

CKRST_SPECIFICCAPS_DX9

CKRST_SPECIFICCAPS_GLATTENUATIONMODEL

CKRST_SPECIFICCAPS_HARDWARE

CKRST_SPECIFICCAPS_HARDWARETL

CKRST_SPECIFICCAPS_HW_SKINNING

CKRST_SPECIFICCAPS_POINTSPRITES

CKRST_SPECIFICCAPS_SOFTWARE

CKRST_SPECIFICCAPS_SPRITEASTEXTURES

CKRST_SPECIFICCAPS_SUPPORTSHADERS

CKRST_SPECIFICCAPS_VERTEXCOLORABGR

CKRST_STENCILCAPS

CKRST_STENCILCAPS_DECR

CKRST_STENCILCAPS_DECRSAT

CKRST_STENCILCAPS_INCR

CKRST_STENCILCAPS_INCRSAT

CKRST_STENCILCAPS_INVERT

CKRST_STENCILCAPS_KEEP

CKRST_STENCILCAPS_REPLACE

CKRST_STENCILCAPS_ZERO

CKRST_STRETCHRECT_BAD_CUBE_FACE_ERROR

CKRST_STRETCHRECT_BLIT_FROM_MULTISAMPLED_BACKBUFFER_ERROR

CKRST_STRETCHRECT_BLIT_TO_MULTISAMPLED_BACKBUFFER_ERROR

CKRST_STRETCHRECT_DEST_EQUAL_SOURCE_ERROR

CKRST_STRETCHRECT_DEST_RECT_ERROR

CKRST_STRETCHRECT_ERROR

CKRST_STRETCHRECT_NO_ERROR

CKRST_STRETCHRECT_NONPOW2_DEST_TEX_ERROR

CKRST_STRETCHRECT_NONPOW2_SRC_TEX_ERROR

CKRST_STRETCHRECT_OPERATION_FAILED_ERROR

CKRST_STRETCHRECT_SRC_RECT_ERROR

CKRST_STRETCHRECT_UNSUPPORTED

CKRST_TADDRESSCAPS

CKRST_TADDRESSCAPS_BORDER

CKRST_TADDRESSCAPS_CLAMP

CKRST_TADDRESSCAPS_INDEPENDENTUV

CKRST_TADDRESSCAPS_MIRROR

CKRST_TADDRESSCAPS_WRAP

CKRST_TEXTURECAPS

CKRST_TEXTURECAPS_ALPHA

CKRST_TEXTURECAPS_CONDITIONALNONPOW2

CKRST_TEXTURECAPS_CUBEMAP

CKRST_TEXTURECAPS_PERSPECTIVE

CKRST_TEXTURECAPS_POW2

CKRST_TEXTURECAPS_PROJECTED

CKRST_TEXTURECAPS_SQUAREONLY

CKRST_TEXTURECAPS_VOLUMEMAP

CKRST_TEXTURESTAGESTATETYPE

CKRST_TFILTERCAPS

CKRST_TFILTERCAPS_ANISOTROPIC

CKRST_TFILTERCAPS_LINEAR

CKRST_TFILTERCAPS_LINEARMIPLINEAR

CKRST_TFILTERCAPS_LINEARMIPNEAREST

CKRST_TFILTERCAPS_MIPLINEAR

CKRST_TFILTERCAPS_MIPNEAREST

CKRST_TFILTERCAPS_NEAREST

CKRST_TSS_AARG1

CKRST_TSS_AARG2

CKRST_TSS_ADDRESS

CKRST_TSS_ADDRESSU

CKRST_TSS_ADDRESSV

CKRST_TSS_ADDRESW

CKRST_TSS_ALPHAARG0

CKRST_TSS_AOP

CKRST_TSS_ARG1

CKRST_TSS_ARG2

CKRST_TSS_BORDERCOLOR

CKRST_TSS_BUMPENVLOFFSET

CKRST_TSS_BUMPENVLSCALE

CKRST_TSS_BUMPENVMAT00

CKRST_TSS_BUMPENVMAT01

CKRST_TSS_BUMPENVMAT10

CKRST_TSS_BUMPENVMAT11

CKRST_TSS_COLORARG0

CKRST_TSS_MAGFILTER

CKRST_TSS_MAXANISOTROPY

CKRST_TSS_MAXMIPMLEVEL

CKRST_TSS_MINFILTER

CKRST_TSS_MIPMAPLODBIAS

CKRST_TSS_OP

CKRST_TSS_RESULTARG0

CKRST_TSS_STAGEBLEND

CKRST_TSS_TEXCOORDINDEX

CKRST_TSS_TEXTUREMAPBLEND

CKRST_TSS_TEXTURETRANSFORMFLAGS

CKRST_UNKNOWN

CKRST_VTXCAPS

CKRST_VTXCAPS_DIRECTIONALLIGHTS

CKRST_VTXCAPS_LOCALVIEWER

CKRST_VTXCAPS_MATERIALSOURCE

CKRST_VTXCAPS_POSITIONALLIGHTS

CKRST_VTXCAPS_TEXGEN

CKRST_VTXCAPS_VERTEXFOG

CKSaveBitmap

CKSaveObjectState

CKScaleAxisKey

CKScaleKey

CKScene

CKSceneObject

CKSceneObjectIterator

CKSECONDARYANIMATION_DOWARP

CKSECONDARYANIMATION_FROMANIMATION

CKSECONDARYANIMATION_LASTFRAME

CKSECONDARYANIMATION_LOOP

CKSECONDARYANIMATION_LOOPNTIMES

CKSECONDARYANIMATION_ONESHOT

CKShader

CKShaderManager

CKSHOW

CKShutdown

CKSkin

CKSkinBoneData

CKSkinVertexData

CKSound

CKSOUND_EXTERNAL

CKSOUND_INCLUDEORIGINALFILE

CKSOUND_READER_EOF

CKSOUND_READER_GENERICERR

CKSOUND_READER_NO_DATA_READY

CKSOUND_READER_OK

CKSOUND_USEGLOBAL

CKSOUNDHANDLE

CKSoundManager

CKSoundReader

CKSprite

CKSprite3D

CKSpriteText

CKSPRITETEXT_ALIGNMENT

CKSPRITETEXT_BOTTOM

CKSPRITETEXT_CENTER

CKSPRITETEXT_HCENTER

CKSPRITETEXT_LEFT

CKSPRITETEXT_RIGHT

CKSPRITETEXT_TOP

CKSPRITETEXT_VCENTER

CKSquare

CKStartUp

CKStateChunk

CKStateObject

CKStats

CKStrdelete

CKStrdup

CKStreamWriter

CKSTRING

CKStringToClassID

CKStrlwr

CKStructHelper

CKStrupr

CKSUB

CKSynchroObject

CKTargetCamera

CKTargetLight

CKTCBFloatKey

CKTCBPositionKey

CKTCBRotationKey

CKTCBScaleAxisKey

CKTCBScaleKey

CKTexture

CKTEXTURE_EXTERNAL

CKTEXTURE_IMAGEFORMAT

CKTEXTURE_INCLUDEORIGINALFILE

CKTEXTURE_RAWDATA

CKTEXTURE_USEGLOBAL

CKTimeManager

CKTVPatch

CKUCHAR

CKUICALLBACKFCT

CKUICallbackStruct

CKUnPackData

CKUSTRING

CKVariableManager

CKVB_STATE

CKVERSION

CKVersion

CKVertexBuffer

CKVideo

CKVideoInfo

CKVideoInputFormatDesc

CKVideoManager

CKVINDEX

CKWaveFormat

CKWaveSound

CKWaveSound3DSettings

CKWaveSoundSettings

CKWORD

Class Hierarchy

Class Identifiers

ClassesClasses

ClassIDToGuid

ClassIDToType

Classify - see

VxPlane::Classify

VxFrustum::Classify

VxBbox::Classify

ClassifyFace

ClassifyVertices

ClassifyVerticesOneAxis

Clean

Clear - see

XSHashTable::Clear

XPriorityQueue::Clear

XNTree::Clear

XNHashTable::Clear

XMatrix::Clear

XList::Clear

XHashTable::Clear

XClassArray::Clear

XBitArray::Clear

XBinaryTree::Clear

XBTree::Clear

XArray::Clear

VxRect::Clear

VxMatrix::Clear

VxColor::Clear

CKStateChunk::Clear

CKRenderContext::Clear

CKObjectArray::Clear

CKKeyedAnimation::Clear

CKGroup::Clear

CKDataArray::Clear

CKBlendShapeSet::Clear

ClearAll - see

CKObjectAnimation::ClearAll

CKContext::ClearAll

ClearAllData

ClearSelection

ClearTime

ClientToScreen

Clip

ClipFlags

Clone - see

CKStateChunk::Clone

CKObjectAnimation::Clone

Close - see

VxThread::Close

VxFile::Close

CKStreamWriter::Close

CKCurve::Close

CloseChunk

CloseFile

CLOUD_ATTRIBUTE_COLOR

CLOUD_ATTRIBUTE_INTENSITY

CLOUD_ATTRIBUTE_NORMAL

CLOUD_ATTRIBUTE_UNUSED

CloudAttributeDescription

CloudIterator

CloudSelection

ColorChanged

ColorGetAlpha

ColorGetBlue

ColorGetGreen

ColorGetRed

ColorMap

ColorMapEntries

ColorModulateEnabled

Colors

ColorSetAlpha

ColorSetBlue

ColorSetGreen

ColorSetRed

ColumnsOperate

ColumnTransform

CommitChanges

Compact

Compare - see

XString::Compare

VxMatrix::Compare

CKObjectAnimation::Compare

Compilation Settings

CompileShader

CompileShaderOutput

COMPOSITION

COMPOSITIONBOUND

Compress

CompressionFunctions

Compute2dRootObjects

Compute3dRootObjects

ComputeBestFitBBox

ComputeObjectList - see

CKScene::ComputeObjectList

CKLevel::ComputeObjectList

ComputeProjectionMatrix

ComputeVertices

Consolidate

ConstAccessor

ConstIterator - see

XSHashTable::ConstIterator

XNHashTable::ConstIterator

XHashTable::ConstIterator

XBTree::ConstIterator

ConstrainToFloor

ConstReference

ConstructBoneTransfoMatrices

ConstructLocalMatrix

ConstructLocalMatrixEx

ConstructMeshTexture

constructor - see

XStringTokenizer::XStringTokenizer

XString::XString

XSmartPtr::XSmartPtr

XSHashTablePair::XSHashTablePair

XSHashTableIt::XSHashTableIt

XSHashTableConstIt::XSHashTableConstIt

XSHashTable::XSHashTable

XRefCount::XRefCount

XPtrStrided::XPtrStrided

XPriorityQueue::XPriorityQueue

XP::XP

XNTree::Node::Node

XNTree::Leaf::Leaf

XNHashTablePair::XNHashTablePair

XNHashTableIt::XNHashTableIt

XNHashTableConstIt::XNHashTableConstIt

XNHashTable::XNHashTable

XMatrix::XMatrix

XListIt::XListIt

XList::XList

XHashTable::XHashTable

XHashTable::Pair::Pair

XHashTable::Iterator::Iterator

XHashTable::ConstIterator::ConstIterator

XGUID::XGUID

XClassArray::XClassArray

XBitArray::XBitArray

XBinaryTreeNode::XBinaryTreeNode

XBinaryTreeIt::XBinaryTreeIt

XBinaryTree::XBinaryTree

XBaseString::XBaseString

XBTree::XBTree

XBTree::Iterator::Iterator

XBTree::ConstIterator::ConstIterator

XArray::XArray

XAP::XAP

VxVector4::VxVector4

VxVector::VxVector

VxUV::VxUV

VxTimeProfiler::VxTimeProfiler

VxThread::VxThread

VxSubFile::VxSubFile

VxStridedData::VxStridedData

VxSphere::VxSphere

VxSharedLibrary::VxSharedLibrary

VxScratchString::VxScratchString

VxScratch::VxScratch

VxRect::VxRect

VxRay::VxRay

VxRDTSCProfiler::VxRDTSCProfiler

VxQuaternion::VxQuaternion

VxPlane::VxPlane

VxOBB::VxOBB

VxMutexLock::VxMutexLock

VxMutex::VxMutex

VxMemoryPool::VxMemoryPool

VxMemoryMappedFile::VxMemoryMappedFile

VxMatrix::VxMatrix

VxImageDescEx::VxImageDescEx

VxFrustum::VxFrustum

VxFile::VxFile

VxEffectDescription::VxEffectDescription

VxDataMutexed::VxDataMutexed

VxDataMutexed::ConstAccessor::ConstAccessor

VxDataMutexed::Accessor::Accessor

VxCone::VxCone

VxCompressedVector::VxCompressedVector

VxColor::VxColor

VxBbox::VxBbox

VxAllocator::VxAllocator

VxAllocator::Stats::Stats

Vx2DVector::Vx2DVector

StandardRandomGenerator::StandardRandomGenerator

QuasiRandomGenerator::QuasiRandomGenerator

OverridenMaterial::OverridenMaterial

CKWaveSoundSettings::CKWaveSoundSettings

CKWaveSound3DSettings::CKWaveSound3DSettings

CKUICallbackStruct::CKUICallbackStruct

CKTCBRotationKey::CKTCBRotationKey

CKStructHelper::CKStructHelper

CKShader::CKShader

CKRenderObject::CKRenderObject

CKPluginInfo::CKPluginInfo

CKPathSplitter::CKPathSplitter

CKPathMaker::CKPathMaker

CKPatch::CKPatch

CKMovieProperties::CKMovieProperties

CKMorphKey::CKMorphKey

CKMesh::CKMesh

CKListenerSettings::CKListenerSettings

CKGUID::CKGUID

CKFileExtensionShort::CKFileExtensionShort

CKFileExtension::CKFileExtension

CKDirectoryParser::CKDirectoryParser

CKBezierPositionKey::CKBezierPositionKey

CKBezierFloatKey::CKBezierFloatKey

CKBehaviorContext::CKBehaviorContext

ConstructWorldMatrix

ConstructWorldMatrixEx

ContainClassID

Container classes

Containers

Contains

Context

continuity - see

CKTCBRotationKey::continuity

CKTCBPositionKey::continuity

CKTCBFloatKey::continuity

Convert

ConvertFromObjects - see

XSObjectArray::ConvertFromObjects

XObjectArray::ConvertFromObjects

ConvertToObjects - see

XSObjectArray::ConvertToObjects

XObjectArray::ConvertToObjects

Copy - see

VxStream::Copy

CKDependenciesContext::Copy

CopyContext

CopyFrom

CopyFunction

CopyObject

CopyObjects

CopyTo

CopyToVideo

CopyValue - see

CKParameterVariable::CopyValue

CKParameterOut::CopyValue

CKParameterLocal::CopyValue

CKParameter::CopyValue

Crc

Create - see

XString::Create

XMatrix::Create

VxPlane::Create

VxOBB::Create

CKWaveSound::Create

CKTexture::Create

CKSprite::Create

CKMidiManager::Create

CreateCKBehaviorPrototype

CreateCKFile

CreateCKObjectArray

CreateCKObjectDeclaration

CreateCKParameterIn

CreateCKParameterLocal

CreateCKParameterOperation

CreateCKParameterOut

CreateCKParameterVariable

CreateCKStateChunk

CreateController

CreateDefaultFunction

CreatedObject

CreateFromArray

CreateFromAscFile

CreateFromPointList

CreateGroup

CreateImage

CreateInput

CreateInputParameter

CreateLineMesh

CreateLineStrip

CreateLocalParameter

CreateMergedAnimation - see

CKObjectAnimation::CreateMergedAnimation

CKAnimation::CreateMergedAnimation

CreateMinion

CreateObject

CreateOutput

CreateOutputParameter

CreatePM

CreateRenderContext

CreateSelection

CreateShader

CreateShaderFromFile

CreateShaderFromFiles

CreateSkin

CreateSourceFromFile

CreateTail

CreateThread

CreateTransition - see

CKObjectAnimation::CreateTransition

CKAnimation::CreateTransition

CreateVertexBuffer

CreateVideo

Creating a Custom Building Block Dialog Box

Creating a Standalone Application

Creating Building Blocks

Creating Extensions Plugins

Creating New Parameter Types

Creating New Plugins

Creation of a New Manager

Creation of Bitmap Media Plugins

Creation of Media Plugins

Creation of Model Media Plugins

Creation of Movie Media Plugins

Creation of new Parameter Operations

Creation of Sound Media Plugins

CreatorDll

Crop

Cross

CrossProduct

CStr

Current

CURRENT

Current

CurrentCycleCount

CurrentLevel

CurrentRenderContext

CurrentScene

Custom Rendering

Cut

d1

d2

D3DDevice

D3DViewport

Data

DATA_PATH_IDX

DataChanged

DataPackSize

DataUnPackSize

DATE

DATEINNAME

DATELONGYEAR

DATELONGYEARMILLI

DATEMILLI

DATEMILLI2

DDBackBuffer

DDClipper

DDPrimaryBuffer

DDZBuffer

DeActivate

Declaration of the Building Block

DeclareInParameter

DeclareInput

DeclareLocalParameter

DeclareOutParameter

DeclareOutput

DeclareSetting

Decode

DEFAULT_MANAGERFUNC_PRIORITY

DefaultCloudAttribute

DefaultSize

DeleteAllAllocatedDatas

DeleteCKFile

DeleteCKObjectArray

DeleteCKStateChunk

DeleteController

DeleteControlPoint

DeleteFunction

DeleteInput

DeleteOutput

DeleteShader

DeleteSubTree

DeltaTime

DerivationMask

DerivedFrom

desc - see

CKShader::TechniqueInfo::desc

CKShader::PassInfo::desc

DescImage

Description

DestBlendCaps

Destroy

DestroyAllDynamicObjects

DestroyCKMaterialShader

DestroyMeshTexture

DestroyObject

DestroyObjects

DestroyPM

DestroyRenderContext

DestroySkin

DestroyVertexBuffer

destructor - see

XString::~XString

XSmartPtr::~XSmartPtr

XSHashTable::~XSHashTable

XRefCount::~XRefCount

XP::~XP

XNTree::~XNTree

XNHashTable::~XNHashTable

XMatrix::~XMatrix

XList::~XList

XHashTable::~XHashTable

XClassArray::~XClassArray

XBitArray::~XBitArray

XBinaryTreeNode::~XBinaryTreeNode

XBinaryTreeIt::~XBinaryTreeIt

XBinaryTree::~XBinaryTree

XBaseString::~XBaseString

XBTree::~XBTree

XArray::~XArray

XAP::~XAP

VxTimeProfiler::~VxTimeProfiler

VxThread::~VxThread

VxScratchString::~VxScratchString

VxScratch::~VxScratch

VxPoolObject::~VxPoolObject

VxMutexLock::~VxMutexLock

VxMutex::~VxMutex

VxLogListener::~VxLogListener

VxLog::~VxLog

VxFileListener::~VxFileListener

VxFile::~VxFile

VxDataMutexed::ConstAccessor::~ConstAccessor

VxDataMutexed::Accessor::~Accessor

VxConsoleListener::~VxConsoleListener

VxAllocator::~VxAllocator

CKVariableManager::Watcher::~Watcher

CKVariableManager::Variable::~Variable

CKStreamWriter::~CKStreamWriter

CKShader::~CKShader

Detach

DetachAll

DetachViewpointFromCamera

DetectCollision

DevCaps

DevicePostCallbacks

DevicePreCallbacks

Direct3D

DirectDraw

Directories functions

DIRECTORY

DIRECTORY_SEP_CHAR

DIRECTORY_SEP_STRING

DisplayModes

DissociateAllFaces

Distance - see

VxRay::Distance

VxPlane::Distance

VxIntersectionDesc::Distance

VxCone::Distance

DLL_EXPORT

DoesCharacterTakeOrientation

DoOperation

Dot - see

VxVector4::Dot

VxVector::Dot

Vx2DVector::Dot

DotProduct

Draw - see

CKVertexBuffer::Draw

CKSprite::Draw

CK2dEntity::Draw

DrawAABB

DrawFillRectangle

DrawFrustum

DrawNormal

DrawParabolic

DrawPlane

DrawPoint

DrawPoint2D

DrawPrimitive

DrawRectangle

DrawScene

DrawSphere

DrawText

Driver Caps

DriverDesc

DriverName

DstBlendMode

DumpKeysTo

DumpObjectManagerMemoryUse

DumpStats

DumpToFile

DumpToMemory

dwFlags

DWORD

dwParam

DxVersion

Dynamic Objects

easefrom - see

CKTCBRotationKey::easefrom

CKTCBPositionKey::easefrom

CKTCBFloatKey::easefrom

easeto - see

CKTCBRotationKey::easeto

CKTCBPositionKey::easeto

CKTCBFloatKey::easeto

edge

EDrawMode

EffectIndex

eLighting

EnableAlphaBlend

EnableAlphaTest

EnableAudio

EnableClipToCamera

EnableInputParameter

EnableKeyboardRepetition

EnableLighting - see

CloudSelection::EnableLighting

CK3dPointCloud::EnableLighting

EnableOutputParameter

EnablePerpectiveCorrection

EnablePMGeoMorph

EnableProfiling

EnableRatioOffset

EnableZWrite

End - see

XSHashTable::End

XNHashTable::End

XList::End

XHashTable::End

XClassArray::End

XBinaryTree::End

XBTree::End

XArray::End

END

End - see

CKVariableManager::Iterator::End

CKShader::End

CKSceneObjectIterator::End

Endianness

EndOfFile

EndOfList

EndPass

EndSave

EndShaders

EnsureLessThanNBonesPerVertex

EnsureVideoMemory

EnterCriticalSection

EnterMutex

EnterState

Enumerations

EnvironmentSettings

ePoint

ePrimitive

EPSILON

Erase - see

XBTree::Erase

XArray::Erase

EraseAt

Error Codes

eSprites

EstimatedInterfaceTime

eUseMatColor

Evaluate - see

CKMorphController::Evaluate

CKAnimController::Evaluate

EvaluateKeys

EvaluateMorphTarget

EvaluatePosition

EvaluateRotation

EvaluateScale

EvaluateScaleAxis

eVBUptodate

eVisible

EXECPERMISSION

Execute - see

CKBehaviorManager::Execute

CKBehavior::Execute

ExecuteBehaviors

ExecuteMeanings

ExecutePerPassMeanings

Exp

Expand - see

XClassArray::Expand

XArray::Expand

Export

ExportInputParameter

ExportOutputParameter

External Managers classes

External Readers classes

ExtractNode

FaceFace

FaceFaceIntersection

FaceIndex

FaceName

FacePlane

Family

FAQ

FastRemove - see

XClassArray::FastRemove

XArray::FastRemove

FastRemoveAt

Fct

FILEAPPEND

FileIndex

FILEINFO

FileMode

FileSize

FileVersion

FileWriteMode

Fill - see

XBitArray::Fill

XArray::Fill

FillDependencies

FillGridWithObjectShape

FillListByAttributes

FillListByGlobalAttributes

FillRemappedDependencies

FilteringEnabled

Find - see

XString::Find

XSHashTable::Find

XNHashTable::Find

XList::Find

XHashTable::Find

XClassArray::Find

XBinaryTree::Find

XBTree::Find

XArray::Find

VxBigFile::Find

FindComponent

FindDirectLeaf

FindDirectNode

FindID - see

XSObjectArray::FindID

XObjectArray::FindID

FindLeaf

FindNextValidTechnique

FindNode

FindObject - see

XSObjectPointerArray::FindObject

XSObjectArray::FindObject

XObjectPointerArray::FindObject

XObjectArray::FindObject

FindPtr - see

XSHashTable::FindPtr

XNHashTable::FindPtr

XHashTable::FindPtr

XBinaryTree::FindPtr

FindRow

FindRowIndex

Flags - see

VxLogListener::Flags

VxImageDescEx::Flags

VxDrawPrimitiveDataSimple::Flags

CloudSelection::Flags

CloudAttributeDescription::Flags

CKVariableManager::Variable::Flags

CKBezierPositionKey::Flags

CKBezierFloatKey::Flags

FlatShading

FLOAT

Flush

FlushPendingGPUCommands

FlushSecondaryAnimations

FlushSurfacePtr - see

CKSprite::FlushSurfacePtr

CKBitmapData::FlushSurfacePtr

FlushTextures

FONT_HANDLE

ForceCameraSettingsUpdate

Format

FormatTime

FreeVideoMemory - see

CKTexture::FreeVideoMemory

CKSprite::FreeVideoMemory

FromEulerAngles

FromMatrix

FromRotation

Front - see

XList::Front

XArray::Front

FrustumAABB

FrustumBox

FrustumFace

FrustumOBB

FXINPUTSTREAM_BINORMAL

FXINPUTSTREAM_BLENDINDICES

FXINPUTSTREAM_BLENDWEIGHT

FXINPUTSTREAM_COLOR

FXINPUTSTREAM_DEPTH

FXINPUTSTREAM_FOG

FXINPUTSTREAM_NORMAL

FXINPUTSTREAM_POSITION

FXINPUTSTREAM_POSITIONT

FXINPUTSTREAM_PSIZE

FXINPUTSTREAM_SAMPLE

FXINPUTSTREAM_TANGENT

FXINPUTSTREAM_TESSFACTOR

FXINPUTSTREAM_TEXCOORD

Gaussian - see

StandardRandomGenerator::Gaussian

QuasiRandomGenerator::Gaussian

GaussianDistribution

GENERIC_HANDLE

Get2dCoordsFrom3dPos

Get2dRoot

Get3dEntity

Get3dPosFrom2dCoords

GetAbsoluteTime

GetActivationDelay

GetActiveAnimation

GetActivePlugin

GetActivity

GetAlign

GetAllocatedScratchCount

GetAllocatedScratchMemory

GetAlphaFunc

GetAlphaRef

GetAlphaTestFunc

GetAlphaTestRefValue

GetAmbient

GetAmbientLight - see

CKScene::GetAmbientLight

CKRenderContext::SetAmbientLight

GetAnimation - see

CKKeyedAnimation::GetAnimation

CKCharacter::GetAnimation

GetAnimationCount - see

CKKeyedAnimation::GetAnimationCount

CKCharacter::GetAnimationCount

GetAnimationLevelOfDetail

GetAnnotationOriginalNames

GetAppData

GetApplicationFile

GetApplyToClassID

GetAspectRatio

GetAssociatedColor

GetAssociatedParam

GetAttachedCamera

GetAttachedEntity

GetAttributeCategory

GetAttributeCategoryIndex

GetAttributeCompatibleClassId

GetAttributeCount - see

CKBeObject::GetAttributeCount

CKAttributeManager::GetAttributeCount

GetAttributeDefaultValue

GetAttributeFlags

GetAttributeList

GetAttributeListPtr

GetAttributeManager

GetAttributeNameByType

GetAttributeParameter

GetAttributeParameterByIndex

GetAttributeParameterGUID

GetAttributeParameterType

GetAttributeType

GetAttributeTypeByName

GetAudioInputID

GetAuthorFlags

GetAuthorGuid

GetAuthorName

GetAutoParameterCount

GetAutoParameterInfo

GetAvailableOperationsDesc

GetAxes

GetAxis

GetBackgroundColor

GetBackgroundMaterial

GetBackgroundTextColor

GetBackgroundTexture

GetBackPlane

GetBalance

GetBaryCenter - see

CKMesh::GetBaryCenter

CK3dEntity::GetBaryCenter

GetBase

GetBehavioralRateLimit

GetBehaviorCallbackFct

GetBehaviorFlags

GetBehaviorManager

GetBehaviorMaxIteration

GetBias - see

CKCurvePoint::GetBias

CK2dCurvePoint::GetBias

GetBigFile

GetBigFileCount

GetBitCount

GetBitmapDefaultProperties

GetBitmapReader

GetBitShift

GetBlendShapeController

GetBlendShapeControllerCount

GetBlendShapeControllerTargetBlendShapeName

GetBlendShapeCount

GetBlendShapeIndexFromName

GetBlendShapeNameFromIndex

GetBlendShapeSet

GetBlendShapeWeightByIndex

GetBlendShapeWeightByName

GetBodyPart

GetBodyPartCount

GetBone - see

CKSkinVertexData::GetBone

CKSkinBoneData::GetBone

GetBoneCount - see

CKSkinVertexData::GetBoneCount

CKSkin::GetBoneCount

GetBoneData

GetBoneInitialInverseMatrix

GetBottomPlane

GetBottomRight

GetBoundingBox - see

CKRenderContext::GetBoundingBox

CK3dEntity::GetBoundingBox

GetBox

GetBroadcastObjectType

GetByIndex

GetCacheSize

GetCacheThreshold

GetCaps

GetCategoriesCount

GetCategory

GetCategoryByName

GetCategoryCount - see

CKPluginManager::GetCategoryCount

CKPathManager::GetCategoryCount

GetCategoryFlags

GetCategoryIndex - see

CKPluginManager::GetCategoryIndex

CKPathManager::GetCategoryIndex

GetCategoryName - see

CKPluginManager::GetCategoryName

CKPathManager::GetCategoryName

CKAttributeManager::GetCategoryName

GetCenter - see

VxRect::GetCenter

VxOBB::GetCenter

VxBbox::GetCenter

GetChainBodyCount

GetChainLength

GetChannelByMaterial

GetChannelCount

GetChannelDestBlend

GetChannelFlags

GetChannelMaterial

GetChannelShaderOverride

GetChannelSourceBlend

GetChannelType

GetCharacter - see

CKBodyPart::GetCharacter

CKAnimation::GetCharacter

GetChild - see

CK3dEntity::GetChild

CK2dEntity::GetChild

GetChildren

GetChildrenCount - see

XNTree::INode::GetChildrenCount

CloudIterator::GetChildrenCount

CK3dEntity::GetChildrenCount

CK2dEntity::GetChildrenCount

GetChunkClassID

GetChunkVersion

GetCKContext

GetClassDependencies

GetClassID

GetClassificationFromName

GetClassificationName

GetClearBackground

GetClearZBuffer

GetClipPlane

GetClipPlaneCount

GetCloudAttributeCount

GetCloudAttributeDescription

GetCloudAttributeIndexByName

GetColor - see

CKLight::GetColor

CKCurve::GetColor

GetColorsPtr

GetColumnCount

GetColumnName

GetColumnParameterGuid

GetColumnType

GetCommonClassID

GetCompatibleClassId

GetCompatibleClassID

GetCompressionLevel

GetCone

GetConstantAttenuation

GetContinuity - see

CKCurvePoint::GetContinuity

CK2dCurvePoint::GetContinuity

GetControlPoint - see

CKCurve::GetControlPoint

CK2dCurve::GetControlPoint

GetControlPointCount - see

CKCurve::GetControlPointCount

CK2dCurve::GetControlPointCount

GetCorners

GetCount - see

CKObjectArray::GetCount

CKDataArray::GetCount

GetCreationFunction

GetCurrentLevel

GetCurrentMesh

GetCurrentPointIndex

GetCurrentPointPosition

GetCurrentPointRealPosition

GetCurrentPos - see

CKStateChunk::GetCurrentPos

CKObjectArray::GetCurrentPos

CKMidiSound::GetCurrentPos

GetCurrentRenderOptions

GetCurrentScene - see

CKLevel::GetCurrentScene

CKContext::GetCurrentScene

GetCurrentShaderManagerType

GetCurrentShaderType

GetCurrentSlot - see

CKSprite::GetCurrentSlot

CKBitmapData::GetCurrentSlot

GetCurrentStep

GetCurrentVxThread

GetCurrentVxThreadId

GetCursorVisibility

GetCurve - see

CKCurvePoint::GetCurve

CK2dCurvePoint::GetCurve

GetCustomObjectFunction

GetData - see

XNTree::Leaf::GetData

XNTree::INode::GetData

CKObjectArray::GetData

GetDataBuffer

GetDataId

GetDataSize - see

CKStateChunk::GetDataSize

CKSoundReader::GetDataSize

CKParameter::GetDataSize

GetDataVersion

GetDateAsString

GetDefaultShader

GetDescription - see

CKVariableManager::Variable::GetDescription

CKObjectDeclaration::SetDescription

GetDesiredTexturesVideoFormat

GetDesiredVideoFormat - see

CKSprite::GetDesiredVideoFormat

CKBitmapData::GetDesiredVideoFormat

GetDestBlend

GetDestination - see

CKVideo::GetDestination

CKParameterOut::GetDestination

GetDestinationBlendMode

GetDestinationCount

GetDiffuse

GetDir - see

VxFrustum::GetDir

CKPathSplitter::GetDir

GetDirection - see

VxRay::GetDirection

VxCone::GetDirection

CKWaveSound::GetDirection

GetDirectory

GetDirectSource

GetDirectXInfo

GetDisplayMaterial

GetDisplayMesh

GetDisplayMode

GetDMax

GetDMin

GetDRatio

GetDrawMode

GetDrawPrimitiveIndices

GetDrawPrimitiveStructure

GetDrive

GetDriverIndex

GetDuration

GetDynamicHint

GetEdge

GetEdgeCount

GetEdges

GetEffect

GetEffectCount

GetEffectDescription

GetEffector

GetEffectParameter

GetElement

GetElementObject

GetElementStringValue

GetElementValue

GetElementValue_VSL

GetEmissive

GetEndEffector

GetEnumBuildString

GetErrorDescrition

GetErrorType

GetEstimatedVelocity

GetExclusiveAnimation

GetExitCode

GetExposedParameterCount

GetExposedParameterInfo

GetExt

GetExtension

GetExtent

GetExtents

GetF2Marks

GetFaceCount

GetFaceMaterial

GetFaceNormal

GetFaceNormalsPtr

GetFacesIndices

GetFaceVertex

GetFaceVertexIndex

GetFallOff

GetFallOffShape

GetFarPlane

GetFileInfo

GetFileMode

GetFileName - see

CKVideo::GetFileName

CKPathMaker::GetFileName

GetFilePath

GetFileSize

GetFileStreaming

GetFileWriteMode

GetFillMode

GetFillTexture

GetFittingCoeff

GetFixedObstacle

GetFixedObstacleCount

GetFlagBuildString

GetFlags - see

VxLogListener::GetFlags

CKVariableManager::Variable::GetFlags

CKObjectAnimation::GetFlags

CKMesh::GetFlags

CKDataReader::GetFlags

CKBezierPositionKey::GetFlags

CKBezierFloatKey::GetFlags

CKBehaviorPrototype::GetFlags

CKBehavior::GetFlags

CKAnimation::GetFlags

CK3dEntity::GetFlags

CK2dEntity::GetFlags

GetFloorObject

GetFloorObjectCount

GetFloorReferenceObject

GetFocusLostBehavior

GetFogColor - see

CKScene::GetFogColor

CKRenderContext::SetFogColor

GetFogDensity - see

CKScene::GetFogDensity

CKRenderContext::SetFogDensity

GetFogEnd - see

CKScene::GetFogEnd

CKRenderContext::SetFogEnd

GetFogMode - see

CKScene::GetFogMode

CKRenderContext::SetFogMode

GetFogStart - see

CKScene::GetFogStart

CKRenderContext::SetFogStart

GetFov

GetFrame

GetFrameRateForScreenMode

GetFrameRateLimit

GetFrontPlane

GetFunction - see

CKBehaviorPrototype::SetFunction

CKBehavior::GetFunction

GetFunctionPriority

GetFunctionPtr - see

VxSharedLibrary::GetFunctionPtr

CKPluginDll::GetFunctionPtr

GetGain

GetGlobalAttributeListPtr

GetGlobalImagesSaveFormat

GetGlobalImagesSaveOptions

GetGlobalMaterial

GetGlobalPointSize

GetGlobalRenderMode

GetGlobalSoundsSaveOptions

GetGlobalStats

GetGridArray

GetGridClassificationCatego

GetGridObject

GetGridObjectCount

GetGridPriority

GetGuid - see

VxOutputDebugListener::GetGuid

VxLogListener::GetGuid

VxFileListener::GetGuid

VxConsoleListener::GetGuid

GetGUID - see

CKVideoManager::GetGUID

CKParameterIn::GetGUID

CKParameter::GetGUID

GetGuid - see

CKObjectDeclaration::SetGuid

CKBehaviorPrototype::GetGuid

CKBaseManager::GetGuid

GetHalfSize - see

VxRect::GetHalfSize

VxBbox::GetHalfSize

GetHandle

GetHardwareSkinningRef

GetHCenter

GetHeight - see

XMatrix::GetHeight

VxRect::GetHeight

CKSprite::GetHeight

CKRenderContext::GetHeight

CKBitmapData::GetHeight

GetHeightValidity

GetHideFlag

GetHierarchicalBox

GetHighest

GetHomogeneousRect

GetHotSpot

GetID - see

VxThread::GetID

CKObject::GetID

GetImageDesc

GetInactiveManager

GetInactiveManagerCount

GetInBehaviorIO

GetIncludeManager

GetIndex

GetInitialActivationDelay

GetInitialPos

GetInParameter1

GetInParameter2

GetInput

GetInputCount

GetInputParameter

GetInputParameterCount

GetInputParameterObject

GetInputParameterPosition

GetInputParameterReadDataPtr

GetInputParameterValue

GetInputPosition

GetInputStreamFormat

GetInTangent

GetInverseWorldMatrix

GetIterationCount

GetIteratorByIndex

GetJoystickButtonsState

GetJoystickCount

GetJoystickPointOfViewAngle

GetJoystickPosition

GetJoystickRotation

GetJoystickSliders

GetKey - see

XSHashTableIt::GetKey

XSHashTableConstIt::GetKey

XNHashTableIt::GetKey

XNHashTableConstIt::GetKey

XHashTable::Iterator::GetKey

XHashTable::ConstIterator::GetKey

CKAnimController::GetKey

GetKeyboardState

GetKeyColumn

GetKeyCount

GetKeyFromBuffer

GetKeyFromName

GetKeyName

GetLastCmoLoaded

GetLastDeltaTime

GetLastDeltaTimeFree

GetLastError

GetLastExecutionTime - see

CKBehavior::GetLastExecutionTime

CKBeObject::GetLastExecutionTime

GetLastFileLoaded

GetLastFileSaved

GetLastFrameMatrix

GetLastFrameMessage

GetLastFrameMessageCount

GetLastUserProfileTime

GetLayer

GetLayerByIndex

GetLayerCount

GetLayerTypeCount

GetLeftPlane

GetLength - see

CKObjectAnimation::GetLength

CKGrid::GetLength

CKCurvePoint::GetLength

CKCurve::GetLength

CKAnimation::GetLength

CKAnimController::GetLength

CK2dCurvePoint::GetLength

CK2dCurve::GetLength

GetLevel - see

VxLogListener::GetLevel

CKScene::GetLevel

GetLevelDesc

GetLevelScene

GetLightPower

GetLimitAngle

GetLimitOptions

GetLimitTimes

GetLine

GetLinearAttenuation

GetLineCount

GetLineIndices

GetLinkedFrameRate

GetListener - see

VxLog::GetListener

CKSoundManager::GetListener

GetListInEditorFlag

GetLitMode

GetLoadedFile

GetLoadOffset

GetLoadScaleFactor

GetLocalBox

GetLocalMatrix

GetLocalParameter

GetLocalParameterCount

GetLocalParameterObject

GetLocalParameterPosition

GetLocalParameterReadDataPtr

GetLocalParameterValue

GetLocalParameterWriteDataPtr

GetLocalPos

GetLOD

GetLODPointCount

GetLog

GetLoop

GetLoopMode

GetLowest

GetMainTickCount

GetMainWindow

GetManager

GetManagerByGuid

GetManagerByName

GetManagerCount

GetManagers

GetMaterial - see

CKSprite3D::GetMaterial

CKMesh::GetMaterial

CK2dEntity::GetMaterial

GetMaterialCount

GetMaterialFaces

GetMaterialShader

GetMaxBonesPerVertex

GetMaximumDeltaTime

GetMaximumPointCount

GetMemberCount

GetMemberGUID

GetMemberName

GetMemoryOccupation - see

XPriorityQueue::GetMemoryOccupation

XNHashTable::GetMemoryOccupation

XHashTable::GetMemoryOccupation

XClassArray::GetMemoryOccupation

XBitArray::GetMemoryOccupation

XBinaryTree::GetMemoryOccupation

XArray::GetMemoryOccupation

CKObject::GetMemoryOccupation

GetMemorySize

GetMergeFactor - see

CKObjectAnimation::GetMergeFactor

CKAnimation::GetMergeFactor

GetMesh

GetMeshCount

GetMessageManager

GetMessageTypeCount

GetMessageTypeName

GetMinimumDeltaTime

GetMinMaxDistance

GetMipmapCount

GetMissingPlugins

GetMode

GetModelReader

GetModifierUV

GetModifierUVCount

GetModifierUVs

GetModifierVertex

GetModifierVertexCount

GetModifierVertices

GetModulateColor

GetModule

GetMorphController

GetMorphVertexCount

GetMouseButtonsState

GetMousePosition

GetMouseRelativePosition

GetMoveableFlags

GetMovieFileName - see

CKSprite::GetMovieFileName

CKBitmapData::GetMovieFileName

GetMovieFrameCount

GetMovieLength

GetMovieReader - see

CKSprite::GetMovieReader

CKPluginManager::GetMovieReader

CKBitmapData::GetMovieReader

GetMovingObstacle

GetMovingObstacleCount

GetMsgType

GetName - see

VxThread::GetName

VxLogListener::GetName

VxBigFile::GetName

CloudSelection::GetName

CKVariableManager::Iterator::GetName

CKShader::GetName

CKPathSplitter::GetName

CKObjectDeclaration::GetName

CKObject::GetName

CKBehaviorPrototype::GetName

CKBaseManager::GetName

GetNearest

GetNearestFloor

GetNearestFloors

GetNearestGrid

GetNearestLights

GetNearPlane

GetNextActiveAnimation

GetNextFile

GetNextFrame

GetNormal - see

VxPlane::GetNormal

CKSkin::SetNormal

GetNormalCount

GetNormalsPtr

GetNumberOfKeyInBuffer

GetNumShaders

GetObject - see

XSObjectPointerArray::GetObject

XSObjectArray::GetObject

XObjectPointerArray::GetObject

XObjectArray::GetObject

CKGroup::GetObject

CKContext::GetObject

CKBehaviorManager::GetObject

GetObjectAnimation

GetObjectAnimationCount

GetObjectByName

GetObjectByNameAndClass

GetObjectByNameAndParentClass

GetObjectCount - see

CKScene::GetObjectCount

CKGroup::GetObjectCount

CKContext::GetObjectCount

GetObjectFlags - see

CKScene::GetObjectFlags

CKObject::GetObjectFlags

GetObjectID - see

XSObjectPointerArray::GetObjectID

XSObjectArray::GetObjectID

XObjectPointerArray::GetObjectID

XObjectArray::GetObjectID

CKSceneObjectIterator::GetObjectID

GetObjectInitialValue

GetObjectInitMatrix

GetObjectIterator

GetObjectListByType

GetObjects

GetObjectsCount - see

CKDependenciesContext::GetObjectsCount

CKBehaviorManager::GetObjectsCount

GetObjectsCountByClassID

GetObjectSize

GetObjectsListByClassID

GetObstacle

GetObstacleCount

GetOccupation

GetOffset

GetOperationFunction

GetOperationGuid

GetOptionDescription

GetOptionsCount

GetOrderedChunks

GetOrientation - see

CKWaveSound::GetOrientation

CK3dEntity::GetOrientation

GetOrientationMode

GetOrigin - see

VxRay::GetOrigin

VxFrustum::GetOrigin

VxCone::GetOrigin

GetOrthographicZoom

GetOutBehaviorIO

GetOutParameter

GetOutput

GetOutputCount

GetOutputParameter

GetOutputParameterCount

GetOutputParameterObject

GetOutputParameterPosition

GetOutputParameterValue

GetOutputParameterWriteDataPtr

GetOutputPosition

GetOutTangent

GetOverridenChannelByMaterial

GetOwner - see

CKParameterOperation::GetOwner

CKParameterIn::GetOwner

CKParameter::GetOwner

CKLayer::GetOwner

CKBehaviorIO::GetOwner

CKBehavior::GetOwner

GetOwnerScript

GetPan

GetParameter

GetParameterClassID

GetParameterCount

GetParameterManager

GetParameterOperation

GetParameterOperationCount - see

CKParameterManager::GetParameterOperationCount

CKBehavior::GetParameterOperationCount

GetParameterSize

GetParameterTypeDescription

GetParameterTypesCount

GetParent - see

XNTree::Node::GetParent

CKBehavior::GetParent

CK3dEntity::GetParent

CK2dEntity::GetParent

GetPassCount

GetPassIndexByName

GetPassInfo

GetPatch

GetPatchCount

GetPatches

GetPatchMaterial

GetPatchSM

GetPathCount

GetPathIndex

GetPathManager

GetPathName

GetPickingPrecision

GetPickThreshold - see

CKSprite::SetPickThreshold

CKBitmapData::SetPickThreshold

GetPitch

GetPixel - see

CKSprite::GetPixel

CKBitmapData::GetPixel

GetPixelFormat

GetPlace

GetPlaceCount

GetPlayedMs

GetPlayerRenderContext

GetPlayingFrame

GetPlayingTime

GetPlayPosition

GetPluginCount

GetPluginDllCount

GetPluginDllInfo

GetPluginIndex

GetPluginInfo

GetPMGeoMorphStep

GetPointCoefficients

GetPointColor

GetPointCount

GetPointFloatAttribute

GetPointIntAttribute

GetPointIntensity

GetPointNormal

GetPointOriginalIndex

GetPointPosition

GetPointsCount

GetPortal

GetPortalCount

GetPos - see

CKCurve::GetPos

CK2dCurve::GetPos

GetPosition - see

XClassArray::GetPosition

XArray::GetPosition

CKWaveSound::GetPosition

CKPositionKey::GetPosition

CKObjectArray::GetPosition

CK3dEntity::GetPosition

CK2dEntity::GetPosition

CK2dCurvePoint::GetPosition

GetPositionController

GetPositionsPtr

GetPower

GetPreferredGrid

GetPriority - see

VxThread::GetPriority

CKWaveSound::SetPriority

CKBehavior::GetPriority

CKBeObject::GetPriority

GetProcessorDescription

GetProcessorFeatures

GetProcessorFrequency

GetProcessorType

GetProfileStats

GetProjectionTransformationMatrix

GetProjectionType

GetProtectable

GetPrototype

GetPrototypeGuid

GetPrototypeName

GetQuadraticAttenuation

GetQuantizationSamplingFactor

GetQuasiRandomGenerator

GetQuaternion

GetRadius - see

CKMesh::GetRadius

CK3dEntity::GetRadius

GetRange

GetRasterizerContext

GetRBound

GetReadDataPtr - see

CKParameterVariable::GetReadDataPtr

CKParameterOut::GetReadDataPtr

CKParameterIn::GetReadDataPtr

CKParameter::GetReadDataPtr

GetReader

GetReaderInfo

GetRealBox

GetRealSource

GetRecipient

GetRect

GetReferencePlace

GetRenderContext - see

CKRenderManager::GetRenderContext

CKLevel::GetRenderContext

GetRenderContextCount - see

CKRenderManager::GetRenderContextCount

CKLevel::GetRenderContextCount

GetRenderContextFromPoint

GetRenderDriverCount

GetRenderDriverDescription

GetRenderExtents

GetRenderManager

GetRenderOptions

GetRendezVousArrivedObject

GetRendezVousNumberOfArrivedObjects

GetRendezVousNumberOfWaiters

GetRepresentation

GetRF

GetRGB

GetRGBA

GetRight

GetRightPlane

GetRootBodyPart

GetRootEntity

GetRootIterator

GetRoots

GetRootsCount

GetRotation

GetRotationController

GetRow

GetRowCount

GetRstTextureIndex

GetRstTextureObject

GetRuntimeFlags

GetSaveFlag

GetSaveFormat - see

CKSprite::SetSaveFormat

CKBitmapData::SetSaveFormat

GetSaveOptions - see

CKVideoManager::GetSaveOptions

CKVideo::GetSaveOptions

CKSprite::SetSaveOptions

CKSound::GetSaveOptions

CKBitmapData::SetSaveOptions

GetScale

GetScaleAxisController

GetScaleController

GetScene

GetSceneCount

GetSceneIn

GetSceneInCount

GetScript

GetScriptCount

GetSecondaryAnimation

GetSecondaryAnimationMode

GetSecondaryAnimationsCount

GetSecureGuid

GetSelectedRenderEngine

GetSelection

GetSelectionCount

GetSemanticDesc

GetSemanticIndexFromFourCC

GetSemanticOriginalNames

GetSender

GetSendingType

GetSetBitPosition

GetShadeMode

GetShader

GetShaderByName

GetShaderParamObject

GetShaderParamValue

GetShadowShader

GetSharedSource

GetShortestDelay

GetSize - see

VxRect::GetSize

VxBbox::GetSize

CKSprite3D::GetSize

CK2dEntity::GetSize

GetSkin

GetSlotCount - see

CKSprite::GetSlotCount

CKBitmapData::GetSlotCount

GetSlotFileName - see

CKSprite::GetSlotFileName

CKBitmapData::GetSlotFileName

GetSmallest

GetSound3DInformation

GetSoundFileName - see

CKWaveSound::GetSoundFileName

CKMidiSound::GetSoundFileName

CKMidiManager::GetSoundFileName

GetSoundFormat

GetSoundLength

GetSoundReader

GetSourceBlend

GetSourceBlendMode

GetSourceRect

GetSoureObjectDeclaration

GetSpecular

GetSpecularColorsPtr

GetSpecularFlag

GetSpeed

GetSquareArray

GetSquareDistance

GetStartEffector

GetStartingCamera

GetStartOptions

GetState - see

CKVideo::GetState

CKRenderContext::GetState

GetStats

GetStep

GetStepCount

GetStereoRenderMode

GetStereoTextureRightEye

GetStreamedBufferSize

GetString

GetStringType

GetStringValue - see

CKVariableManager::Variable::GetStringValue

CKVariableManager::GetStringValue

CKParameterVariable::GetStringValue

CKParameterOut::GetStringValue

CKParameter::GetStringValue

CKDataArray::GetStringValue

GetSubBehavior

GetSubBehaviorCount

GetSubBehaviorLink

GetSubBehaviorLinkCount

GetSurfacesVideoMemoryOccupation

GetSystemCaching

GetSystemTextureDesc - see

CKTexture::GetSystemTextureDesc

CKSprite::GetSystemTextureDesc

GetTangents - see

CKCurvePoint::GetTangents

CKCurve::GetTangents

GetTangentSpaceCreationMode

GetTarget - see

CKLight::GetTarget

CKCamera::GetTarget

CKBehavior::GetTarget

GetTargetParameter

GetTechIndexByName

GetTechniqueEnumString

GetTechniqueEnumValue

GetTechniqueInfo

GetTechniquesCount

GetTempFileName

GetTension - see

CKCurvePoint::GetTension

CK2dCurvePoint::GetTension

GetText - see

CKSpriteText::GetText

CKShader::GetText

GetTextColor

GetTextU

GetTexture - see

CKVideo::GetTexture

CKMaterial::GetTexture

GetTextureAddressMode

GetTextureBlendMode

GetTextureBorderColor

GetTextureCoordinatesPtr

GetTextureMagMode

GetTextureMinMode

GetTextureOptions

GetTime - see

CKTimeManager::GetTime

CKKey::GetTime

GetTimeFormatValue

GetTimeManager

GetTimeScaleFactor

GetTimeToWaitForLimits

GetTopLeft

GetTransformedBonesArray

GetTransitionMode

GetTransparentColor - see

CKSprite::GetTransparentColor

CKBitmapData::GetTransparentColor

GetTV

GetTVCount

GetTVPatch

GetTVPatchCount

GetTVPatches

GetTVs

GetType - see

CKWaveSound::SetType

CKVideo::GetType

CKVariableManager::Variable::GetType

CKParameterIn::GetType

CKParameter::GetType

CKLight::GetType

CKLayer::GetType

CKBehaviorIO::GetType

CKBehavior::GetType

CKAnimController::GetType

GetTypeFromName

GetTypeName

GetUBound

GetUF

GetUnsetBitPosition

GetUp

GetUpPlane

GetUrl

GetUserClipPlane

GetUserMipMapLevel

GetUVMapping

GetValidFunctionsMask - see

CKShaderManager::GetValidFunctionsMask

CKBaseManager::GetValidFunctionsMask

GetValue - see

CKVariableManager::GetValue

CKParameterVariable::GetValue

CKParameterOut::GetValue

CKParameterIn::GetValue

CKParameter::GetValue

CKLayer::GetValue

CKFloatKey::GetValue

GetValue2

GetValueObject

GetVariable - see

CKVariableManager::Iterator::GetVariable

CKVariableManager::GetVariable

GetVariableCount

GetVariableIterator

GetVariableManager

GetVariableValue

GetVCenter

GetVec

GetVecCount

GetVecs

GetVelocity

GetVersion - see

CKObjectDeclaration::SetVersion

CKBehavior::GetVersion

GetVert

GetVertCount

GetVertexBufferCount

GetVertexBufferMemorySize

GetVertexColor

GetVertexCount - see

CKSkin::GetVertexCount

CKMesh::GetVertexCount

GetVertexData - see

CKSkin::GetVertexData

CKMesh::GetVertexData

GetVertexNormal

GetVertexPosition

GetVertexSpecularColor

GetVertexTextureCoordinates

GetVertexWeight

GetVertexWeightsCount

GetVertexWeightsPtr

GetVerticesRendered

GetVerts

GetVideo

GetVideoCount

GetVideoInfo

GetVideoInputID

GetVideoMemorySurfaceCount

GetVideoPixelFormat - see

CKTexture::GetVideoPixelFormat

CKSprite::GetVideoPixelFormat

GetVideoPlugin

GetVideoPluginByGuid

GetVideoPluginByName

GetVideoPriority

GetVideoTextureDesc - see

CKTexture::GetVideoTextureDesc

CKSprite::GetVideoTextureDesc

GetViewpoint

GetViewRect

GetViewTransformationMatrix

GetVirtoolsTemporaryFolder

GetVolume

GetVSPSVersion

GetWarper

GetWarperParameters

GetWaveFormat

GetWeight

GetWidth - see

XMatrix::GetWidth

VxRect::GetWidth

CKSprite::GetWidth

CKRenderContext::GetWidth

CKGrid::GetWidth

CKBitmapData::GetWidth

GetWindowHandle

GetWindowRect

getWindowsOffset

GetWorldMatrix

GetWorldTransformationMatrix

GetWrapMode

GetWriteDataPtr - see

CKParameterVariable::GetWriteDataPtr

CKParameterLocal::GetWriteDataPtr

CKParameter::GetWriteDataPtr

GetY

GetZFunc

GetZOrder

Global Functions

GoFullScreen

Goto

GouraudShading

Graphic Utilities

guid

Guid

GuidToClassID

HALFPI

HasAlpha

HasAttribute

HasColors

HasCompatibleClass

Hash Tables

HashName2Var

HasManagerDuplicates

HasMorphInfo

HasMorphNormalInfo

HasNormals

HasOriginalFile

HasPositionInfo

HasRotationInfo

HasScaleAxisInfo

HasScaleInfo

Hdr1PackSize

Hdr1UnPackSize

Height - see

VxImageDescEx::Height

VxDisplayMode::Height

VXFONTINFO::Height

HIDDEN

HierarchyParser - see

CK3dEntity::HierarchyParser

CK2dEntity::HierarchyParser

HMove

HTranslate

ICompare

IContains

id

Identity

IDFind

IDSeek

IFind

IgnoreAnimations

IKManagement

IKSetEffectorPos

Image

ImpactDesc

IMPACTNORMAL

IMPACTPOINT

IMPACTWORLDMATRIX

IMPLEMENT_POOL

IMPLEMENT_POOL_CLASS

Import

In - see

CKBezierPositionKey::In

CKBezierFloatKey::In

IncludeFile

Index - see

XSHashTable::Index

XNHashTable::Index

XHashTable::Index

CKParameterTypeDesc::Index

Inflate

Init

InitFctPtrFromGuid

InitFctPtrFromPrototype

InitFromGuid

InitFromPrototype

Initializations

INode

Insert - see

XSHashTable::Insert

XPriorityQueue::Insert

XNHashTable::Insert

XList::Insert

XHashTable::Insert

XClassArray::Insert

XBinaryTree::Insert

XBTree::Insert

XArray::Insert

InsertAt

InsertColumn

InsertControlPoint

InsertFront

InsertInput

InsertInputParameter

InsertLeaf

InsertLocalParameter

InsertNode

InsertObjectAt

InsertOutput

InsertOutputParameter

InsertRear

InsertRow

InsertSorted - see

XArray::InsertSorted

CKObjectArray::InsertSorted

InsertUnique - see

XSHashTable::Insert

XNHashTable::Insert

XHashTable::Insert

Instance

INSTANCE_HANDLE

InStride

INT

interior

InternalSetGain

Interpolate - see

VxVector::Interpolate

VxRect::Interpolate

VxRay::Interpolate

Interpolate

InterpolateFloatArray

InterpolateVectorArray

Intersect

IntersectionNormal

IntersectionPoint

Intersections

INV_RANDMAX

INVALID

InverseTransform

InverseTransformMany

InverseTransformVector

InverseWinding

Invert

InVertices

INVHALF_RANDMAX

InvMagnitude

InvSquareMagnitude

Is2Power

IsActive - see

CKGrid::IsActive

CKBehaviorIO::IsActive

CKBehavior::IsActive

IsActiveInCurrentScene

IsActiveInScene

IsAllInsideFrustrum

IsAllOutsideFrustrum

IsAlphaSaved

IsAlphaTransparent

IsAsynchronous

IsAttributeIndexValid

IsAudioEnabled

IsAutomaticProcess

IsBackground

IsBigFilePath

IsBoxInside - see

VxOBB::IsBoxInside

VxBbox::IsBoxInside

IsBoxTotallyInside

IsCategoryIndexValid

IsChannelActive

IsChannelLit

IsChildHere

IsClippedToCamera

IsClipToParent

IsCloudAttributeInVB

IsCloudAttributeUsed

IsCompatibleWith

IsCompositionDepending

IsConditionalNonPow2Authorized

IsCreated

IsCubeMap

IsDependenciesHere

IsDerivedFrom

IsDifferentFromDefault

IsDynamic

IsEmpty

IsFullScreen

IsHardware

IsHere - see

XSHashTable::IsHere

XNHashTable::IsHere

XList::IsHere

XHashTable::IsHere

XArray::IsHere

IsHidden

IsHiddenByParent

IsHierarchicallyHide

IsHierarchyInCollisionWithHierarchy

IsHomogeneousCoordinates

IsInBreak

IsInClearAll

IsInCollision

IsInCollisionWithHierarchy

IsInGrid

IsInGroup

IsInInterfaceMode

IsInLoad

IsInMode

IsInputActive

IsInputParameterEnabled

IsInRenderContext

IsInSave

IsInScene

IsInside - see

VxRect::IsInside

VxFrustum::IsInside

IsInVideoMemory - see

CKTexture::IsInVideoMemory

CKSprite::IsInVideoMemory

IsInViewFrustrum

IsInViewFrustrumHierarchic

IsJoinable

IsJoystickAttached

IsJoystickButtonDown

IsKeyboardAttached

IsKeyboardRepetitionEnabled

IsKeyDown

IsKeyToggled

IsKeyUp

IsLeaf - see

XNTree::Node::IsLeaf

CloudIterator::IsLeaf

IsLightingEnabled - see

CloudSelection::IsLightingEnabled

CK3dPointCloud::IsLightingEnabled

IsLightingTwoSided

IsLinear - see

CKCurvePoint::IsLinear

CK2dCurvePoint::IsLinear

IsLinkedToFrameRate

IsLocalParameterSetting

IsLost

IsMainCloudVisible

IsMainThread

IsManagerActive

IsMerged - see

CKObjectAnimation::IsMerged

CKAnimation::IsMerged

IsModule - see

VxLogListener::IsModule

VxLog::IsModule

IsMouseAttached

IsMouseButtonDown

IsMouseClicked

IsMouseToggled

IsNativeCompositionDepending

IsNode

IsNull

IsObjectActive

IsObjectAttached

IsObjectHere

IsObjectSafe

IsObjectToBeSaved

IsObstacle

IsOpen

IsOutputActive

IsOutputParameterEnabled

IsOutside

IsParentScriptActiveInScene

IsPaused - see

CKWaveSound::IsPaused

CKMidiSound::IsPaused

CKMidiManager::IsPaused

IsPickable - see

CK3dEntity::IsPickable

CK2dEntity::IsPickable

IsPlaying - see

CKWaveSound::IsPlaying

CKMidiSound::IsPlaying

CKMidiManager::IsPlaying

CKContext::IsPlaying

IsPM

IsPMGeoMorphEnabled

IsPointInside - see

VxSphere::IsPointInside

VxCone::IsPointInside

IsPointOnSurface

IsPreCleared

IsProfilingEnable

IsRatioOffset

IsReadOnly

IsRenderingShaderBatch

IsReseted

IsRootObject

IsSet

IsStarted

IsStateActive

IsStereoRenderingLeftEye

IsStereoTexture

IsSupported - see

CKShaderManager::IsSupported

CKShader::IsSupported

IsSupportedAndWarnIfNot

IsTargetable

IsTCB - see

CKCurvePoint::IsTCB

CK2dCurvePoint::UseTCB

IsToBeDeleted

IsTransparent - see

CKSprite::IsTransparent

CKMesh::IsTransparent

CKBitmapData::IsTransparent

IsTwoSided

IsTypeCompatible

IsUsingFunction

IsUsingMaterialColor - see

CloudSelection::IsUsingMaterialColor

CK3dPointCloud::IsUsingMaterialColor

IsUsingPointSprite

IsUsingSourceRect

IsUsingTarget

IsValid - see

VxSubFile::IsValid

VxStream::IsValid

VxMemoryMappedFile::IsValid

VxFile::IsValid

VxBbox::IsValid

CKStreamWriter::IsValid

isValid

IsVisible - see

CloudSelection::IsVisible

CKObject::IsVisible

CKLayer::IsVisible

IsVolumeMap

IsWaitingForMessages

Italic

Iterate

Iterator - see

XSHashTable::Iterator

XNHashTable::Iterator

XList::Iterator

XHashTable::Iterator

XClassArray::Iterator

XBTree::Iterator

XArray::Iterator

CKVariableManager::Iterator

LaunchScene

LEAF

Leaf

LeaveCriticalSection

LeaveMutex

LeaveState

left

Length

Lerp

Level

Level Organization

lightID

LineBox

LineFace

LineLineDistance

LineLineSquareDistance

LinePlane

LineRayDistance

LineRaySquareDistance

LineSegmentDistance

LineSegmentSquareDistance

LinkParameters

LinkTechnique

LinkToFrameRate

ListEmpty

ListenerFactory - see

VxOutputDebugListener::ListenerFactory

VxLog::ListenerFactory

VxFileListener::ListenerFactory

VxConsoleListener::ListenerFactory

LitChannel

Ln

LnDif

Load - see

VxSharedLibrary::Load

CKVideo::Load

CKModelReader::Load

CKFile::Load

CKContext::Load

LoadAndSave

LoadAnimationOnCharacter

LoadAttributesFromArray

LoadAttributesFromTextFile

LoadData

LoadElements

LoadFileData

LoadImage - see

CKTexture::LoadImage

CKSprite::LoadImage

LoadIndex

LoadMovie - see

CKTexture::LoadMovie

CKSprite::LoadMovie

LoadVertices

Lock - see

CKWaveSound::Lock

CKVertexBuffer::Lock

LockCurrentVB

LockReadBuffer

LockSurfacePtr - see

CKSprite::LockSurfacePtr

CKBitmapData::LockSurfacePtr

LockVideoMemory - see

CKTexture::LockVideoMemory

CKSprite::LockVideoMemory

LockWriteBuffer

LONG

LookAt

LookUp - see

XSHashTable::LookUp

XNHashTable::LookUp

XHashTable::LookUp

LPVOID

m_2dExtents

m_Active

m_AllShaders

m_AudioChannel

m_AudioFormat

m_Axis

m_BehaviorsGUID

m_BehaviorsInfo

m_Center

m_CompID

m_Context

m_CosTheta

m_CurrentPassCount

m_CurrentPassIndex

m_D

m_Data - see

XBinaryTreeNode::m_Data

CKMovieProperties::m_Data

CKBitmapProperties::m_Data

m_DefaultShader

m_Deltas

m_Direction - see

VxRay::m_Direction

VxCone::m_Direction

m_DisplayMaterial

m_DisplayMesh

m_DistanceFactor

m_DllFileName

m_DllInstance

m_DopplerFactor

m_DownDistance

m_DownFaceIndex

m_DownFloor

m_DownNormal

m_Duration

m_Entity

m_Eq

m_Extension - see

CKMovieProperties::m_Extension

CKBitmapProperties::m_Extension

m_Extents

m_ExtLong

m_ExtShort

m_FindNextValidTechnique

m_Flags - see

CloudSelection::m_Flags

CKDependencies::m_Flags

m_Format - see

CKVideoInputFormatDesc::m_Format

CKMovieProperties::m_Format

CKBitmapProperties::m_Format

m_Frequency

m_Gain

m_GetReaderFct

m_GlobalGain

m_Guid - see

VxOutputDebugListener::m_Guid

VxFileListener::m_Guid

VxConsoleListener::m_Guid

m_Guids

m_Hash

m_HeadRelative

m_Height

m_ImagePerSec

m_ImpactNormal

m_ImpactPoint

m_ImpactWorldMatrix

m_InAngle

m_Index - see

CKBlendShapeVertexDelta::m_Index

CKBlendShapeInitialVertex::m_Index

m_IndexInCategory

m_InitialVerts

m_InSlope

m_IsInterlaced

m_IsValid

m_Iterator - see

XSHashTablePair::m_Iterator

XNHashTablePair::m_Iterator

XHashTable::Pair::m_Iterator

m_Left

m_LogicalBlendShape

m_LogicalBlendShapeNames

m_ManagerGuid

m_ManagerName

m_Material

m_MaterialClass

m_MaterialShader

m_MaxDistance

m_MaxSize

m_MinDistance

m_MuteAfterMax

m_Name

m_NeededByFile

m_New - see

XSHashTablePair::m_New

XNHashTablePair::m_New

XHashTable::Pair::m_New

m_Node

m_Normal - see

VxPlane::m_Normal

CKBlendShapeInitialVertex::m_Normal

m_NormalDelta

m_ObstacleTouched

m_Offscreen

m_OptionCount

m_OrientationDir

m_OrientationUp

m_Origin - see

VxRay::m_Origin

VxCone::m_Origin

m_OutAngle

m_Output

m_OutsideGain

m_OutSlope

m_OwnerEntity

m_Pan

m_Params

m_PhysicalBlendShapes

m_Pitch

m_PluginCategory

m_PluginDllIndex

m_PluginInfo

m_PluginInfoCount

m_Pos

m_PosDelta

m_Position

m_PositionInDll

m_Priority

m_PriorityBias

m_ProcessingTime

m_PseudoChannelTexture

m_ReaderFlags

m_ReaderGuid - see

CKMovieProperties::m_ReaderGuid

CKBitmapProperties::m_ReaderGuid

m_ReadersInfo

m_RefCount

m_RenderOptionsBeforePlay

m_Right

m_RollOff

m_SamplingRate

m_SamplingSize

m_SavePreProcessed

m_SavePreprocessedOptions

m_SettingsParameterGuid

m_Shader

m_ShaderMeaningMaterial

m_ShaderTechniqueIndex

m_ShadowShader

m_ShadowViewProj

m_ShortExtension - see

CKMovieProperties::m_ShortExtension

CKBitmapProperties::m_ShortExtension

m_SinTheta

m_Size - see

CKVideoInputFormatDesc::m_Size

CKMovieProperties::m_Size

CKBitmapProperties::m_Size

m_SoftwareSources

m_SubFileMem

m_SubObstacleTouched

m_TechIndex

m_TechniqueName

m_TouchedFace

m_TouchedVertex

m_TouchingFace

m_TouchingVertex

m_Tree

m_UpDistance

m_UpFaceIndex

m_UpFloor

m_UpNormal

m_Velocity

m_VideoFormat

m_VideoInputFormatID

m_VideoManager

m_Weight

m_Width

MAC_USE_ANSI_FOR_VXFILE

Macro definitions

Macros

Magnitude - see

VxVector::Magnitude

Vx2DVector::Magnitude

Magnitude

Main Steps of Building Block Creation

Main Virtools Events

MakeParamsUpToDate

MakeParamsUpToDateForAllConcernedMaterials

ManagerCount

MarkAsCompositionDepending

MatchRightEyeToLeftEyeStereoTexturePairs

Material

MaterialDefault

Math Utilities

MatIndex

Matrix

Max - see

VxBbox::Max

Vx2DVector::Max

Max

MAX_MANAGERFUNC_PRIORITY

MAX_PIXEL_FORMATS

MAX_USER_PROFILE

MaxActiveLights

MaxClipPlanes

MaxIDSaved

Maximize

MaxIndexedBlendMatrices

MaxNumberBlendStage

MaxNumberTextureStage

MaxTextureCount

MaxTextureHeight

MaxTextureRatio

MaxTextureWidth

MaxVertexCountPerCall

MaxVideoMemory

Mem

Memory

Memset

Merge - see

VxRect::Merge

VxBbox::Merge

CKLevel::Merge

MergeIdenticalVertices

MessageManager

MillisecsToTicks

Min - see

VxBbox::Min

Vx2DVector::Min

Min

Minimize

MinTextureHeight

MinTextureWidth

Misc Utilities

MiscCaps

Miscellaneous Classes

Miscellaneous functions

ModifierUVMove

ModifierVertexMove

ModifyFlags - see

CKVariableManager::Variable::ModifyFlags

CKBehavior::ModifyFlags

CK2dEntity::ModifyFlags

ModifyMoveableFlags

ModifyObjectFlags - see

CKScene::ModifyObjectFlags

CKObject::ModifyObjectFlags

ModifyOptions

ModifyProcessorFeatures

ModulateColor

Move - see

XArray::Move

VxRect::Move

MoveColumn

MoveNode

MoveObjectDown

MoveObjectUp

MoveRow

Multiply

MultiplyAdd

MultiplyAddVector4Array

MultiplyAddVectorArray

MultiplyVector2Array

MultiplyVector4Array

MultiplyVectorArray

MUPREVSIZE

MUSIZE

Name

name - see

CKShader::TechniqueInfo::name

CKShader::PassInfo::name

CKShader::ParamInfo::name

Name

name

NATIVECOMPOSITION

NATIVECOMPOSITIONBOUND

NATIVEONLY

nAvgBytesPerSec

NB_STDPIXEL_FORMATS

NbLinesDrawn

nBlockAlign

NbObjectDrawn

NbPointsDrawn

NbTrianglesDrawn

NbVerticesProcessed

nChannels

NCompare

Near2Power

NearestLight

NearestPoint

NeededTextureCoordsCount

NeedManager

Next

NextNode

NextPoint

NextToken

NODATE

NODE

Node

NormalChanged

Normalize - see

VxVector::Normalize

VxRect::Normalize

VxQuaternion::Normalize

Vx2DVector::Normalize

Normalize

Normals

NormArray

NotifyUpdate

nSamplesPerSec

OBBOBB

Object - see

VxIntersectionDesc::Object

CKFileObject::Object

Object Dependencies Options

OBJECTARRAYCMPFCT

ObjectCid

ObjectCount

ObjectsCallbacksTime

ObjectsRenderTime

ObjPtr

ObstacleBetween

OBSTACLETOUCHED

offset

OnCKEnd

OnCKInit

OnCKPause

OnCKPlay

OnCKPostReset

OnCKReset - see

CKMessageManager::OnCKReset

CKBaseManager::OnCKReset

OnPostBackToFront

OnPostCopy

OnPostFullScreen

OnPostRender

OnPostSpriteRender

OnPreBackToFront

OnPreCopy

OnPreFullScreen

OnPreRender

OnPreSpriteRender

OnRasterizerEvent

OnRenderContextCreated

OnRenderContextDestroyed

Open - see

VxFile::Open

VxBigFile::Open

CKStreamWriter::Open

CKCurve::Open

OpenFile - see

CKSoundReader::OpenFile

CKMovieReader::OpenFile

CKMidiManager::OpenFile

CKFile::OpenFile

OpenMemory

OpenMode

OpenStream

OpenSubFile

OperationCodeToGuid

OperationCodeToName

OperationGuidToCode

OperationGuidToName

OperationNameToCode

OperationNameToGuid

operator!= - see

operator!=

XString::operator!=

XSHashTableIt::operator!=

XSHashTableConstIt::operator!=

XNHashTableIt::operator!=

XNHashTableConstIt::operator!=

XListIt::operator!=

XHashTable::Iterator::operator!=

XHashTable::ConstIterator::operator!=

XBinaryTreeIt::operator!=

XBTree::Iterator::operator!=

XBTree::ConstIterator::operator!=

VxMatrix::operator!=

VxImageDescEx::operator!=

Vx2DVector::operator!=

operator() - see

XPriority::operator()

XMatrix::operator()

XHashFunXStringI::operator()

XHashFunStringI::operator()

XHashFun::operator()

XEqualXStringI::operator()

XEqualStringI::operator()

XEqual::operator()

StandardRandomGenerator::operator()

QuasiRandomGenerator::operator()

operator* - see

operator*

XSmartPtr::operator*

XSHashTableIt::operator*

XSHashTableConstIt::operator*

XPtrStrided::operator*

XP::operator*

XNHashTableIt::operator*

XNHashTableConstIt::operator*

XListIt::operator*

XHashTable::Iterator::operator*

XHashTable::ConstIterator::operator*

XBinaryTreeIt::operator*

XBTree::Iterator::operator*

XBTree::ConstIterator::operator*

XAP::operator*

VxScratchString::operator*

VxQuaternion::operator*

VxMatrix::operator*

Vx2DVector::operator*

operator*= - see

VxVector4::operator*=

VxVector::operator*=

VxUV::operator*=

VxRect::operator*=

VxQuaternion::operator*=

VxMatrix::operator*=

VxColor::operator*=

Vx2DVector::operator*=

operator+ - see

operator+

XString::operator+

XPtrStrided::operator+

XListIt::operator+

VxVector4::operator+

VxVector::operator+

VxQuaternion::operator+

Vx2DVector::operator+

operator++ - see

XSHashTableIt::operator++

XSHashTableConstIt::operator++

XPtrStrided::operator++

XNHashTableIt::operator++

XNHashTableConstIt::operator++

XListIt::operator++

XHashTable::Iterator::operator++

XHashTable::ConstIterator::operator++

XBinaryTreeIt::operator++

XBTree::Iterator::operator++

XBTree::ConstIterator::operator++

VxMutex::operator++

CKVariableManager::Iterator::operator++

CKSceneObjectIterator::operator++

operator+= - see

XPtrStrided::operator+=

XArray::operator+=

VxVector4::operator+=

VxVector::operator+=

VxUV::operator+=

VxRect::operator+=

VxColor::operator+=

Vx2DVector::operator+=

operator- - see

operator-

XString::operator-

XListIt::operator-

VxVector4::operator-

VxVector::operator-

VxQuaternion::operator-

Vx2DVector::operator-

operator-- - see

XListIt::operator--

XHashTable::Iterator::operator--

XBTree::Iterator::operator--

XBTree::ConstIterator::operator--

VxMutex::operator--

operator-= - see

XBitArray::operator-=

XArray::operator-=

VxVector4::operator-=

VxVector::operator-=

VxUV::operator-=

VxRect::operator-=

VxColor::operator-=

Vx2DVector::operator-=

operator-> - see

XSmartPtr::operator->

XPtrStrided::operator->

XP::operator->

XBTree::ConstIterator::operator->

VxScratchString::operator->

operator/ - see

operator/

VxQuaternion::operator/

Vx2DVector::operator/

operator/= - see

VxVector4::operator/=

VxVector::operator/=

VxUV::operator/=

VxRect::operator/=

VxColor::operator/=

Vx2DVector::operator/=

operator< - see

operator<

XString::operator<

VxAllocator::Stats::operator<

Vx2DVector::operator<

operator<<

operator<= - see

operator<=

XString::operator<=

Vx2DVector::operator<=

operator= - see

XString::operator=

XSmartPtr::operator=

XSHashTable::operator=

XRefCount::operator=

XPtrStrided::operator=

XP::operator=

XNHashTable::operator=

XList::operator=

XHashTable::operator=

XClassArray::operator=

XBitArray::operator=

XBTree::operator=

XArray::operator=

XAP::operator=

VxVector4::operator=

VxVector::operator=

VxMatrix::operator=

VxCompressedVector::operator=

CKPathSplitter::operator=

operator== - see

operator==

XString::operator==

XSHashTableIt::operator==

XSHashTableConstIt::operator==

XNHashTableIt::operator==

XNHashTableConstIt::operator==

XListIt::operator==

XHashTable::Iterator::operator==

XHashTable::ConstIterator::operator==

XBinaryTreeIt::operator==

XBTree::Iterator::operator==

XBTree::ConstIterator::operator==

VxSphere::operator==

VxRay::operator==

VxPlane::operator==

VxOBB::operator==

VxMatrix::operator==

VxImageDescEx::operator==

VxFrustum::operator==

VxCone::operator==

VxBbox::operator==

Vx2DVector::operator==

OverridenMaterial::operator==

CKFileExtensionShort::operator==

CKFileExtension::operator==

operator>

operator>=

operator[] - see

XString::operator[]

XSHashTable::operator[]

XPtrStrided::operator[]

XNHashTable::operator[]

XHashTable::operator[]

XClassArray::operator[]

XBitArray::operator[]

XBaseString::operator[]

XArray::operator[]

VxVector4::operator[]

VxVector::operator[]

VxQuaternion::operator[]

VxMatrix::operator[]

Vx2DVector::operator[]

CKStructHelper::operator[]

OpGuid

Options - see

VxSpriteRenderOptions::Options

CKFileObject::Options

Options2

Or

Orthographic

OrthographicRect

Out - see

CKBezierPositionKey::Out

CKBezierFloatKey::Out

Outline

OutputToConsole

OutputToConsoleEx

OutputToConsoleExBeep

OutputToInfo

OutStride

OutVertices

Overloaded Operators

OverrideChannelTechnique

OverrideMaterial

OverridenMaterial

OWNERENTITY

P1Guid

P2Guid

Pair - see

XNHashTable::Pair

XHashTable::Pair

Param3

Parameter

ParameterDefaultValue

ParameterDescription

ParameterGuidToName

ParameterGuidToType

ParameterManager

ParameterNameToGuid

ParameterNameToType

ParameterOperation Types

ParametersClasses

ParameterType

ParameterTypeToGuid

ParameterTypeToName

ParametricOperations

ParamInfo

ParsePlugins

PassInfo

PasteShortcut

patch1

patch2

PathIsAbsolute

PathIsFile

PathIsUNC

PathIsURL

Pause - see

CKWaveSound::Pause

CKVideo::Pause

CKSoundReader::Pause

CKMidiSound::Pause

CKMidiManager::Pause

CKContext::Pause

PauseMinions

pConstTable

peak

Peek

Perspective

PerspectiveCorrectionEnabled

PerspectiveRect

PhongShading

PI

Pick

Pick2D

Planes

Play - see

CKWaveSound::Play

CKVideo::Play

CKSoundReader::Play

CKMidiSound::Play

CKMidiManager::Play

CKContext::Play

PlayMinion

PlaySecondaryAnimation

PluginsClasses

Point Clouds

Pointer

PointInFace

PointLineDistance

PointLineSquareDistance

PointRayDistance

PointRaySquareDistance

PointSegmentDistance

PointSegmentSquareDistance

Pop

PopBack - see

XList::PopBack

XClassArray::PopBack

XArray::PopBack

PopFront - see

XList::PopFront

XClassArray::PopFront

XArray::PopFront

Pos

PosArray

Position - see

VxSubFile::Position

VxStream::Position

VxFile::Position

PositionFind

Positions

PositionSeek

PositionSound

PostClearAll - see

CKSoundManager::PostClearAll

CKBaseManager::PostClearAll

PostLaunchScene

PostLoad

PostPackSize

PostProcess - see

CKShaderManager::PostProcess

CKMessageManager::PostProcess

CKBaseManager::PostProcess

PostSave

PostWrite

Pre-Registred Parameter Types

PreClearAll - see

CKShaderManager::PreClearAll

CKMessageManager::PreClearAll

CKBaseManager::PreClearAll

Prefixe

PreLaunchScene

PreLoad

PrePackSize

PrepareCameras

PreProcess - see

CKShaderManager::PreProcess

CKBaseManager::PreProcess

PreRead

Preroll

PreSave

Presentation of the Behavioral Engine

Presentation of the Process Loop

Presentation of the Rasterizers

Presentation of the Render Engine

Previous

PreviousScene

Print - see

VxOutputDebugListener::Print

VxLogListener::Print

VxLog::Print

VxFileListener::Print

VxConsoleListener::Print

Printf

PrintMT

PROC_APIC

PROC_ATHLON

PROC_CMOV

PROC_CMPXCHG8B

PROC_DE

PROC_FXSR

PROC_HASFPU

PROC_HTT

PROC_K63DNOW

PROC_MCA

PROC_MCE

PROC_MMX

PROC_MSR

PROC_MTRR

PROC_PAE

PROC_PAT

PROC_PENTIUM

PROC_PENTIUM2

PROC_PENTIUM2CELERON

PROC_PENTIUM2XEON

PROC_PENTIUM3

PROC_PENTIUM4

PROC_PENTIUMMMX

PROC_PENTIUMPRO

PROC_PGE

PROC_PN

PROC_PPC_ARM

PROC_PPC_G3

PROC_PPC_G4

PROC_PPC_MIPS

PROC_PSE

PROC_PSP

PROC_PST32

PROC_PSX2

PROC_RESERVED

PROC_SEP

PROC_SIMD

PROC_SS

PROC_TIMESTAMP

PROC_TM

PROC_UNKNOWN

PROC_V86

PROC_WNI

PROC_XBOX2

Process - see

CKRenderManager::Process

CKContext::Process

ProcessAnimation

ProcessMinions

Processor Identification

ProcessorsFeatures

ProcessorsType

ProcessTime

Product

ProductBuild

ProductVersion

Progress

ProgressionCallback

pTable

PtrFind

PtrSeek

PushBack - see

XList::PushBack

XClassArray::PushBack

XBTree::PushBack

XArray::PushBack

PushFront - see

XList::PushFront

XClassArray::PushFront

XArray::PushFront

QuasiRandomGenerator

Quaternions

Radius

RandomShuffle

RasterCaps

RayBox

RayFace

RayFaceCulled

RayIntersection

RayPlane

RayPlaneCulled

RayRayDistance

RayRaySquareDistance

RaySegmentDistance

RaySegmentSquareDistance

RaySphere

RBegin - see

XBTree::RBegin

XArray::RBegin

Read - see

VxSubFile::Read

VxStream::Read

VxFile::Read

ReadAndFillBuffer

ReadAndFillBuffer_LEndian - see

CKStateChunk::ReadAndFillBuffer_LEndian

CKStateChunk::ReadAndFillBuffer

ReadAndFillBuffer_LEndian16 - see

CKStateChunk::ReadAndFillBuffer_LEndian16

CKStateChunk::ReadAndFillBuffer

ReadASynchronousFile

ReadBitmap

ReadBitmap2

ReadBuffer

ReadByte

ReadDword

ReadDwordAsWords

ReadFile

ReadFloat

ReadFrame

ReadGuid

ReadIdentifier

ReadInt

ReadItems

ReadKeysFrom

ReadManagerInt

ReadManagerIntSequence

ReadMatrix

ReadMemory - see

CKSoundReader::ReadMemory

CKBitmapReader::ReadMemory

ReadObject

ReadObjectID

READONLY - see

VxFile::OpenMode::READONLY

CKVariableManager::Variable::Flags::READONLY

READPERMISSION

ReadRawBitmap

ReadReaderBitmap

ReadStream

ReadString

ReadStringUntilZero

ReadSubChunk

ReadVector

ReadWord

READWRITE

Reason

RebuildTechniqueEnum

RecomposeMatrix

RecomposeMatrixEx

Reconstruct

RectPick

Reference - see

XBTree::Reference

XArray::Reference

Reflect

RefreshRate

RegisterAABB

RegisterBehavior

RegisterClassification

RegisterCloudAttribute

RegisterFillRectangle

RegisterFrustum

RegisterListener

RegisterListenerFactory

RegisterModule

RegisterNewAttributeType

RegisterNewEnum

RegisterNewFlags

RegisterNewManager

RegisterNewStructure

RegisterNormal

RegisterOperationFunction

RegisterOperationType

RegisterParabolic

RegisterParameterType

RegisterPlane

RegisterPlugin

RegisterPluginInfo

RegisterPoint

RegisterPoint2D

RegisterRectangle

RegisterSphere

RegisterStereoTexture

RegisterText

RegisterType

RegisterVariable

RegisterVideo

RegisterVideoPlugin

RegisterWait

RegisterWatcher

REGULAR_FILE

Release - see

XP::Release

XAP::Release

VxAllocator::Release

CKMidiManager::Release

CKDataReader::Release

ReleaseAllSlots - see

CKSprite::ReleaseAllSlots

CKBitmapData::ReleaseAllSlots

ReleaseCurrentVB

ReleaseLibrary

ReleaseMemory - see

VxAllocator::ReleaseMemory

CKBitmapReader::ReleaseMemory

ReleaseMinions

ReleasePool

ReleasePoolObject

ReleaseScratch

ReleaseScratchString

ReleaseSlot - see

CKSprite::ReleaseSlot

CKBitmapData::ReleaseSlot

ReleaseString

ReleaseSurfacePtr - see

CKSprite::ReleaseSurfacePtr

CKBitmapData::ReleaseSurfacePtr

ReleaseUnusedScratch

ReLoadPluginDll

Remap

RemapID

RemapManagerInt

RemapVertices

Remove - see

XSHashTable::Remove

XNHashTable::Remove

XList::Remove

XHashTable::Remove

XClassArray::Remove

XBinaryTree::Remove

XArray::Remove

VxBigFile::Remove

VxAllocator::Stats::Remove

CKObjectArray::Remove

RemoveAllAttributes

RemoveAllCallbacks - see

CKRenderObject::RemoveAllCallbacks

CKMesh::RemoveAllCallbacks

RemoveAllControlPoints

RemoveAllDestinations

RemoveAllLayers

RemoveAllObjects

RemoveAllObstacles

RemoveAllScripts

RemoveAnimation - see

CKKeyedAnimation::RemoveAnimation

CKCharacter::RemoveAnimation

RemoveAt - see

XClassArray::Remove

XArray::RemoveAt

CKObjectArray::RemoveAt

RemoveAttribute

RemoveBigFile

RemoveBodyPart

RemoveCategory - see

CKPluginManager::RemoveCategory

CKPathManager::RemoveCategory

CKAttributeManager::RemoveCategory

RemoveChannel

RemoveChild

RemoveClassification

RemoveColumn

RemoveControlPoint

RemoveDestination

RemoveEscapedSpace

RemoveEventCallBack

RemoveFloorObject

RemoveFront

RemoveInput

RemoveInputParameter

RemoveKey

RemoveLayer

RemoveLocalParameter

RemoveMesh

RemoveObject - see

XSObjectPointerArray::RemoveObject

XSObjectArray::RemoveObject

XObjectPointerArray::RemoveObject

XObjectArray::RemoveObject

CKRenderContext::RemoveObject

CKLevel::RemoveObject

CKGroup::RemoveObject

CKBehaviorManager::AddObject

RemoveObjectAnimation

RemoveObjectFromScene

RemoveObjectNextFrame

RemoveObstacle

RemoveOutput

RemoveOutputParameter

RemoveParameter

RemoveParameterOperation

RemovePath

RemovePlace

RemovePortal

RemovePostRenderCallBack - see

CKRenderObject::RemovePostRenderCallBack

CKRenderContext::AddPostRenderCallBack

CKMesh::RemovePostRenderCallBack

RemovePostSpriteRenderCallBack

RemovePreRenderCallBack - see

CKRenderObject::RemovePreRenderCallBack

CKRenderContext::AddPreRenderCallBack

CKMesh::RemovePreRenderCallBack

RemoveRear

RemoveRenderCallBack

RemoveRenderContext - see

CKRenderManager::RemoveRenderContext

CKLevel::RemoveRenderContext

RemoveRow

RemoveScene

RemoveScript

RemoveSelection

RemoveShortcut

RemoveSubBehavior

RemoveSubBehaviorLink

RemoveTargetParameter

RemoveUnusedAttributes

RenameCategory - see

CKPluginManager::RenameCategory

CKPathManager::RenameCategory

RenameMessageType

RenamePath

REnd - see

XBTree::REnd

XArray::REnd

Render - see

CKRenderContext::Render

CKMesh::Render

CK3dEntity::Render

CK2dEntity::Render

Render Engine Enumerations

RenderBpps

RenderEngineClasses

RenderStateCacheHit

RenderStateCacheMiss

RenderTime

Replace

ReplaceInput

ReplaceInputParameter

ReplaceMaterial

ReplaceOutput

ReplaceOutputParameter

ReplaceTargetParameter

Reserve - see

XString::Reserve

XHashTable::Reserve

XClassArray::Reserve

XArray::Reserve

Reset - see

VxTimeProfiler::Reset

VxRDTSCProfiler::Reset

VxBbox::Reset

CKSynchroObject::Reset

CKObjectArray::Reset

CKDirectoryParser::Reset

CKCriticalSectionObject::Reset

CKContext::Reset

ResetActivationDelay

ResetChronos

ResetLastError

ResetRoll

ResGuid

Resize - see

XString::Resize

XClassArray::Resize

XArray::Resize

CKRenderContext::Resize

ResizeImages

ResolveFileName

Restart

Restore - see

CKVariableManager::Variable::Restore

CKTexture::Restore

CKSprite::Restore

RestoreAll

RestoreInitialSize

RestoreMode

RestoreOriginalVNPositions

RestoreSettings

RestoreValue

Resume - see

CKWaveSound::Resume

CKSoundReader::Resume

ResumeMinions

Reverse

Rewind - see

CKWaveSound::Rewind

CKSceneObjectIterator::Rewind

RFind

RGBAFTOCOLOR

RGBAITOCOLOR

right

Roll

Rot

Rotate - see

VxVector::Rotate

Rotate

CK3dEntity::Rotate

RotateVertices

RWAPPEND

Save - see

VxBigFile::Save

CKModelReader::Save

CKContext::Save

SaveData

SaveFile

SaveFlags

SaveImage - see

CKSprite::SaveImage

CKBitmapData::SaveImage

SaveImageAlpha

SaveIndex

SaveLoadFunction

SaveMemory

SaveObject

SaveObjectAsReference

SaveObjects

Saver_Manager

SaveSettings

SaveShaderToFile

Scale - see

VxRect::Scale

CKBlendShapeVertexDelta::Scale

ScaleVertices

Scanf

SceneTraversalTime

ScreenStride

ScreenToCamera

ScreenToClient

ScreenToViewpoint

ScreenVertices

Seek - see

VxSubFile::Seek

VxStream::Seek

VxFile::Seek

CKVideo::Seek

CKSoundReader::Seek

CKObjectArray::Seek

SeekIdentifier

SeekIdentifierAndReturnSize

SeekMode

SegmentBox

SegmentFace

SegmentFaceCulled

SegmentPlane

SegmentPlaneCulled

SegmentSegmentDistance

SegmentSegmentSquareDistance

Select

SelectBox

SelectCone

SelectConvexObject

SelectConvexObjectGroup

SelectPoint

SelectSphere

SendInterfaceMessage

SendMessage

SendMessageBroadcast

SendMessageGroup

SendMessageSingle

SequenceAddedToScene

SequenceDeleted - see

CKSoundManager::SequenceDeleted

CKBaseManager::SequenceDeleted

SequenceRemovedFromScene

SequenceToBeDeleted

Set - see

XPtrStrided::Set

XP::Set

XBitArray::Set

XAP::Set

VxVector4::Set

VxVector::Set

VxUV::Set

VxSubFile::Set

VxImageDescEx::Set

VxCompressedVector::Set

VxColor::Set

Vx2DVector::Set

Set3dEntity

SetActivationDelay

SetActiveAnimation

SetAlign

SetAlphaFunc

SetAlphaRef

SetAlphaTest

SetAmbient

SetAmbientLight - see

CKScene::SetAmbientLight

CKRenderContext::SetAmbientLight

SetAnimationLevelOfDetail

SetAppData

SetAppDataVSL

SetApplicationFile

SetApplyToClassID

SetAsCurrent - see

CKTexture::SetAsCurrent

CKMaterial::SetAsCurrent

SetAspectRatio

SetAssociatedColor

SetAssociatedParam

SetAsTargetable

SetAsWaitingForMessages

SetAsynchronous

SetAttribute

SetAttributeCallbackFunction

SetAttributeCategory

SetAttributeDefaultValue

SetAttributeNameByType

SetAudioInputID

SetAuthorGuid

SetAuthorName

SetAutomaticProcess

SetBackground

SetBackgroundColor - see

CKSpriteText::SetBackgroundColor

CKScene::SetBackgroundColor

SetBackgroundTexture

SetBackPlane

SetBalance

SetBehavioralRateLimit

SetBehaviorCallbackFct

SetBehaviorFlags

SetBehaviorMaxIteration

SetBias - see

CKCurvePoint::SetBias

CK2dCurvePoint::SetBias

SetBitmapDefaultProperties

SetBlending

SetBlendShapeSet

SetBlendShapeWeightByIndex

SetBlendShapeWeightByName

SetBone - see

CKSkinVertexData::SetBone

CKSkinBoneData::SetBone

SetBoneCount - see

CKSkinVertexData::SetBoneCount

CKSkin::SetBoneCount

SetBoneInitialInverseMatrix

SetBottomRight

SetBoundingBox

SetBroadcastObjectType

SetCacheSize

SetCacheThreshold

SetCallback

SetCallbackFunction

SetCanBeInterrupt

SetCategory

SetCategoryName

SetCenter - see

VxRect::SetCenter

VxBbox::SetCenter

SetChannelDestBlend

SetChannelFaceIndices

SetChannelFaceIndicesByMeshMaterials

SetChannelFlags

SetChannelMaterial

SetChannelSourceBlend

SetChannelType

SetCharacterOrientation

SetClassDependencies

SetClearBackground

SetClearZBuffer

SetClipPlane

SetClipPlaneCount

SetClipToParent

SetCloudAttributeDescription

SetCloudAttributeInVB

SetColor - see

CKLight::SetColor

CKCurve::SetColor

SetColorModulate

SetColumnName

SetColumnType

SetCompatibleClassId

SetCompatibleClassID

SetCompressionLevel

SetCone

SetConstantAttenuation

SetContinuity - see

CKCurvePoint::SetContinuity

CK2dCurvePoint::SetContinuity

SetCorners - see

VxRect::SetCorners

VxBbox::SetCorners

SetCreationFunction

SetCreationMode

SetCubeMap

SetCurrentLevel

SetCurrentMaterial

SetCurrentMesh

SetCurrentRenderOptions

SetCurrentSlot - see

CKSprite::SetCurrentSlot

CKBitmapData::SetCurrentSlot

SetCurrentStep

SetData

SetDataId

SetDataToRead

SetDataVersion

SetDefaultRenderCallBack

SetDescription - see

CKVariableManager::Variable::SetDescription

CKObjectDeclaration::SetDescription

SetDesiredTexturesVideoFormat

SetDesiredVideoFormat - see

CKSprite::SetDesiredVideoFormat

CKBitmapData::SetDesiredVideoFormat

SetDestBlend

SetDestination

SetDiffuse

SetDimension - see

VxRect::SetDimension

VxBbox::SetDimension

SetDimensions

SetDirectory

SetDirectSource

SetDisplayMaterial

SetDisplayMesh

SetDisplayMode

SetDrawMode

SetDynamicHint - see

CKSprite::SetDynamicHint

CKBitmapData::SetDynamicHint

SetEdge

SetEdgeCount

SetEffect

SetElementObject

SetElementStringValue

SetElementValue

SetElementValue_VSL

SetElementValueFromParameter

SetElementValueFromValue

SetEmissive

SetEndEffector

SetExclusiveAnimation

SetExt

SetFaceCount

SetFaceMaterial

SetFaceVertexIndex

SetFallOff

SetFallOffShape

SetFileName

SetFileStreaming

SetFileWriteMode

SetFillMode

SetFillTexture

SetFiltering

SetFittingCoeff

SetFlags - see

VxLogListener::SetFlags

CKObjectAnimation::SetFlags

CKMesh::SetFlags

CKBehaviorPrototype::SetFlags

CKBehavior::SetFlags

CKAnimation::SetFlags

CK3dEntity::SetFlags

CK2dEntity::SetFlags

SetFloorReferenceObject

SetFogColor - see

CKScene::SetFogColor

CKRenderContext::SetFogColor

SetFogDensity - see

CKScene::SetFogDensity

CKRenderContext::SetFogDensity

SetFogEnd - see

CKScene::SetFogEnd

CKRenderContext::SetFogEnd

SetFogMode - see

CKScene::SetFogMode

CKRenderContext::SetFogMode

SetFogStart - see

CKScene::SetFogStart

CKRenderContext::SetFogStart

SetFont

SetFov

SetFrame - see

CKObjectAnimation::SetStep

CKAnimation::SetFrame

SetFrameRateForScreenMode

SetFrameRateLimit

SetFrontPlane

SetFunction - see

CKBehaviorPrototype::SetFunction

CKBehavior::SetFunction

SetGain

SetGlobalImagesSaveFormat

SetGlobalImagesSaveOptions

SetGlobalMaterial

SetGlobalPointSize

SetGlobalRenderMode

SetGlobalSoundsSaveOptions

SetGridPriority

SetGUID - see

CKParameterIn::SetType

CKParameter::SetType

SetGuid - see

CKObjectDeclaration::SetGuid

CKBehaviorPrototype::SetGuid

SetHalfSize

SetHardwareSkinningRef

SetHeight

SetHeightValidity

SetHideFlag

SetHomogeneousCoordinates

SetHomogeneousRect

SetHotSpot

SetIdentity

SetInBehaviorIO

SetInformation

SetInformationMT

SetInitialActivationDelay

SetInitialPos

SetInTangent

SetInterfaceMode

SetIterationCount

SetKeyColumn

SetLastDeltaTime

SetLastError

SetLastFileSaved

SetLength - see

CKObjectAnimation::SetLength

CKAnimation::SetLength

CKAnimController::SetLength

SetLevel

SetLightPower

SetLimitAngle

SetLimitTimes

SetLine

SetLinear - see

CKCurvePoint::SetLinear

CK2dCurvePoint::IsLinear

SetLinearAttenuation

SetLineCount

SetListener

SetListInEditorFlag

SetLitMode

SetLoadedFile

SetLocalMatrix

SetLocalParameterObject

SetLocalParameterValue

SetLOD

SetLODPointCount

SetLoop

SetLoopMode

SetMaterial - see

CKSprite3D::SetMaterial

CK2dEntity::SetMaterial

SetMaterialShader

SetMaximumDeltaTime

SetMaximumPointCount

SetMergeFactor - see

CKObjectAnimation::SetMergeFactor

CKAnimation::SetMergeFactor

SetMessageHandler

SetMinimumDeltaTime

SetMinMaxDistance

SetMode

SetModifierUV

SetModifierVertex

SetMorphVertexCount

SetMoveableFlags

SetMsgType

SetName - see

VxThread::SetName

CloudSelection::SetName

CKShader::SetName

CKObject::SetName

SetNextActiveAnimation

SetNextActiveAnimation2

SetNextActiveScene

SetNormal

SetNormalCount

SetObjectFlags

SetObjectInitialValue

SetObjectInitMatrix

SetOffset

SetOperationMode

SetOrientation - see

CKWaveSound::SetOrientation

CK3dEntity::SetOrientation

SetOrientationMode

SetOrthographicZoom

SetOutBehaviorIO

SetOutputParameterObject

SetOutputParameterValue

SetOutTangent

SetOverriddenRendering

SetOwner - see

CKParameterOperation::SetOwner

CKParameterLocal::SetOwner

CKParameterIn::SetOwner

CKParameter::SetOwner

SetPan

SetParameters

SetParent - see

CK3dEntity::SetParent

CK2dEntity::SetParent

SetPatch

SetPatchCount

SetPatchMaterial

SetPatchSM

SetPickable - see

CK3dEntity::SetPickable

CK2dEntity::SetPickable

SetPickingPrecision

SetPickThreshold - see

CKSprite::SetPickThreshold

CKBitmapData::SetPickThreshold

SetPitch

SetPixel - see

CKSprite::SetPixel

CKBitmapData::SetPixel

SetPMGeoMorphStep

SetPointColor

SetPointFloatAttribute

SetPointIntAttribute

SetPointIntensity

SetPointNormal

SetPosition - see

CKPositionKey::SetPosition

CK3dEntity::SetPosition

CK2dEntity::SetPosition

CK2dCurvePoint::SetPosition

SetPower

SetPriority - see

VxThread::SetPriority

CKWaveSound::SetPriority

CKBehavior::SetPriority

CKBeObject::SetPriority

SetProjectionTransformationMatrix

SetProjectionType

SetQuadraticAttenuation

SetQuantizationSamplingFactor

SetQuaternion

SetRange

SetReader

SetReaderOptionData

SetRecipient

SetRect

SetReferentialPosition

SetRenderAsTransparent

SetRenderCallBack - see

CKRenderObject::SetRenderCallBack

CKMesh::SetRenderCallBack

SetRenderOptions - see

CKSprite::SetRenderOptions

CKRenderManager::SetRenderOptions

SetRenderTarget

SetRendezVousNumberOfWaiters

SetResolveReferenceCallback

SetRootBodyPart

SetRotation

SetSaveFlag

SetSaveFormat - see

CKSprite::SetSaveFormat

CKBitmapData::SetSaveFormat

SetSaveOptions - see

CKVideoManager::SetSaveOptions

CKVideo::SetSaveOptions

CKSprite::SetSaveOptions

CKSound::SetSaveOptions

CKBitmapData::SetSaveOptions

SetSavePreProcessed

SetSavePreprocessOptions

SetScale

SetSecondaryAnimationMode

SetSender

SetSendingType

SetShadeMode

SetShader

SetShaderByName

SetShaderParamObject

SetShaderParamValue

SetSize - see

VxRect::SetSize

VxConsoleListener::SetSize

CKSprite3D::SetSize

CK2dEntity::SetSize

SetSlotCount - see

CKSprite::SetSlotCount

CKBitmapData::SetSlotCount

SetSlotFileName - see

CKSprite::SetSlotFileName

CKBitmapData::SetSlotFileName

SetSoundFileName - see

CKWaveSound::SetSoundFileName

CKMidiSound::SetSoundFileName

CKMidiManager::SetSoundFileName

SetSourceBlend

SetSourceRect

SetSpecular

SetSpecularFlag

SetSpeed

SetStartEffector

SetStartingCamera

SetState

SetStep - see

CKObjectAnimation::SetStep

CKAnimation::SetStep

SetStepCount

SetStereoRenderMode

SetStreamedBufferSize

SetStreamWriter

SetStringValue - see

CKVariableManager::Variable::SetStringValue

CKVariableManager::SetStringValue

CKParameterVariable::SetStringValue

CKParameterLocal::SetStringValue

CKParameter::SetStringValue

SetSystemCaching - see

CKSprite::SetSystemCaching

CKBitmapData::SetSystemCaching

SetTangents - see

CKCurvePoint::SetTangents

CKCurve::SetTangents

SetTangentSpaceCreationMode

SetTarget - see

CKLight::SetTarget

CKCamera::SetTarget

SetTechnique

SetTechniqueByName

SetTension - see

CKCurvePoint::SetTension

CK2dCurvePoint::SetTension

SetText - see

CKSpriteText::SetText

CKShader::SetText

SetTextColor

SetTextU

SetTexture - see

CKVideo::SetTexture

CKRenderContext::SetTexture

CKMaterial::SetTexture

SetTextureAddressMode

SetTextureBlendMode

SetTextureBorderColor

SetTextureMagMode

SetTextureMatrix

SetTextureMinMode

SetTextureOptions

SetTextureStageState

SetTime

SetTimeFormat

SetTimeScaleFactor

SetTopLeft

SetTransitionMode

SetTransparent - see

CKSprite::SetTransparent

CKMesh::SetTransparent

CKBitmapData::SetTransparent

SetTransparentColor - see

CKSprite::SetTransparentColor

CKBitmapData::SetTransparentColor

SetTV

SetTVCount

SetTVPatch

SetTVPatchCount

SetTwoSided

SetTwoSidedLighting

SetType - see

CKWaveSound::SetType

CKVideo::SetType

CKParameterIn::SetType

CKParameter::SetType

CKLight::SetType

CKBehaviorIO::SetType

CKBehavior::SetType

SetTypeName

SetUpdate2DProjEnableFlag

SetupLights

SetUrl

SetUserClipPlane

SetUserMipMapMode

SetUVMapping

SetValue - see

CKVariableManager::SetValue

CKParameterVariable::SetValue

CKParameterOut::SetValue

CKParameterLocal::SetValue

CKParameter::SetValue

CKLayer::SetValue

CKFloatKey::SetValue

SetValue2

SetValuesOfUsedAutomatics

SetVariableValue

SetVec

SetVelocity

SetVersion - see

CKObjectDeclaration::SetVersion

CKBehavior::SetVersion

SetVert

SetVertexColor

SetVertexCount - see

CKSkin::SetVertexCount

CKMesh::SetVertexCount

SetVertexData

SetVertexNormal

SetVertexPosition

SetVertexSpecularColor

SetVertexTextureCoordinates

SetVertexWeight

SetVertexWeightsCount

SetVerticesRendered

SetVertVecCount

SetVideoInputID

SetVideoPriority

SetViewport

SetViewRect

SetViewTransformationMatrix

SetVisible - see

CloudSelection::SetVisible

CKLayer::SetVisible

SetVolume

SetVolumeMap

SetWeight

SetWidth

SetWindowRect

SetWindowsOffset

SetWorldMatrix

SetWorldTransformationMatrix

SetWrapMode

SetZFunc

SetZOrder

Shaders and Effects

Shared

ShareDataFrom

ShareSourceWith

Show

ShowCursor

ShowMainCloud

ShowSetup

SIMD_SUPPORTED

Size - see

XSHashTable::Size

XNHashTable::Size

XMatrix::Size

XList::Size

XHashTable::Size

XClassArray::Size

XBitArray::Size

XBTree::Size

XArray::Size

VxSubFile::Size

VxStream::Size

VxImageDescEx::Size

VxFile::Size

size - see

VxAllocator::Stats::size

CKShader::StreamParam::size

sizeofarray

SkinTime

Skip

Slerp - see

VxCompressedVector::Slerp

Slerp

SmoothedFps

SmoothingGroup

Sort - see

XClassArray::Sort

XArray::Sort

CKObjectArray::Sort

CKDataArray::Sort

SOUND_PATH_IDX

SoundEngineClasses

SpecularColors

SPEEDSTEP_SAFE

SphereAABB

SphereSphere

Split - see

VxTimeProfiler::Split

VxRDTSCProfiler::Split

Sprite

SpriteCallbacksTime

SpriteTime

Squad

SquareDistance

squareDistance

SquareMagnitude - see

VxVector::SquareMagnitude

Vx2DVector::SquareMagnitude

SquareMagnitude

SrcBlendCaps

SrcBlendMode

STAGEBLEND

StandardRandomGenerator

START

StartDependencies

StartManagerReadSequence

StartManagerSequence

StartObjectIDSequence

StartProfile

StartRead

StartReadSequence

StartSave

StartSubChunkSequence

StartWrite

Stats

StencilBpps

StencilCaps

Stop - see

CKWaveSound::Stop

CKVideo::Stop

CKSoundReader::Stop

CKMidiSound::Stop

CKMidiManager::Stop

StopDependencies

StopFullScreen

StopProfile

StopSecondaryAnimation

Str

StreamParam

StreamParamUsage

StretchRectSupport

Stride

STRING

String functions

StringFunction

Strings

Strip

Structures

SUBOBSTACLETOUCHED

Substring

Sum

Summary

Swap - see

XList::Swap

XClassArray::Swap

XBTree::Swap

XArray::Swap

CKTexture::Swap

SwapCurrentWithNext

SwapCurrentWithPrevious

SwapPaths

SwapRows

SwapStereoTexturePairs

SynchronizeApplicationFile

System Functions

System Utilities

SystemToVideoMemory - see

CKTexture::SystemToVideoMemory

CKSprite::SystemToVideoMemory

Table

TechniqueInfo

tension - see

CKTCBRotationKey::tension

CKTCBPositionKey::tension

CKTCBFloatKey::tension

Terminate

TestInsert - see

XNHashTable::Insert

XHashTable::Insert

TestRow

TestSet

TestUnset

Tex1Description

Tex2Description

Tex3Description

TexCoord

TexCoords

TEXTAPPEND

TEXTREADONLY

TEXTREADWRITE

TEXTRWAPPEND

TextureAddressCaps

TextureCaps

TextureFilterCaps

TextureFormats

TEXTWRITEONLY

TexU

TexV

The Context

The VxMath Library

TicksToMillisecs

TIME

Time

Time Management

TimeFormat

TimeManager

TimeStep

ToChildByBranch

ToChildByIndex

ToDouble

ToEulerAngles

ToFloat

ToInt

ToLower

ToMatrix

top

ToParent

ToRotation

total

TotalBehaviorExecution

TotalFrameTime

TOUCHEDFACE

TOUCHEDVERTEX

TOUCHINGFACE

TOUCHINGVERTEX

ToUpper

Transform - see

VxRect::Transform

VxRay::Transform

VxFrustum::Transform

VxCone::Transform

CKRenderContext::Transform

CK3dEntity::Transform

TransformFrom

TransformFromHomogeneous

TransformMany

TransformTo

TransformToHomogeneous

TransformVector

TransformVertices

Translate - see

VxRect::Translate

CK3dEntity::Translate

TranslateVertices

TransparentObjectsSortTime

Traverse

Trim

tv

Type - see

XNTree::Node::Type

XBTree::Type

XArray::Type

CKVariableManager::Variable::Type

type

Type definitions

TypeName

Types definitions

TypeToClassID

UICopyObjects

UICreatorFunction

UIPasteObjects

UnBind

Underline

Understanding the Render Loop

Unique

UNKNOWN_PF

Unload

UnloadAllVideos

UnLoadPluginDll

Unlock - see

CKWaveSound::Unlock

CKVertexBuffer::Lock

UnLock

UnlockVideoMemory - see

CKTexture::LockVideoMemory

CKSprite::LockVideoMemory

UnOptimize

UnregisterAllStereoTextures

UnRegisterAttribute

UnRegisterCloudAttribute

UnregisterListener

UnRegisterOperationFunction

UnRegisterOperationType

UnRegisterParameterType

UnregisterStereoTexture

UnregisterVideo

UnregisterVideoPlugin

UnRegisterWait

UnRegisterWatcher

Unset

Update

UpdateListenerSettings

UpdateRoot

UpdateSkin

UpdateSymbols

usage

usageIndex

USE_PIX

UseCloudAttribute

UseColors

UseEnvironmentSettings

UseFunction

UseGraph

UseMaterialColor - see

CloudSelection::UseMaterialColor

CK3dPointCloud::UseMaterialColor

UseMipmap

UseNormals

UsePointSprite

UserProfileEnd

UserProfiles

UserProfileStart

UseSourceRect

UseTarget

UseTCB - see

CKCurvePoint::UseTCB

CK2dCurvePoint::UseTCB

Using 2D Entities

Using 3D Entities

Using Arrays

Using Attributes

Using Base Classes and Tools

Using Groups

Using Materials

Using Meshes

Using Messages

Using Parameters

Using Portals

Using Render Contexts

Using Sounds

Using State Chunks

Using Textures

Using the Behavior Engine

Using the Render Engine

Using the Visual C++ AppWizard to Create a Building Block

Using the Visual C++ AppWizard to Create a Manager

Using Virtools SDK

Using X Containers

UVChanged

v

v1

v2

Valid

ValidGuids

Value - see

VxDataMutexed::ConstAccessor::Value

VxDataMutexed::Accessor::Value

CKFloatKey::Value

ValueType

VARDESCRIPTION

Variable

VariablesClasses

vec

vec12

vec21

VectorIn - see

VxOBB::VectorIn

VxBbox::VectorIn

Vectors

VertexCaps

VertexCount

VertexMove

Video Engine

VideoToSlotSystemMemory

VideoToSystemMemory

ViewportClip

Virtools API Architecture

Virtools Plugins Overview

Virtools SDK Architecture and Principles

Virtools SDK Documentation

Virtools SDK Reference

VIRTOOLS_MAX_EXTENSION_SIZE

VLALL

VLDEBUG

VLERROR

VLINFO

VLTRACE

VLWARNING

VMove

VTranslate

Vx2DCapsDesc

Vx2DVector

Vx3DCapsDesc

Vx3DDecomposeMatrix

Vx3DDecomposeMatrixTotal

Vx3DDecomposeMatrixTotalPtr

Vx3DInterpolateMatrix

Vx3DInterpolateMatrixNoScale

Vx3DInverseMatrix

Vx3DInverseMatrix44

Vx3DMatrixDeterminant

Vx3DMatrixFromEulerAngles

Vx3DMatrixFromRotation

Vx3DMatrixFromRotationAndOrigin

Vx3DMatrixIdentity

Vx3DMatrixPolarDecomposition

Vx3DMatrixSpectralDecomposition

Vx3DMatrixToEulerAngles

Vx3DMultiplyMatrix

Vx3DMultiplyMatrix4

Vx3DMultiplyMatrixVector

Vx3DMultiplyMatrixVector4

Vx3DMultiplyMatrixVector4Strided

Vx3DMultiplyMatrixVectorMany

Vx3DMultiplyMatrixVectorStrided

Vx3DQuaternionConjugate

Vx3DQuaternionDivide

Vx3DQuaternionFromMatrix

Vx3DQuaternionMultiply

Vx3DRotateVector

Vx3DRotateVectorMany

Vx3DRotateVectorStrided

Vx3DTransposeMatrix

VX_BPP1

VX_BPP16

VX_BPP2

VX_BPP24

VX_BPP32

VX_BPP4

VX_BPP8

VX_EFFECT

VX_EFFECTCALLBACK_RETVAL

VX_LIGHTDIREC

VX_LIGHTPARA

VX_LIGHTPOINT

VX_LIGHTSPOT

VX_LINELIST

VX_LINESTRIP

VX_LITMESH

VX_LOCK_DEFAULT

VX_LOCK_DISCARD

VX_LOCK_READONLY

VX_LOCK_WRITEONLY

VX_LOCKFLAGS

VX_MOVEABLE_BOXVALID

VX_MOVEABLE_CHARACTERRENDERED

VX_MOVEABLE_DONTUPDATEFROMPARENT

VX_MOVEABLE_EXTENTSUPTODATE

VX_MOVEABLE_FLAGS

VX_MOVEABLE_HASMOVED

VX_MOVEABLE_HIERARCHICALHIDE

VX_MOVEABLE_INDIRECTMATRIX

VX_MOVEABLE_INVERSEWORLDMATVALID

VX_MOVEABLE_NOZBUFFERTEST

VX_MOVEABLE_NOZBUFFERWRITE

VX_MOVEABLE_PICKABLE

VX_MOVEABLE_RENDERFIRST

VX_MOVEABLE_RENDERLAST

VX_MOVEABLE_RESERVED2

VX_MOVEABLE_STENCILONLY

VX_MOVEABLE_UPTODATE

VX_MOVEABLE_USERBOX

VX_MOVEABLE_VISIBLE

VX_MOVEABLE_WORLDALIGNED

VX_MOVEABLE_ZBUFONLY

VX_OSINFO

VX_PIXELFORMAT

VX_PLATFORMINFO

VX_POINTLIST

VX_PRELITMESH

VX_TRIANGLEFAN

VX_TRIANGLELIST

VX_TRIANGLESTRIP

VxAddDirectorySeparator

VxAddLibrarySearchPath

VxAllocator

VxBbox

VxBigFile

VXBLEND_BOTHINVSRCALPHA

VXBLEND_BOTHSRCALPHA

VXBLEND_DESTALPHA

VXBLEND_DESTCOLOR

VXBLEND_INVDESTALPHA

VXBLEND_INVDESTCOLOR

VXBLEND_INVSRCALPHA

VXBLEND_INVSRCCOLOR

VXBLEND_MASK

VXBLEND_MODE

VXBLEND_ONE

VXBLEND_SRCALPHA

VXBLEND_SRCALPHASAT

VXBLEND_SRCCOLOR

VXBLEND_ZERO

VxBpps

VxBppToMask

VXBUFFER_BACKBUFFER

VXBUFFER_STENCILBUFFER

VXBUFFER_TYPE

VXBUFFER_ZBUFFER

VXCHANNEL_ACTIVE

VXCHANNEL_FLAGS

VXCHANNEL_HINT_USEORIGINALMESHVB

VXCHANNEL_KEEPFOG

VXCHANNEL_LAST

VXCHANNEL_MATERIALSUBSET

VXCHANNEL_MONO

VXCHANNEL_NOTLIT

VXCHANNEL_RESERVED1

VXCHANNEL_SAMENORMAL

VXCHANNEL_SAMEUV

VXCHANNEL_SUBSET

VXCHANNEL_UPTODATE

VXCHANNEL_USEORIGINALMESHVB

VXCHANNEL_VERTEXCOLOR

VxClientToScreen

VXCLIP_ALL

VXCLIP_BACK

VXCLIP_BACKFRONT

VXCLIP_BOTTOM

VXCLIP_FLAGS

VXCLIP_FRONT

VXCLIP_LEFT

VXCLIP_RIGHT

VXCLIP_TOP

VXCMP_ALWAYS

VXCMP_EQUAL

VXCMP_GREATER

VXCMP_GREATEREQUAL

VXCMP_LESS

VXCMP_LESSEQUAL

VXCMP_MASK

VXCMP_NEVER

VXCMP_NOTEQUAL

VXCMPFUNC

VxColor

VxCompressedVector

VxComputeBestFitBBox

VxCone

VxConsoleListener

VxConvertBitmap

VxConvertBitmapTo24

VxConvertEndianArray16

VxConvertEndianArray32

VxConvertPathToSystemPath

VxConvertToBumpMap

VxConvertToNormalMap

VxCopyBitmap

VxCopyDwords2Words

VxCopyStructure

VxCopyWords2Dwords

VxCreateBitmap

VxCreateFileTree

VxCreateFont

VXCULL

VXCULL_CCW

VXCULL_CW

VXCULL_MASK

VXCULL_NONE

VXCURSOR_BUSY

VXCURSOR_LINKSELECT

VXCURSOR_MOVE

VXCURSOR_NORMALSELECT

VXCURSOR_POINTER

VxDataMutexed

VxDeleteAligned

VxDeleteBitmap

VxDeleteDirectory

VxDeleteFile

VxDeleteFont

VxDirectXData

VxDisplayMode

VxDistance

VxDoAlphaBlit

VxDoBlit

VxDoBlitDeInterleaved

VxDoBlitDeInterleavedUpsideDown

VxDoBlitUpsideDown

VxDrawBitmapText

VxDrawBitmapTextW

VxDrawPrimitiveData

VxDrawPrimitiveDataSimple

VxDriverDesc

VXEFFECT_2TEXTURES

VXEFFECT_3TEXTURES

VXEFFECT_BUMPENV

VXEFFECT_DP3

VXEFFECT_MASK

VXEFFECT_NONE

VXEFFECT_TEXGEN

VXEFFECT_TEXGENREF

VxEffectDescription

VXEFFECTRETVAL_SKIPALL

VXEFFECTRETVAL_SKIPALLTEX

VXEFFECTRETVAL_SKIPNONE

VXEFFECTRETVAL_SKIPTEXMAT

VxEndian16Swap

VxEndian32Swap

VxFile

VxFileExist

VxFileListener

VXFILL_MASK

VXFILL_MODE

VXFILL_POINT

VXFILL_SOLID

VXFILL_WIREFRAME

VxFillStructure

VXFOG_EXP

VXFOG_EXP2

VXFOG_LINEAR

VXFOG_MODE

VXFOG_NONE

VXFONTINFO

VxFrustum

VxGenerateMipMap

VxGetBitCounts

VxGetBitShifts

VxGetClientRect

VxGetCurrentDirectory

VxGetDirectory

VxGetEnvironmentVariable

VxGetFontInfo

VxGetFPUControlWord

VxGetModuleFileName

VxGetMouseButtonsSwapped

VxGetOs

VxGetParent

VxGetPlatform

VxGetTempPath

VxGetV3DLAppSupportDirectory

VxGetWindowRect

VxImageDesc2PixelFormat

VxImageDescEx

VxIndexedCopy

VxIntersect

VxIntersectionDesc

VxInverseProject

VxIsAllocatedByNewAligned

VXLIGHT_TYPE

VxLog

VxLogListener

VxMakeDirectory

VxMakePath

VxMath Reference

VxMatrix

VxMemoryMappedFile

VxMemoryPool

VXMESH_ALLFLAGS

VXMESH_BOUNDINGUPTODATE

VXMESH_BWEIGHTS_CHANGED

VXMESH_COLOR_CHANGED

VXMESH_FACENORMALSCOMPUTED

VXMESH_FLAGS

VXMESH_FORCETRANSPARENCY

VXMESH_GENNORMALS

VXMESH_GENTANSPACE

VXMESH_HASTRANSPARENCY

VXMESH_HINTDYNAMIC

VXMESH_LITMODE

VXMESH_MONOMATERIAL

VXMESH_NORMAL_CHANGED

VXMESH_OPTIMIZED

VXMESH_PM_BUILDNORM

VXMESH_POS_CHANGED

VXMESH_PRELITMODE

VXMESH_PROCEDURALPOS

VXMESH_PROCEDURALUV

VXMESH_STRIPIFY

VXMESH_TRANSPARENCYUPTODATE

VXMESH_UPDATEINDEXBUF

VXMESH_USECOLORANDNORMAL

VXMESH_UV_CHANGED

VXMESH_VISIBLE

VXMESH_WRAPU

VXMESH_WRAPV

VxMMF_Error

VxMMF_FileMapping

VxMMF_FileOpen

VxMMF_MapView

VxMMF_NoError

VxMoveWindow

VxMutex

VxMutexLock

VxNewAligned

VxOBB

VXOS_LINUXX86

VXOS_MACOS9

VXOS_MACOSX

VXOS_PSP

VXOS_PSX2

VXOS_UNKNOWN

VXOS_WII

VXOS_WIN2K

VXOS_WIN31

VXOS_WIN95

VXOS_WIN98

VXOS_WINCE1

VXOS_WINCE2

VXOS_WINCE3

VXOS_WINME

VXOS_WINNT4

VXOS_WINSEVEN

VXOS_WINVISTA

VXOS_WINXP

VXOS_XBOX

VXOS_XBOX2

VXOS_XBOX360

VxOutputDebugListener

VxPixelFormat2ImageDesc

VxPixelFormat2String

VxPlane

VXPLATFORM_LINUX

VXPLATFORM_MAC

VXPLATFORM_PSP

VXPLATFORM_PSX2

VXPLATFORM_UNKNOWN

VXPLATFORM_WII

VXPLATFORM_WINCE

VXPLATFORM_WINDOWS

VXPLATFORM_XBOX

VXPLATFORM_XBOX2

VxPoolObject

VXPRIMITIVETYPE

VxProjectBoxZExtents

VxPtInRect

VxQuaternion

VxRay

VxRDTSCProfiler

VXRDTSCPROFILER

VxRect

VxRemoveDirectory

VxRenameFile

VXRENDERSTATE_ALPHABLENDENABLE

VXRENDERSTATE_ALPHAFUNC

VXRENDERSTATE_ALPHAREF

VXRENDERSTATE_ALPHATESTENABLE

VXRENDERSTATE_AMBIENT

VXRENDERSTATE_AMBIENTFROMVERTEX

VXRENDERSTATE_ANTIALIAS

VXRENDERSTATE_BLENDOP

VXRENDERSTATE_CLIPPING

VXRENDERSTATE_CLIPPLANEENABLE

VXRENDERSTATE_COLORVERTEX

VXRENDERSTATE_COLORWRITEENABLE

VXRENDERSTATE_CULLMODE

VXRENDERSTATE_DESTBLEND

VXRENDERSTATE_DIFFUSEFROMVERTEX

VXRENDERSTATE_DITHERENABLE

VXRENDERSTATE_EDGEANTIALIAS

VXRENDERSTATE_EMISSIVEFROMVERTEX

VXRENDERSTATE_FILLMODE

VXRENDERSTATE_FOGCOLOR

VXRENDERSTATE_FOGDENSITY

VXRENDERSTATE_FOGENABLE

VXRENDERSTATE_FOGEND

VXRENDERSTATE_FOGPIXELMODE

VXRENDERSTATE_FOGSTART

VXRENDERSTATE_FOGVERTEXMODE

VXRENDERSTATE_INDEXVBLENDENABLE

VXRENDERSTATE_INVERSEWINDING

VXRENDERSTATE_LIGHTING

VXRENDERSTATE_LINEPATTERN

VXRENDERSTATE_LOCALVIEWER

VXRENDERSTATE_LOCKMATERIALSTATES

VXRENDERSTATE_NORMALIZENORMALS

VXRENDERSTATE_POINTSCALE_A

VXRENDERSTATE_POINTSCALE_B

VXRENDERSTATE_POINTSCALE_C

VXRENDERSTATE_POINTSCALEENABLE

VXRENDERSTATE_POINTSIZE

VXRENDERSTATE_POINTSIZE_MAX

VXRENDERSTATE_POINTSIZE_MIN

VXRENDERSTATE_POINTSPRITEENABLE

VXRENDERSTATE_RANGEFOGENABLE

VXRENDERSTATE_SCISSORTESTENABLE

VXRENDERSTATE_SHADEMODE

VXRENDERSTATE_SOFTWAREVPROCESSING

VXRENDERSTATE_SPECULARENABLE

VXRENDERSTATE_SPECULARFROMVERTEX

VXRENDERSTATE_SRCBLEND

VXRENDERSTATE_STENCILENABLE

VXRENDERSTATE_STENCILFAIL

VXRENDERSTATE_STENCILFUNC

VXRENDERSTATE_STENCILMASK

VXRENDERSTATE_STENCILPASS

VXRENDERSTATE_STENCILREF

VXRENDERSTATE_STENCILWRITEMASK

VXRENDERSTATE_STENCILZFAIL

VXRENDERSTATE_TEXTUREFACTOR

VXRENDERSTATE_TEXTUREPERSPECTIVE

VXRENDERSTATE_TEXTURETARGET

VXRENDERSTATE_TWOSIDEDLIGHTING

VXRENDERSTATE_VERTEXBLEND

VXRENDERSTATE_WRAP0

VXRENDERSTATE_WRAP1

VXRENDERSTATE_WRAP2

VXRENDERSTATE_WRAP3

VXRENDERSTATE_WRAP4

VXRENDERSTATE_WRAP5

VXRENDERSTATE_WRAP6

VXRENDERSTATE_WRAP7

VXRENDERSTATE_ZBIAS

VXRENDERSTATE_ZENABLE

VXRENDERSTATE_ZFUNC

VXRENDERSTATE_ZWRITEENABLE

VXRENDERSTATETYPE

VxResizeImage32

VxScanCodeToAscii

VxScanCodeToName

VxScratch

VxScratchString

VxScreenToClient

VxSetBaseFPUControlWord

VxSetCurrentDirectory

VxSetCursor

VxSetEnvironmentVariable

VxSetFPUControlWord

VxSetParent

VXSHADE_FLAT

VXSHADE_GOURAUD

VXSHADE_MASK

VXSHADE_MODE

VXSHADE_PHONG

VxShadeType

VXSHADOWMAP_13TAPS

VXSHADOWMAP_1TAP

VXSHADOWMAP_5TAPS

VXSHADOWMAP_9TAPS

VXSHADOWMAP_ATTENUATIONMODE

VXSHADOWMAP_DEBUGMATERIAL

VXSHADOWMAP_DIRECTIONALATTENUATION

VXSHADOWMAP_FALLBACKPOLICY

VXSHADOWMAP_FLOAT16WBUFFER

VXSHADOWMAP_FLOAT32WBUFFER

VXSHADOWMAP_FORMAT

VXSHADOWMAP_FORMATCOUNT

VXSHADOWMAP_HWSHADOWMAP16

VXSHADOWMAP_HWSHADOWMAP24S8

VXSHADOWMAP_LIGHTFACTORS

VXSHADOWMAP_NOATTENUATION

VXSHADOWMAP_NOFALLBACK

VXSHADOWMAP_PREFERFILTERING

VXSHADOWMAP_PREFERSAMPLING

VXSHADOWMAP_TAPCOUNT

VXSHADOWMAP_UNKNOWNFORMAT

VxSharedLibrary

VxShowCursor

VxSortFunc

VxSphere

VXSPRITE2_DISABLE_AA_CORRECTION

VXSPRITE2_NONE

VXSPRITE3D_BILLBOARD

VXSPRITE3D_ORIENTABLE

VXSPRITE3D_TYPE

VXSPRITE3D_XROTATE

VXSPRITE3D_YROTATE

VXSPRITE_ALPHATEST

VXSPRITE_BLEND

VXSPRITE_FILTER

VXSPRITE_MODULATE

VXSPRITE_NONE

VXSPRITE_RENDEROPTIONS

VXSPRITE_RENDEROPTIONS2

VxSpriteRenderOptions

VxStats

VXSTENCILOP

VXSTENCILOP_DECR

VXSTENCILOP_DECRSAT

VXSTENCILOP_INCR

VXSTENCILOP_INCRSAT

VXSTENCILOP_INVERT

VXSTENCILOP_KEEP

VXSTENCILOP_MASK

VXSTENCILOP_REPLACE

VXSTENCILOP_ZERO

VxStream

VxStridedData

VxStridedDataBase

VxSubFile

VXT_OK

VXT_STILLACTIVE

VXT_TERMINATEFORCED

VXTERROR_EXITCODE

VXTERROR_NULLTHREAD

VXTERROR_TIMEOUT

VXTERROR_WAIT

VxTestDiskSpace

VXTEXT_ALIGNMENT

VXTEXT_BOTTOM

VXTEXT_CENTER

VXTEXT_HCENTER

VXTEXT_LEFT

VXTEXT_RIGHT

VXTEXT_TOP

VXTEXT_VCENTER

VXTEXTURE_ADDRESSBORDER

VXTEXTURE_ADDRESSCLAMP

VXTEXTURE_ADDRESSMASK

VXTEXTURE_ADDRESSMIRROR

VXTEXTURE_ADDRESSMIRRORONCE

VXTEXTURE_ADDRESSMODE

VXTEXTURE_ADDRESSWRAP

VXTEXTURE_BLENDMODE

VXTEXTURE_FILTERMODE

VXTEXTURE_WRAPMODE

VXTEXTUREBLEND_ADD

VXTEXTUREBLEND_COPY

VXTEXTUREBLEND_DECAL

VXTEXTUREBLEND_DECALALPHA

VXTEXTUREBLEND_DECALMASK

VXTEXTUREBLEND_DOTPRODUCT3

VXTEXTUREBLEND_MASK

VXTEXTUREBLEND_MAX

VXTEXTUREBLEND_MODULATE

VXTEXTUREBLEND_MODULATEALPHA

VXTEXTUREBLEND_MODULATEMASK

VXTEXTUREFILTER_ANISOTROPIC

VXTEXTUREFILTER_LINEAR

VXTEXTUREFILTER_LINEARMIPLINEAR

VXTEXTUREFILTER_LINEARMIPNEAREST

VXTEXTUREFILTER_MASK

VXTEXTUREFILTER_MIPLINEAR

VXTEXTUREFILTER_MIPNEAREST

VXTEXTUREFILTER_NEAREST

VXTEXTUREWRAP_NONE

VXTEXTUREWRAP_U

VXTEXTUREWRAP_UV

VXTEXTUREWRAP_V

VXTF_NOCOINITIALIZE

VXTF_USECOINITIALIZE

VXTF_USECOINITIALIZEEX

VxThread

VXTHREAD_PRIORITY

VXTHREAD_STATE

VxThreadFunction

VXTHREADWIN32_FLAGS

VxTimeProfiler

VXTP_ABOVENORMAL

VXTP_BELOWNORMAL

VXTP_HIGHLEVEL

VXTP_IDLE

VXTP_LOWLEVEL

VXTP_NORMAL

VXTP_TIMECRITICAL

VxTransformBox2D

VxTransformData

VXTS_CREATED

VXTS_INITIALE

VXTS_JOINABLE

VXTS_MAIN

VXTS_STARTED

VxURLDownloadToCacheFile

VxUV

VxVector

VxVector4

VxWindowFromPoint

VXWRAP_MASK

VXWRAP_MODE

VXWRAP_S

VXWRAP_T

VXWRAP_U

VXWRAP_V

w

Wait

WarnEnterThread

WarnExitThread

Watcher

WatcherPreRead

wBitsPerSample

Weight

Weights

wFormatTag

What are Behavioral Objects ?

What are Behaviors ?

What are Parameters ?

Width - see

VxImageDescEx::Width

VxDisplayMode::Width

WillRenderBothStereoEyes

WIN_HANDLE

Windows functions

WireFrame

WORD

Write - see

VxSubFile::Write

VxStream::Write

VxFile::Write

CKStreamWriter::Write

WriteBitmap

WriteBuffer

WriteBuffer_LEndian

WriteBuffer_LEndian16

WriteBufferNoSize

WriteBufferNoSize_LEndian

WriteBufferNoSize_LEndian16

WriteByte

WriteData

WriteDword

WriteDwordAsWords

WriteElements

WriteFloat

WriteGuid

WriteIdentifier

WriteInt

WriteManagerInt

WriteManagerSequence

WriteMatrix

WriteObject

WriteObjectID

WriteObjectIDSequence

WriteObjectSequence

WRITEONLY

WRITEPERMISSION

WriteRawBitmap

WriteReaderBitmap

WriteString

WriteSubChunk

WriteSubChunkSequence

WriteVector

WriteWord

Writing the Behavior Callback Function

Writing the Execution Function

x - see

VxVector::x

VxQuaternion::x

Vx2DVector::x

xa

XAbs

XAP

XArray

XBaseString

XBinaryTree

XBinaryTreeIt

XBinaryTreeNode

XBitArray

XBOOL

XBTree

XBYTE

XClassArray

XClassify

XCompare

XCos

XDWORD

XEqual

XEqualStringI

XEqualXStringI

XFabs

XGUID

XHashFun

XHashFunStringI

XHashFunXStringI

XHashTable

XList

XListIt

XMatrix

XMax

XMin

XMinMax

XNHashTable

XNHashTableConstIt

XNHashTableIt

XNHashTablePair

XNTree

XObjectArray

XObjectPointerArray

XOr

XP

XPriority

XPriorityQueue

XPtrStrided

XRefCount

XRemoveIf

XSHashTable

XSHashTableConstIt

XSHashTableIt

XSHashTablePair

XSin

XSmartPtr

XSObjectArray

XSObjectPointerArray

XSqrt

XString

XStringTokenizer

XSwap

XThreshold

XWORD

y - see

VxVector::y

VxQuaternion::y

Vx2DVector::y

ya

z - see

VxVector::z

VxQuaternion::z

ZBufferBpps

ZCmpCaps

ZWriteEnabled

~Accessor

~CKShader

~CKStreamWriter

~ConstAccessor

~Variable

~VxAllocator

~VxConsoleListener

~VxFile

~VxFileListener

~VxLog

~VxLogListener

~VxMutex

~VxMutexLock

~VxPoolObject

~VxScratch

~VxScratchString

~VxThread

~VxTimeProfiler

~Watcher

~XAP

~XArray

~XBaseString

~XBinaryTree

~XBinaryTreeIt

~XBinaryTreeNode

~XBitArray

~XBTree

~XClassArray

~XHashTable

~XList

~XMatrix

~XNHashTable

~XNTree

~XP

~XRefCount

~XSHashTable

~XSmartPtr

~XString