Table Of Contents

Previous topic

21.17. The EffectManager Object

Next topic

21.19. The FontManager Object

This Page

21.18. The Floor Object

Utility object that draws an infinite grid floor at height zero.

Useful for viewers or debug rendering.

Required scripts

The Floor object requires:

/*{{ javascript("jslib/floor.js") }}*/

21.18.1. Constructor

21.18.1.1. create

Summary

Creates a Floor object with default values.

Syntax

var floor = Floor.create(graphicsDevice, mathDevice);

21.18.2. Method

21.18.2.1. render

Summary

Renders the grid lines of the floor taking into account the far plane of the camera.

Syntax

floor.render(graphicsDevice, camera);
graphicsDevice
The GraphicsDevice to render the floor too.
camera
The Camera object used to render the scene.

21.18.3. Properties

21.18.3.1. version

Summary

The version number of the Floor implementation.

Syntax

var versionNumber = floor.version;

21.18.3.2. color

Summary

Main color of the grid lines.

Syntax

floor.color = [1.0, 0.1, 0.1, 1.0];

21.18.3.3. fadeToColor

Summary

The color the grid lines fade to at the horizon.

Syntax

floor.fadeToColor = [0.95, 0.95, 1.0, 1.0];

21.18.3.4. numLines

Summary

The maximum number of lines to draw when the whole grid is visible.

Syntax

floor.numLines = 400;