[CS 5620 C1] The Jet-Cube

[CS 5620 C1] The Jet-Cube

Zuoming Fu Lv1

Watch On Youtube

Introduction

The Jet-Cube is a jet engine that can be manipulated using keyboard. It applies particle systems as the jet tails and the propellers. It adds collision detections to the cube, the propellers and the particles between the boundaries and the sea floor.

Keyboard Operations

  • w: jet particles and create up force
  • a: move left
  • d: move right

Components

  • The jet-cube: realized using polygon
  • The jet particles: realized using particle system. Emit when pressing w.
  • The propeller: particle system attached to the jet-cube’s four corners. Can rotate according to different keyboard presses to show moving.
  • The Oceans: realized using polygon.

App state control panel

  • JetEngineColor
  • windForce: <0 means blows left, >0 blow right, =0 no wind.
  • emitRandom: particle initial velocity randomness.
  • timeToLive: particle time of living. Set invisible after time of living.
  • timeToLiveRandom:add randomness to each particle’s timeToLive
  • particleColor
  • turnOnParticleColorEffect: turn on particle color continuous changing.
  • turnOnPropeller: turn on propeller
  • propellerColor

Collision Detection

  • When collide with canvas boundaries, bounce back (invert velocity on direction of collide, also reduce the velocity a bit as momentum loss).
  • When collide with the Ocean Surface:
    • If velocity is large enough, cross the surface
    • If velocity is small, bounce back.
    • The same both when into and out of the Ocean, but with different thresholds.
Comments