Torque3D
  • General
    • Welcome!
    • Features
    • Release Notes
      • Version 4.0.3
      • Version 4.0.2
      • Version 4.0.1
      • Version 4.0
      • Version 3.10.1
      • Version 3.10
      • Version 3.9
      • Version 3.8
      • Version 3.7
      • Version 3.6.2
      • Version 3.6.1
      • Version 3.6
  • Getting Started
    • Introduction
      • What's the Torque3D Engine?
    • Getting Familiar
      • Getting a Copy
        • Torque Project Manager
        • Downloading it Yourself
      • Getting Ready for Launch
        • Running Pre-Built Binaries
        • Building the Engine Yourself
      • Launching the Game
        • Opening the Example Level
        • Launching the Editors
      • Your First Game
        • Introduction To The Engine
        • The Module System
        • Creating an empty gamemode
        • Adding a Player
        • Adding a Coin
        • Adding a win-condition
        • Custom coin asset
        • Counting coins
        • Adding some effects
        • Supporting multiplayer
        • Adding a Scoreboard GUI
        • Keeping the scoreboard up-to-date
      • Deep Dive: BaseGame Directory Structure
    • Best Practices
    • Porting a Legacy Project
  • For Artists
    • Assets
      • What are Assets?
      • How to Create a New Asset
      • Working With Assets
      • Deep Dive: Creating a New Asset Type
    • Art
      • File Formats
      • 3D Art
        • Shape Specifications
        • Coordinates System
        • Mounting Shapes
        • Animation
        • Player Setup
        • Blender -> Torque3D Pipeline
      • 2D Art
        • Working with Adobe Substance
    • Animation
    • GUI
      • Loading and Initializing a GUI
      • Expanding a GUI via Script
      • How to Network GUIs
    • Materials
      • Material Mapping
      • Material Animation
    • Terrain
    • Shaders
    • Lighting
    • Audio
  • For Designers
    • Base Classes
      • SimObject
      • SimGroup
      • SceneObject
      • Scene
      • Datablocks
    • Game Classes
      • Creating an Object
      • Destroying an Object
      • Gameplay Scripting
        • Spawning an Object from Gameplay Code
    • Modules
      • What are Modules?
      • How to Create a New Module?
      • Making a Module do Things
      • Installing Existing Modules
        • Where to Get More Modules
    • Scenes and Levels
      • How to Create a New Level
      • How to Load a Level
        • Deep Dive: Level Loading Scripts
      • How to Edit Levels
        • Opening a Level in the Editor
        • Spawning Objects from the Asset Browser
        • Working with Scenes
        • Using SimGroups
        • Changing a Level's PostEffects
        • Deep Dive: LevelAsset Companion Files
    • Game Modes
      • Creating a New GameMode
      • Making a Level Use Your GameMode
      • Adding Gameplay Code to Your GameMode
    • AI
      • Navmesh
      • Objects
      • Scripting
    • Inputs
      • Inputs and Keybinds
        • ActionMap
        • Bind Functions
        • ActionMap Stack
    • Localization
    • Editors
      • Changing Editor Settings
      • World Editor
        • Scene Editor
        • ConvexShape Editor
        • Terrain Editor
        • Terrain Painter
        • Material Editor
        • Spline-Based Tools
          • Mesh Road Editor
          • River Editor
          • Decal Road Editor
        • Datablock Editor
        • Particle Editor
        • Decal Editor
        • Forest Editor
        • Navmesh Editor
        • Deep Dive: Creating Your Own Editor
        • Shape Editor
      • GUI Editor
        • Interface Details
  • For Programmers
    • Compiling the Engine
      • Setup Development Environment
        • SDK and Library Installation
        • Git
        • Cmake
        • Creating a Fork on Github
      • Create a Project
        • Creating a Project With CMake
        • Creating a Project With the Project Manager
      • Compiling
        • Compiling in Windows
        • Compiling in Linux
        • Compiling in MacOS
      • Building the Project Manager
    • Introduction
    • Code Style Guidelines
    • Expanding the Engine
      • Creating a New Object Class
      • Exposing Object Classes to Script
        • addProtectedField
      • Adding a New Library to the Engine
    • Major Components of the Engine
      • Core
        • Console
        • Platform
      • Audio
        • SFX
      • Rendering
        • GFX
        • Render Bins
      • Physics
        • Stock T3D Physics
        • Physics Wrapper
          • PhysX
          • Bullet
        • Classes
    • Rendering
    • Math
    • Networking
      • Client and Server Commands
    • Physics
    • Collision
    • Scripting
      • TorqueScript
        • What is TorqueScript?
        • Basic Syntax
        • Variables
        • Types
        • Operators
        • Control Structures
        • Functions
        • Objects
        • Module Interop
          • QueueExec
          • RegisterDatablock
          • CallOnModules
          • ModuleExec
        • API Reference
      • Other Languages
        • C-Interface
    • File Inputs/Outputs(I/O)
    • API Reference
Powered by GitBook
On this page
  • What is a SceneObject?
  • Features of SceneObjects
  • Using SceneObjects
Edit on GitHub
Export as PDF
  1. For Designers
  2. Base Classes

SceneObject

In Torque3D, SceneObject is the base class for all objects that exist in a 3D scene. It provides a number of features and functions that can be used to create objects with specific behaviors and characteristics.

What is a SceneObject?

A SceneObject is a type of object in Torque3D that represents a 3D object in a scene. It is the base class for all objects that exist in a scene and provides a number of features and functions for controlling the position, orientation, and other properties of objects.

Features of SceneObjects

SceneObject objects have several key features, including:

  • Position and orientation: The SceneObject class provides properties for controlling the position and orientation of objects in the scene. This allows you to control the position of objects relative to one another and determine how they are facing.

  • Transformation: The SceneObject class provides functions for transforming objects in the scene, including translation, rotation, and scaling.

  • Collision detection: The SceneObject class provides functionality for detecting collisions between objects in the scene. This allows you to create objects that can interact with one another in meaningful ways.

  • A scene graph (in the Zones and Portals sections), allowing efficient and robust rendering of the game scene.

  • Various helper functions, including functions to get bounding information and momentum/velocity.

  • Lighting: SceneObjects can register dynamic lights at runtime (for special effects, such as from flame or a projectile, or from an explosion), or scene lighting such as the sun.

Using SceneObjects

To use a SceneObject in Torque3D, you need to create an instance of the SceneObject class, either through script or through the Torque3D World Editor. While you cannot create a SceneObject directly, all spawnable object types are derived from SceneObject and can be used similarly. Once you have a SceneObject object, you can use its properties and functions to control its behavior and characteristics.

For example, to set the position of a SceneObject in the scene, you can use the setPosition method, as follows:

%object.setPosition(%x, %y, %z);

where %object is the SceneObject object, and %x, %y, and %z are the x, y, and z coordinates of the object's position.

To rotate a SceneObject in the scene, you can use the rotation variable, as follows:

%object.rotation = %x SPC %y SPC %z SPC %angle;

where %object is the SceneObject object, and %x, %y, and %z are the x, y, and z rotation axis for the object, and %angle is the applied angle on the axis.

PreviousSimGroupNextScene

Last updated 2 years ago