ZGameEditor Documentation
Community |
ModelModelDefines a moving graphical object. Contains information on how to render and move the object. To create a instance of a model use the SpawnModel -component. Example usage: See "BallModel" in ZPong sample project PropertiesDefinitionsList of private data for this model. Use the DefineVariable-component to define private variables. Every instance of a model will have their own copy of the components in this list. This allows creating models that have unique geometry for every instance. Other components such as Mesh or Bitmap can be placed here as well. However, the data is created during spawning, so only use very small meshes or bitmaps, otherwise there will be noticeable delays in your game when the models are spawned. See MonkeyModel in TripleE-sample project StatesA list of ModelState-components for this model. OnRenderThis componentlist is called when it's time to render this model to the screen. Use render-command component such as RenderMesh to render your models. OnUpdateCalled between every frame update. Here you should put components that update your models position. OnSpawnCalled once when this model is spawned (created). Use components that initialize your models local variables here. OnRemoveCalled when the model is removed. OnCollisionCalled when this model has collided with another model. Collision detection must have been enabled using a DefineCollision-component. A ZExpression defined here can examine which category the model has collided with using the App.CollidedCategory property. PositionThe models current position in 3D-space. RotationThe models current rotation in 3D-space in cycles (one cycle = 360 degrees = 2PI). VelocityCurrent velocity in 3D-space. Assign a velocity (by setting a value in the editor, or using a ZExpression) to make your model move. The unit of Model.Velocity is the amount that the model will move in one second. So for example if Velocity.X is set to 5, then the model will move 5 units per second in the X-axis, which is about half the screen width using the default camera settings. ScaleCurrent scale of model. Default value is 1 for the scale in x,y,z directions. A model can be scaled up and down, for instance 0.5 is half size and 2.0 doubles the size. RotationVelocitySet a value to this property to animate the models rotation in each axis. For example: Setting RotationVelocity.Y to 1 will rotate the model one full circle per second around the Y axis. CategoryUse a separate category for every kind of model for which a separate collision detection should be used. See DefineCollision. CollisionBoundsThe size of this model when it is tested for collision. This value is interpreted differently depending on the value of the CollisionStyle-property:
CollisionOffsetOffset-value for the models position when it is tested for collision. This can be used for moving the center point of collision from the center point of the geometry, for instance a "weak spot" on a enemy boss. First value is offset in X axis, second is Y. CollisionStyleHow to determine collision of this model:
RenderOrder
PersonalityThis is a read only value that is automatically assigned a random value between 0 and 1 when a model is spawned. Use this value in expressions for making every instance of a model slightly unique. For example see BoidModel in Steering sample project, it uses the Personality-value for modifying the locally defined mesh to give every boid a separate appearance. |