Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ShapeList Class Reference

Shape list. More...

Inheritance diagram for Dragengine.Scenery.ShapeList:

Public Member Functions

Constructors
ShapeList new ()
 Create shape list.
ShapeList new (ShapeList copy)
 Create copy of shape list.
Management
int getCount ()
 Number of shapes.
bool empty ()
 Has no shapes.
bool notEmpty ()
 Has shapes.
void removeAllShapes ()
 Remove all shapes.
ShapeType getTypeAt (int index)
 Type of shape at index.
Vector getPositionAt (int index)
 Position of shape at index.
Quaternion getOrientationAt (int index)
 Orientation of shape at index.
float getRadiusAt (int index)
 Radius of shape at index.
Vector2 getAxisScalingAt (int index)
 Axis scaling of shape at index.
Vector getHalfExtendsAt (int index)
 Half extends of shape at index.
Vector2 getTaperingAt (int index)
 Tapering of shape at index.
float getHalfHeightAt (int index)
 Half height of shape at index.
float getTopRadiusAt (int index)
 Top radius of shape at index.
float getBottomRadiusAt (int index)
 Bottom radius of shape at index.
Vector2 getTopAxisScalingAt (int index)
 Top axis scaling of shape at index.
Vector2 getBottomAxisScalingAt (int index)
 Bottom axis scaling of shape at index.
int getPointCountAt (int index)
 Count of points of shape at index.
Vector getPointAt (int shape, int point)
 Point at index of shape at index.
Sphere
void addSphere (Vector position, float radius)
 Add sphere shape.
void addSphere (Vector position, float radius, Vector2 axisScaling)
 Add ellipsoid shape.
void addSphere (Vector position, float radius, Vector2 axisScaling, Quaternion orientation)
 Add ellipsoid shape.
Box
void addBox (Vector center, Vector halfExtents)
 Add box shape.
void addBox (Vector center, Vector halfExtents, Quaternion orientation)
 Add box shape.
void addBox (Vector center, Vector halfExtents, Vector2 tapering)
 Add box shape with tapering applied at the top.
void addBox (Vector center, Vector halfExtents, Vector2 tapering, Quaternion orientation)
 Add box shape with tapering applied at the top.
Cylinder
void addCylinder (float halfHeight, float radius)
 Add cylinder shape.
void addCylinder (float halfHeight, float radius, Vector position)
 Add cylinder shape.
void addCylinder (float halfHeight, float radius, Vector position, Quaternion orientation)
 Add cylinder shape.
void addCylinder (float halfHeight, float topRadius, float bottomRadius)
 Add tapered cylinder shape.
void addCylinder (float halfHeight, float topRadius, float bottomRadius, Vector position)
 Add tapered cylinder shape.
void addCylinder (float halfHeight, float topRadius, float bottomRadius, Vector position, Quaternion orientation)
 Add tapered cylinder shape.
void addCylinder (float halfHeight, float topRadius, float bottomRadius, Vector2 topAxisScaling, Vector2 bottomAxisScaling)
 Add tapered cylinder shape.
void addCylinder (float halfHeight, float topRadius, float bottomRadius, Vector2 topAxisScaling, Vector2 bottomAxisScaling, Vector position)
 Add tapered cylinder shape.
void addCylinder (float halfHeight, float topRadius, float bottomRadius, Vector2 topAxisScaling, Vector2 bottomAxisScaling, Vector position, Quaternion orientation)
 Add tapered cylinder shape.
Capsule
void addCapsule (float halfHeight, float radius)
 Add a capsule shape.
void addCapsule (float halfHeight, float radius, Vector position)
 Add a capsule shape.
void addCapsule (float halfHeight, float radius, Vector position, Quaternion orientation)
 Add a capsule shape.
void addCapsule (float halfHeight, float topRadius, float bottomRadius)
 Add a tapered capsule shape.
void addCapsule (float halfHeight, float topRadius, float bottomRadius, Vector position)
 Add a tapered capsule shape.
void addCapsule (float halfHeight, float topRadius, float bottomRadius, Vector position, Quaternion orientation)
 Add a tapered capsule shape.
void addCapsule (float halfHeight, float topRadius, float bottomRadius, Vector2 topAxisScaling, Vector2 bottomAxisScaling)
 Add a tapered capsule shape.
void addCapsule (float halfHeight, float topRadius, float bottomRadius, Vector2 topAxisScaling, Vector2 bottomAxisScaling, Vector position)
 Add a tapered capsule shape.
void addCapsule (float halfHeight, float topRadius, float bottomRadius, Vector2 topAxisScaling, Vector2 bottomAxisScaling, Vector position, Quaternion orientation)
 Add a tapered capsule shape.
Hull
void addHull (Array points)
 Add a hull shape.
void addHull (Array points, Vector position)
 Add a hull shape.
void addHull (Array points, Vector position, Quaternion orientation)
 Add a hull shape.

File Handling

void writeToFile (FileWriter writer)
 Write vector to a file writer.
static ShapeList readFromFile (FileReader reader)
 Read vector from a file reader.

Detailed Description

Shape list.

