Skip to content
Lasse Öörni edited this page Oct 23, 2013 · 13 revisions

Scene

Scene consists of 0 to N Entities.

Entity

Entity consists of 0 to N Components.

Component

Component consists of 0 to N Attributes.

Basics

Components can be added to any Entity in the scene. The components define the functionality/behaviour of the Entity.

A Component consists of Attributes. Each attribute has a name and a type. Once this structure is defined it can automatically be synchronized over the network, whatever the structure may be, without doing any networking code / message definitions to the components implementation. For more on the network syncronization refer to the RealXtend Tundra protocol.

The components listed on this page are not a full list of available components in Tundra, but a list that will be relevant in brainstorming the [http://xml3d.org/ XML3D] integration. For a full list of component refer to the [http://doc.meshmoon.com/doxygen/annotated.html Tundra doxygen documentation].

Creating new components

The Tundra component system is extendable, so anyone can define a component and add it to the system. Usually outside of the Tundra core SDK this happens by loading C++ plugins during runtime that declare/register the component structure to both the server and client.

List of Components

Core

** EC_Name **

  • Adds a non-unique name for an entity. This can be used to query scene for Entities. Description and group can be used by application logic to create groups and define metadata (lighter alternative to using EC_DynamicComponent)
  • Main attributes: name (String), description (String) and group (String).

** EC_DynamicComponent **

  • Special component thats structure is not statically defined, but can be defined during runtime. This is useful on script logic to store custom data for the application and have it persist in the scene state.
  • Main attributes: defined during runtime, all 17 attribute types are available.

Rendering

** EC_Placeable **

  • Adds this Entity to the rendering scene graph by creating a scene node to it.
  • Main attributes: transform (Transform: pos, rot and scale vectors) and visibility (Bool).

** EC_Mesh **

  • Defines the visual 3D mesh resources and surface materials to be loaded.
  • Attaches itself to the parent Entitys Placeable components scene node.
  • In addition to the mesh resource defines list of materials that tell the rendering about mesh surface properties (ambient, diffuse, emissive, specular colors + textures + potential shaders).
  • Main attributes: meshRef (AssetReference), meshMaterial (AssetReferenceList).

** EC_Camera **

  • Adds a camera/viewport to the 3D rendering. Usually this component is created locally on the client by (script) application logic.
  • Attaches itself to the parent Entitys Placeable components scene node.
  • Main attributes: Fov, near- and farclip (Real).

** EC_Light **

  • Adds a light source to the 3D scene.
  • Attaches itself to the parent Entitys Placeable components scene node.
  • Main attributes: Diffuse and specular color (Color), type (Number/Enum: Spot, Point and Directional), range (Number), brightness (Number), attenuation(s) (Number).

** EC_ParticleSystem **

  • Adds a particle system/effect to the 3D scene. The particle system will be loaded from the specified asset reference.
  • Attaches itself to the parent Entitys Placeable components scene node.
  • Main attributes: particleRef (AssetReference: points to a supported particle asset) and visibility (Bool).

** EC_Billboard **

  • Adds a "2D" sprite type billboard to the 3D scene. Surface material defined similarly as the Mesh component does, references to a material file.
  • Is part of the 3D scene but always faces the active camera.
  • Attaches itself to the parent Entitys Placeable components scene node.
  • Main attributes: materialRef (AssetReference), position (Float3: relative offset from Placeable), size and visibility (Bool).

Environment

** EC_Sky **

  • Adds a skybox to the scene. There are multiple sky component from skybox to more comple dome with volumetric cloud rendering etc.
  • Main attributes: materialRef (AssetReference) or a list of textures for the cubemap and skybox size.

** EC_Water **

  • Adds water to the scene. There are multiple water components from waterplane to complex realtime water rendering.
  • Main attributes: water position/height and size.

Extra Visuals

** EC_WebBrowser **

  • Creates a web browser (with 3D input etc.) render to the mesh surface (replacing the original materil in that submesh).
  • Main attributes: url (String), resolution (Float2), accept3DInput (Bool) etc.

Scripting

** EC_Script **

  • Defines a script resource that should be loaded and executed.
  • Main attributes: scriptRef (AssetReference), runMode (Int/Enum: Server, Client or Both), runOnLoad (Bool: if should be execute after load completes. If false application logic can execute the script.)

Physics

** EC_RigidBody **

  • Adds a rigid body object to the physics simulation world for collision & dynamics response. On the native Tundra client/server, the physics simulation world will always be created along with the scene if the PhysicsModule plugin is loaded. Web client does not currently simulate physics.
  • If the rigid body is dynamic (mass > 0), the position & rotation in the entity's EC_Placeable component will be updated after each simulation step
  • The collision shape of the rigid body can either be a primitive like box, sphere, capsule, cylinder, or derived from rendering mesh data (trianglemesh or convex hull). The size attribute and the scale from the EC_Placeable's transform are combined to find the final size for the collision shape.
  • Main attributes: mass (Real), friction (Real), restitution (Real), linearVelocity (Float3), angularVelocity (Float3), shapeType (enum Int), size (Float3), collisionMeshRef (AssetReference)

Attribute

List of Attribute types

This is the mapping of attribute type id to the type name of the available attribute types in Tundra.

  • 1 : String
  • 2 : Int
  • 3 : Real
  • 4 : Color
  • 5 : Float2
  • 6 : Float3
  • 7 : Float4
  • 8 : Bool
  • 9 : UInt
  • 10 : Quat
  • 11 : AssetReference '''(*)'''
  • 12 : AssetReferenceList
  • 13 : EntityReference '''(*)'''
  • 14 : QVariant '''(**)'''
  • 15 : QVariantList
  • 16 : Transform (pos, rot and scale vectors)
  • 17 : QPoint (pretty much deprecated, use Float2)

'''(*)''' Essentially a string but has different semantics and there for a separate type to avoid confusion from app developers etc.

'''(**)''' [http://qt-project.org/doc/qt-4.8/qvariant.html QVariant is a Qt class] that has various types. Over the wire these are always just converted to a string. This is not a relevant type to support from a generic design standpoint.

Clone this wiki locally