Libraries.Game.Collision.Shapes.Cylinder Documentation

This class describes the cylinder shape in 3D.

Inherits from: Libraries.Language.Object, Libraries.Game.Collision.Shapes.CollisionShape3D

Summary

Actions Summary Table

ActionsDescription
CalculateLocalInertia(number mass, Libraries.Compute.Vector3 inertia)This action approximates the inertia of the cylinder with an inertia of a box.
CalculateTemporalBoundingBox(Libraries.Game.Collision.PhysicsPosition3D currentTransform, Libraries.Compute.Vector3 linearVelocity, Libraries.Compute.Vector3 angularVelocity, number timeStep, Libraries.Game.BoundingBox temporalBoundingBox)This action calculates the rectangular cube that will contain both the object in its position currently and also contain the object in a position after "timeStep" seconds from now.
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns a CompareResult.
ComputeBoundingBox(Libraries.Game.BoundingBox boundingBox, Libraries.Game.Collision.PhysicsPosition3D transform)This action finds the bounding box that would bound the Cylinder in its current position.
Copy()This action sets another cylinder to have the properties of the current cylinder.
CylinderLocalSupportX(Libraries.Compute.Vector3 halfExtents, Libraries.Compute.Vector3 vector)This action is used by "action LocalGetSupportingVertexWithoutMargin" to find the vertex that is furthest away in a direction specified by "Vector3 vector" that doesn't have an offset when the cylinder's height aligns with the x axis.
CylinderLocalSupportY(Libraries.Compute.Vector3 halfExtents, Libraries.Compute.Vector3 vector)This action is used by "action LocalGetSupportingVertexWithoutMargin" to find the vertex that is furthest away in a direction specified by "Vector3 vector" that doesn't have an offset when the cylinder's height aligns with the y axis.
CylinderLocalSupportZ(Libraries.Compute.Vector3 halfExtents, Libraries.Compute.Vector3 vector)This action is used by "action LocalGetSupportingVertexWithoutMargin" to find the vertex that is furthest away in a direction specified by "Vector3 vector" that doesn't have an offset when the cylinder's height aligns with the z axis.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetAngularMotionDisc()This calculates the maximum distance between any point to the center of the 3D object.
GetBoundingSphere(Libraries.Compute.Vector3 center)This action finds the center (relative to the object's local origin) and the radius of a sphere that would bound the object that is at its current position.
GetChildCount()This action returns how many children shapes are attached to this box.
GetEdge(integer i, Libraries.Compute.Vector3 pa, Libraries.Compute.Vector3 pb)This action gets the "i"th edge of the cylinder, which is approximated by a bounding box, so this action gets the "i"th edge of that bounding box.
GetHalfExtentsWithMargin()This action returns a vector that records information about the cylinder's height and radius with an offset.
GetHalfExtentsWithoutMargin()This action returns a vector that records information about the cylinder's height and radius without an offset.
GetHashCode()This action gets the hash code for an object.
GetLocalScaling(Libraries.Compute.Vector3 out)This action returns how the 3D object has been scaled to the shape that it has right now.
GetMargin()This action returns the offset of the box that will bound the object to prevent objects going through each other graphically.
GetNumberOfEdges()This action returns the number of edges of the cylinder.
GetNumberOfPlanes()This action returns the number of planes of the cylinder.
GetNumberOfVertices()This action returns the number of vertices of the cylinder.
GetNumberPreferredPenetrationDirections()This action calculates the preferred number of directions to check if another object has penetrated this cylinder.
GetPlane(Libraries.Compute.Vector3 planeNormal, Libraries.Compute.Vector3 planeSupport, integer i)This action returns one of the 6 planes that made up the bounding box for this cylinder.
GetPlaneEquation(Libraries.Compute.Plane plane, integer i)This action finds the plane equation of the bounding boxes that surrounds the cylinder shape because we are approximating the cylinder with a box.
GetPreferredPenetrationDirection(integer index, Libraries.Compute.Vector3 penetrationVector)This action calculates one of the directions to check if another object has penetrated this box.
GetRadius()This action returns the radius of the cylinder.
GetType()This action returns what type of 3D object the 3D object is.
GetUpAxis()This action returns which axis the height of the cylinder is aligned to.
GetVertex(integer i, Libraries.Compute.Vector3 vertex)This action returns the vertex of the cylinder specified by the integer "i," which will really be the vertex of the bounding box that surrounds the cylinder because we are approximating the cylinder with a bounding box.
IsInside(Libraries.Compute.Vector3 point, number tolerance)This action tests if the point described by "Vector3 point" is inside the cylinder with the specified "tolerance.
LocalGetSupportingVertex(Libraries.Compute.Vector3 vector)This action finds the vertex with an offset (margin) of the 3D shape that is furthest away in a direction specified by "Vector3 vector".
LocalGetSupportingVertexWithoutMargin(Libraries.Compute.Vector3 vector)This action finds the vertex that is furthest away in a direction specified by "Vector3 vector" that doesn't have an offset.
RecalculateLocalBoundingBox()This action calculates the bounding box of the cylinder.
Scale(Libraries.Compute.Vector3 scale)This action scales the cylinder from the current size.
Set(number width, number height, number depth)This action sets the properties of this cylinder using passed in sizes.
SetLocalScaling(Libraries.Compute.Vector3 scaling)This action scales the cylinder from its original configuration.
SetMargin(number margin)This action sets the offset of the box that will bound the object to prevent objects going through each other graphically.
SetType(integer type)This action sets what type of 3D object this 3D object is.
SetUpAxis(integer upAxis)This action specified which axis does the cylinder's height aligns with.

Actions Documentation

CalculateLocalInertia(number mass, Libraries.Compute.Vector3 inertia)

This action approximates the inertia of the cylinder with an inertia of a box. The mass moment of inertia is also calculated relative to the local origin of the cylinder.

Parameters

CalculateTemporalBoundingBox(Libraries.Game.Collision.PhysicsPosition3D currentTransform, Libraries.Compute.Vector3 linearVelocity, Libraries.Compute.Vector3 angularVelocity, number timeStep, Libraries.Game.BoundingBox temporalBoundingBox)

This action calculates the rectangular cube that will contain both the object in its position currently and also contain the object in a position after "timeStep" seconds from now.

Parameters

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns a CompareResult. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.

Example Code

use Libraries.Language.Support.CompareResult
        Object o
        Object t
        CompareResult result = o:Compare(t)

Parameters

Return

Libraries.Language.Support.CompareResult: The Compare result, Smaller, Equal, or Larger.

ComputeBoundingBox(Libraries.Game.BoundingBox boundingBox, Libraries.Game.Collision.PhysicsPosition3D transform)

This action finds the bounding box that would bound the Cylinder in its current position.

Parameters

Copy()

This action sets another cylinder to have the properties of the current cylinder.

Return

Libraries.Game.Collision.Shapes.CollisionShape3D:

CylinderLocalSupportX(Libraries.Compute.Vector3 halfExtents, Libraries.Compute.Vector3 vector)

This action is used by "action LocalGetSupportingVertexWithoutMargin" to find the vertex that is furthest away in a direction specified by "Vector3 vector" that doesn't have an offset when the cylinder's height aligns with the x axis.

Parameters

Return

Libraries.Compute.Vector3:

CylinderLocalSupportY(Libraries.Compute.Vector3 halfExtents, Libraries.Compute.Vector3 vector)

This action is used by "action LocalGetSupportingVertexWithoutMargin" to find the vertex that is furthest away in a direction specified by "Vector3 vector" that doesn't have an offset when the cylinder's height aligns with the y axis.

Parameters

Return

Libraries.Compute.Vector3:

CylinderLocalSupportZ(Libraries.Compute.Vector3 halfExtents, Libraries.Compute.Vector3 vector)

This action is used by "action LocalGetSupportingVertexWithoutMargin" to find the vertex that is furthest away in a direction specified by "Vector3 vector" that doesn't have an offset when the cylinder's height aligns with the z axis.

Parameters

Return

Libraries.Compute.Vector3:

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetAngularMotionDisc()

This calculates the maximum distance between any point to the center of the 3D object.

Return

number:

GetBoundingSphere(Libraries.Compute.Vector3 center)

This action finds the center (relative to the object's local origin) and the radius of a sphere that would bound the object that is at its current position.

Parameters

Return

number:

GetChildCount()

This action returns how many children shapes are attached to this box.

Return

integer:

GetEdge(integer i, Libraries.Compute.Vector3 pa, Libraries.Compute.Vector3 pb)

This action gets the "i"th edge of the cylinder, which is approximated by a bounding box, so this action gets the "i"th edge of that bounding box. The result will be put inside "Vector3 pa" and "Vector3 pb" for the vertices of each edge.

Parameters

GetHalfExtentsWithMargin()

This action returns a vector that records information about the cylinder's height and radius with an offset.

Return

Libraries.Compute.Vector3:

GetHalfExtentsWithoutMargin()

This action returns a vector that records information about the cylinder's height and radius without an offset. Half extents stores when the cylinder is aligned in the x direction. Half extents stores when the cylinder is aligned in the z direction. Hald extents stores when the cylinder is aligned in the y direction.

Return

Libraries.Compute.Vector3:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetLocalScaling(Libraries.Compute.Vector3 out)

This action returns how the 3D object has been scaled to the shape that it has right now.

Parameters

Return

Libraries.Compute.Vector3:

GetMargin()

This action returns the offset of the box that will bound the object to prevent objects going through each other graphically.

Return

number:

GetNumberOfEdges()

This action returns the number of edges of the cylinder. Since we will be approximating the cylinder with a bounding box, therefore, there will be 12 edges surrounding this cylinder.

Return

integer:

GetNumberOfPlanes()

This action returns the number of planes of the cylinder. Since we will be approximating the cylinder with a bounding box, therefore, there will be 6 planes surrounding this cylinder.

Return

integer:

GetNumberOfVertices()

This action returns the number of vertices of the cylinder. Since we will be approximating the cylinder with a bounding box, therefore, there will be 8 vertices surrounding this cylinder.

Return

integer:

GetNumberPreferredPenetrationDirections()

This action calculates the preferred number of directions to check if another object has penetrated this cylinder.

Return

integer:

GetPlane(Libraries.Compute.Vector3 planeNormal, Libraries.Compute.Vector3 planeSupport, integer i)

This action returns one of the 6 planes that made up the bounding box for this cylinder.

Parameters

GetPlaneEquation(Libraries.Compute.Plane plane, integer i)

This action finds the plane equation of the bounding boxes that surrounds the cylinder shape because we are approximating the cylinder with a box.

Parameters

GetPreferredPenetrationDirection(integer index, Libraries.Compute.Vector3 penetrationVector)

This action calculates one of the directions to check if another object has penetrated this box.

Parameters

GetRadius()

This action returns the radius of the cylinder.

Return

number:

GetType()

This action returns what type of 3D object the 3D object is.

Return

integer:

GetUpAxis()

This action returns which axis the height of the cylinder is aligned to.

Return

integer:

GetVertex(integer i, Libraries.Compute.Vector3 vertex)

This action returns the vertex of the cylinder specified by the integer "i," which will really be the vertex of the bounding box that surrounds the cylinder because we are approximating the cylinder with a bounding box.

Parameters

IsInside(Libraries.Compute.Vector3 point, number tolerance)

This action tests if the point described by "Vector3 point" is inside the cylinder with the specified "tolerance."

Parameters

Return

boolean:

LocalGetSupportingVertex(Libraries.Compute.Vector3 vector)

This action finds the vertex with an offset (margin) of the 3D shape that is furthest away in a direction specified by "Vector3 vector".

Parameters

Return

Libraries.Compute.Vector3:

LocalGetSupportingVertexWithoutMargin(Libraries.Compute.Vector3 vector)

This action finds the vertex that is furthest away in a direction specified by "Vector3 vector" that doesn't have an offset.

Parameters

Return

Libraries.Compute.Vector3:

RecalculateLocalBoundingBox()

This action calculates the bounding box of the cylinder. The coordinates of the bounding box will be specified in local coordinates.

Scale(Libraries.Compute.Vector3 scale)

This action scales the cylinder from the current size.

Parameters

Set(number width, number height, number depth)

This action sets the properties of this cylinder using passed in sizes.

Parameters

SetLocalScaling(Libraries.Compute.Vector3 scaling)

This action scales the cylinder from its original configuration.

Parameters

SetMargin(number margin)

This action sets the offset of the box that will bound the object to prevent objects going through each other graphically.

Parameters

SetType(integer type)

This action sets what type of 3D object this 3D object is.

Parameters

SetUpAxis(integer upAxis)

This action specified which axis does the cylinder's height aligns with.

Parameters