List of analytical shapes. Supported shapes:

  • Sphere
  • Box
  • Cylinder
  • Capsule
  • Tapered box
  • Tapered cylined
  • Tapered capsule

The shape list acts as union of all shapes.

This is a native class.

Member Function Documentation

◆ addBox() [1/4]

void Dragengine.Scenery.ShapeList.addBox ( Vector center,
Vector halfExtents )

Add box shape.

Referenced by addCapsule(), addCylinder(), and addCylinder().

◆ addBox() [2/4]

void Dragengine.Scenery.ShapeList.addBox ( Vector center,
Vector halfExtents,
Quaternion orientation )

Add box shape.

References getPointCountAt().

◆ addBox() [3/4]

void Dragengine.Scenery.ShapeList.addBox ( Vector center,
Vector halfExtents,
Vector2 tapering )

Add box shape with tapering applied at the top.

◆ addBox() [4/4]

void Dragengine.Scenery.ShapeList.addBox ( Vector center,
Vector halfExtents,
Vector2 tapering,
Quaternion orientation )

Add box shape with tapering applied at the top.

References getPointAt().

◆ addCapsule() [1/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float radius )

Add a capsule shape.

Referenced by addHull(), readFromFile(), and writeToFile().

◆ addCapsule() [2/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float radius,
Vector position )

Add a capsule shape.

References addBox().

◆ addCapsule() [3/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float radius,
Vector position,
Quaternion orientation )

Add a capsule shape.

◆ addCapsule() [4/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float topRadius,
float bottomRadius )

Add a tapered capsule shape.

◆ addCapsule() [5/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float topRadius,
float bottomRadius,
Vector position )

Add a tapered capsule shape.

References addCylinder().

◆ addCapsule() [6/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float topRadius,
float bottomRadius,
Vector position,
Quaternion orientation )

Add a tapered capsule shape.

References addCylinder().

◆ addCapsule() [7/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float topRadius,
float bottomRadius,
Vector2 topAxisScaling,
Vector2 bottomAxisScaling )

Add a tapered capsule shape.

References addCylinder().

◆ addCapsule() [8/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float topRadius,
float bottomRadius,
Vector2 topAxisScaling,
Vector2 bottomAxisScaling,
Vector position )

Add a tapered capsule shape.

◆ addCapsule() [9/9]

void Dragengine.Scenery.ShapeList.addCapsule ( float halfHeight,
float topRadius,
float bottomRadius,
Vector2 topAxisScaling,
Vector2 bottomAxisScaling,
Vector position,
Quaternion orientation )

Add a tapered capsule shape.

References addCylinder().

◆ addCylinder() [1/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float radius )

Add cylinder shape.

Referenced by addCapsule(), addCapsule(), addCapsule(), addCapsule(), addHull(), and addHull().

◆ addCylinder() [2/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float radius,
Vector position )

Add cylinder shape.

◆ addCylinder() [3/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float radius,
Vector position,
Quaternion orientation )

Add cylinder shape.

References addSphere().

◆ addCylinder() [4/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float topRadius,
float bottomRadius )

Add tapered cylinder shape.

References addSphere().

◆ addCylinder() [5/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float topRadius,
float bottomRadius,
Vector position )

Add tapered cylinder shape.

References addSphere().

◆ addCylinder() [6/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float topRadius,
float bottomRadius,
Vector position,
Quaternion orientation )

Add tapered cylinder shape.

◆ addCylinder() [7/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float topRadius,
float bottomRadius,
Vector2 topAxisScaling,
Vector2 bottomAxisScaling )

Add tapered cylinder shape.

◆ addCylinder() [8/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float topRadius,
float bottomRadius,
Vector2 topAxisScaling,
Vector2 bottomAxisScaling,
Vector position )

Add tapered cylinder shape.

References addBox().

◆ addCylinder() [9/9]

void Dragengine.Scenery.ShapeList.addCylinder ( float halfHeight,
float topRadius,
float bottomRadius,
Vector2 topAxisScaling,
Vector2 bottomAxisScaling,
Vector position,
Quaternion orientation )

Add tapered cylinder shape.

References addBox().

◆ addHull() [1/3]

void Dragengine.Scenery.ShapeList.addHull ( Array points)

Add a hull shape.

Parameters
pointsArray of Vector.

References addCylinder().

Referenced by writeToFile().

◆ addHull() [2/3]

void Dragengine.Scenery.ShapeList.addHull ( Array points,
Vector position )

Add a hull shape.

Parameters
pointsArray of Vector.

References addCylinder().

◆ addHull() [3/3]

void Dragengine.Scenery.ShapeList.addHull ( Array points,
Vector position,
Quaternion orientation )

Add a hull shape.

Parameters
pointsArray of Vector.

References addCapsule().

◆ addSphere() [1/3]

void Dragengine.Scenery.ShapeList.addSphere ( Vector position,
float radius )

Add sphere shape.

Referenced by addCylinder(), addCylinder(), and addCylinder().

◆ addSphere() [2/3]

void Dragengine.Scenery.ShapeList.addSphere ( Vector position,
float radius,
Vector2 axisScaling )

Add ellipsoid shape.

