class Ship3D: public Ship

This class represent a ship with a 3d shape

Inheritance:


Public Fields

[more]Mesh M
The Shape of the ship

Public Methods

[more] Ship3D(char *filename ="data/astro.raw")
The constructor now also load the ship mesh
[more]int Draw()
Function has been rewritten to handle 3D
[more]int MaxBullet()
The maximum number of bullet now is 30 instead of 10 This has been copied from TriShip
[more]void Shoot(list<Bullet *> &LB)
Shoot a new bullet triple

Inherited from Ship:

Public Fields

oPoint3f a
obool thrust
obool lthrust
obool rthrust

Public Methods

ovoid Update(int t)
ovoid ThrustOn()
ovoid ThrustOff()
ovoid StartStrafeLeft()
ovoid StartStrafeRight()
ovoid StopStrafeLeft()
ovoid StopStrafeRight()
ovoid StartLeft()
ovoid StartRight()
ovoid StopLeft()
ovoid StopRight()

Protected Fields

oint ActiveBullet

Inherited from GameObj:

Public Fields

oPoint3f p
oPoint3f axis
ofloat angle
oPoint3f v
ofloat av
obool active
oSphere3f B

Public Methods

oPoint3f VDir()
obool Collide(GameObj *o)
ovoid DrawBound()
obool operator < ( GameObj const & o ) const
obool operator == ( GameObj const & o ) const

Documentation

This class represent a ship with a 3d shape. The 3D shape is loaded from a file by the constructor. The Draw function and the constructor have been rewritten.

Version History

o Ship3D(char *filename ="data/astro.raw")
The constructor now also load the ship mesh

oint Draw()
Function has been rewritten to handle 3D. The ship is drawn by simply invoking the Draw() member function of the Mesh Class. This function has to setup the proper transformation to put the ship in the standard size and orientation (the loaded model was headed along y axis instead of x axis and was too small). An additional X axis rotation has been added to simulate the side-rolling of the ship when turning left and right. The flame has also changed: it is done with a triangle fan shading from inner red to outer yellow. It also changes its lenght. Added side flames and used the Normalize function to set the loaded shape to the right position.

oint MaxBullet()
The maximum number of bullet now is 30 instead of 10 This has been copied from TriShip.

ovoid Shoot(list<Bullet *> &LB)
Shoot a new bullet triple. It creates the three new bullets and return them in a list This has been copied from TriShip.

oMesh M
The Shape of the ship.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.