OasisW Manual - Basics
Learn OasisW's basic features step by step.
Creating a New Project
Step 1: Starting the Project
- Launch the OasisW editor.
- Enter a project name.
- Select a folder path.
- Choose a template.
- Click the Create Project button.
Step 2: Basic Scene Setup
- A default camera and lighting are automatically created.
- Check the Scene structure in the Hierarchy view.
Creating a Ground Plane
Step 1: Create Plane
- Click Add Entity in the Hierarchy view.
- Select 3D → Plane.
Step 2: Adjust Size
- Adjust Scale values to set the size.
- X: 10, Y: 1, Z: 10
Step 3: Adjust Position
- Adjust Position values.
- Y: -1 (slightly below the ground plane)
Materials
Step 1: Create Box Object
- In the Hierarchy view, select Add Entity → 3D → Box.
- Set Y value to 1 in Position to place it above the ground plane.
Step 2: Create Material
- Right-click in the Asset view.
- Select New Asset → Material.
- Change the material name to "BoxMaterial".
Step 3: Set Color
- Click the created material.
- Change the color of Diffuse in the Inspector view.
- Select your desired color (e.g., red).
Step 4: Apply Material
- Select Box in the Hierarchy view.
- Drag and drop the material from Asset view to Materials in the Inspector view.
Physics Movement
Step 1: Apply Physics to Ground Plane
- Select Plane in the Hierarchy view.
- In the Inspector view, set Add Component → Physics → Collision → Half Extents.
- Add Add Component → Physics → Rigid Body.
- Click IMPORT AMMO.
Step 2: Apply Physics to Box
- Select Box in the Hierarchy view.
- Add Add Component → Physics → Collision.
- Add Add Component → Physics → Rigid Body.
- Change Type to Dynamic.
Step 3: Test
- Click Launch in the Viewport.
- Verify that the Box falls and stops on the Plane.
Templates
Step 1: Create Template
- Right-click Box in the Hierarchy view.
- Click Template → New Template.
- Enter a template name (e.g., "MyBox").
Step 2: Use Template
- Check the created template in the Asset view.
- Drag and drop the template into the Hierarchy view to create an instance.
- Create multiple identical Boxes.
Step 3: Modify Instance
- Select one instance.
- Change Position or Rotation.
- Verify that other instances are not affected.
Adding Scripts
Step 1: Create Script
- Right-click in the Asset view.
- Select New Asset → Script.
- Enter a script name (e.g., "move-script").
Step 2: Edit Script
- Double-click the created script.
- Check the default code:
var MoveScript = pc.createScript('moveScript');
// initialize code called once per entity
MoveScript.prototype.initialize = function() {
};
// update code called every frame
MoveScript.prototype.update = function(dt) {
};
Step 3: Implement Simple Movement
var MoveScript = pc.createScript('moveScript');
MoveScript.prototype.initialize = function() {
this.speed = 5;
};
MoveScript.prototype.update = function(dt) {
var forward = this.app.keyboard.isPressed(pc.KEY_W);
var backward = this.app.keyboard.isPressed(pc.KEY_S);
var left = this.app.keyboard.isPressed(pc.KEY_A);
var right = this.app.keyboard.isPressed(pc.KEY_D);
var move = new pc.Vec3();
if (forward) move.z -= 1;
if (backward) move.z += 1;
if (left) move.x -= 1;
if (right) move.x += 1;
if (move.length() > 0) {
move.normalize().scale(this.speed);
this.entity.translateLocal(move.x * dt, 0, move.z * dt);
}
};
Step 4: Apply Script
- Select Box in the Hierarchy view.
- In the Inspector view, select Add Component → Script.
- Click Add Script.
- Select the created script.
Step 5: Test
- Click Launch in the Viewport.
- Verify Box movement with WASD keys.