◆ addSphere() [3/3]

void Dragengine.Scenery.ShapeList.addSphere ( Vector position,
float radius,
Vector2 axisScaling,
Quaternion orientation )

Add ellipsoid shape.

References getBottomAxisScalingAt().

◆ empty()

bool Dragengine.Scenery.ShapeList.empty ( )

Has no shapes.

Referenced by notEmpty().

◆ getAxisScalingAt()

Vector2 Dragengine.Scenery.ShapeList.getAxisScalingAt ( int index)

Axis scaling of shape at index.

Version
1.34
Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.sphere .

Referenced by getTaperingAt().

◆ getBottomAxisScalingAt()

Vector2 Dragengine.Scenery.ShapeList.getBottomAxisScalingAt ( int index)

Bottom axis scaling of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.cylinder or ShapeType.capsule .

References getTopRadiusAt().

Referenced by addSphere().

◆ getBottomRadiusAt()

float Dragengine.Scenery.ShapeList.getBottomRadiusAt ( int index)

Bottom radius of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.cylinder or ShapeType.capsule .

References getTaperingAt().

Referenced by getPointCountAt().

◆ getCount()

int Dragengine.Scenery.ShapeList.getCount ( )

Number of shapes.

References getCount().

Referenced by getCount().

◆ getHalfExtendsAt()

Vector Dragengine.Scenery.ShapeList.getHalfExtendsAt ( int index)

Half extends of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.box .

References getRadiusAt().

Referenced by getHalfHeightAt().

◆ getHalfHeightAt()

float Dragengine.Scenery.ShapeList.getHalfHeightAt ( int index)

Half height of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.cylinder or ShapeType.capsule .

References getHalfExtendsAt().

Referenced by getTopAxisScalingAt().

◆ getOrientationAt()

Quaternion Dragengine.Scenery.ShapeList.getOrientationAt ( int index)

Orientation of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().

References getPositionAt().

Referenced by getRadiusAt().

◆ getPointAt()

Vector Dragengine.Scenery.ShapeList.getPointAt ( int shape,
int point )

Point at index of shape at index.

Exceptions
EInvalidParamshape is less than 0 or grater than or equal to getCount().
EInvalidParampoint is less than 0 or grater than or equal to getPointCountAt(shape).
EInvalidParamShape is not of type ShapeType.hull .

References getTopAxisScalingAt().

Referenced by addBox().

◆ getPointCountAt()

int Dragengine.Scenery.ShapeList.getPointCountAt ( int index)

Count of points of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.hull .

References getBottomRadiusAt().

Referenced by addBox().

◆ getPositionAt()

Vector Dragengine.Scenery.ShapeList.getPositionAt ( int index)

Position of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().

References getTypeAt().

Referenced by getOrientationAt().

◆ getRadiusAt()

float Dragengine.Scenery.ShapeList.getRadiusAt ( int index)

Radius of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.sphere .

References getOrientationAt().

Referenced by getHalfExtendsAt().

◆ getTaperingAt()

Vector2 Dragengine.Scenery.ShapeList.getTaperingAt ( int index)

Tapering of shape at index.

Version
1.34
Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.box .

References getAxisScalingAt().

Referenced by getBottomRadiusAt().

◆ getTopAxisScalingAt()

Vector2 Dragengine.Scenery.ShapeList.getTopAxisScalingAt ( int index)

Top axis scaling of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.cylinder or ShapeType.capsule .

References getHalfHeightAt().

Referenced by getPointAt().

◆ getTopRadiusAt()

float Dragengine.Scenery.ShapeList.getTopRadiusAt ( int index)

Top radius of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().
EInvalidParamShape is not of type ShapeType.cylinder or ShapeType.capsule .

Referenced by getBottomAxisScalingAt().

◆ getTypeAt()

ShapeType Dragengine.Scenery.ShapeList.getTypeAt ( int index)

Type of shape at index.

Exceptions
EInvalidParamindex is less than 0 or grater than or equal to getCount().

References removeAllShapes().

Referenced by getPositionAt().

◆ new() [1/2]

ShapeList Dragengine.Scenery.ShapeList.new ( )

Create shape list.

References new().

Referenced by new(), and new().

◆ new() [2/2]

ShapeList Dragengine.Scenery.ShapeList.new ( ShapeList copy)

Create copy of shape list.

References new().

◆ notEmpty()

bool Dragengine.Scenery.ShapeList.notEmpty ( )

Has shapes.

References empty().

Referenced by removeAllShapes().

◆ readFromFile()

ShapeList Dragengine.Scenery.ShapeList.readFromFile ( FileReader reader)
static

Read vector from a file reader.

References addCapsule().

Referenced by writeToFile().

◆ removeAllShapes()

void Dragengine.Scenery.ShapeList.removeAllShapes ( )

Remove all shapes.

References notEmpty().

Referenced by getTypeAt().

◆ writeToFile()

void Dragengine.Scenery.ShapeList.writeToFile ( FileWriter writer)

Write vector to a file writer.

References addCapsule(), addHull(), readFromFile(), and writeToFile().

Referenced by writeToFile().


The documentation for this class was generated from the following file: