[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.10.13 Ball Mesh Object

Written by Jorrit Tyberghein, jorrit.tyberghein@gmail.com.

A ball is a ball shaped object made out of triangles. You can specify the detail (i.e. number of triangles used).

#### Basic Structure

The following SCF class names are used (for `csLoadPlugin`):

- Type plugin: ``crystalspace.mesh.object.ball'`
- Loader plugin: ``crystalspace.mesh.loader.ball'`
- Factory loader plugin: ``crystalspace.mesh.loader.factory.ball'`

Objects in this plugin implement the following SCF interfaces (get with `scfQueryInterface`):

- MeshObject
  - Implements ``iMeshObject'`
  - Implements ``iBallState'`
- MeshObjectFactory
  - Implements ``iMeshObjectFactory'`
- MeshObjectFactory
  - Implements ``iMeshObjectType'`

#### Factory State Interface

The ball mesh object plugin has no factory state interface.

#### Factory Loader

The ball mesh factory loader has no parameters.

#### Object State Interface

``iBallState'` is the SCF interface that you can use to set/get settings for a ball object. The definition of this interface can be found in `include/imesh/ball.h` and that's also the include file you need to include in your applications to use this plugin. Using this interface you can access the material, blending mode (mixmode), and radius.

#### Object Loader

`<factory>factoryname</factory>`

  Name of the factory to use for creation of this instance.

`<mixmode><mode /></mixmode>`

  Blending mode, one of ``add'`, ``alpha'`, ``copy'`, ``keycolor'`, ``multiply2'`, ``multiply'`, or ``transparent'`.

`<material>materialname</material>`

  Material to use for the ball.

`<numrim>number</numrim>`

  Number of vertices on the rim of the ball (i.e. the number of vertices along the equator). A good default is 6.

`<radius x="" y="" z="" />`

  Three parameters for x, y, and z radius.

`<shift x="" y="" z="" />`

  Three parameters for x, y, and z shift.

`<reversed>yes/no</reversed>`

  Reverse the order of the triangles so that the ball is visible from the inside instead of the outside.

`<toponly>yes/no</toponly>`

  Only generate the top triangles instead of two halves.

`<cylindrical>yes/no</cylindrical>`

  Use cylindrical texture mapping instead of only a circle from the texture (default off).

`<lighting>yes/no</lighting>`

  Enable/disable lighting. Default on.

`<color red="" green="" blue="" />`

  Set the base color to use for the ball. This color will be added to the color calculated by lighting (if lighting is enabled).

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ]

This document was generated using texi2html 1.76.