Class: ShadowPlane

PD. ShadowPlane

Displays a flat horizontal plane for receiving shadows.


new ShadowPlane( [config])

Creates a new horizontal shadow plane.

Parameters:
Name Type Argument Description
config object <optional>

An optional configuration object.

Properties of config:
Name Type Argument Description
width number <optional>

The width of the plane in the X-axis, in model units.

depth number <optional>

The depth of the plane in the Y-axis, in model units.

size Array <optional>

Sets the width and depth of the plane, in model units.

receiveShadow boolean <optional>

Whether or not to create a surface for receiving shadows.

Author:
  • drajmarsh

Extends

  • THREE.Mesh

Members


:THREE.Box3

_extents

The 3D extents of the grid lines.

Type
  • THREE.Box3

:THREE.Box3

_shadowExtents

The 3D extents of the shadow plane.

Type
  • THREE.Box3

:number

depth

The size of the grid mesh in the Y-axis, in model units.

Type
  • number

:THREE.Box3

extents

The extents of the shadow plane in absolute model coordinates.

Type
  • THREE.Box3

:boolean

isShadowPlane <readonly>

A flag identifying this object as a shadow plane.

Type
  • boolean

:THREE.Plane

shadowOffset

The Z-axis offset of the shadow plane from the origin.

Type
  • THREE.Plane

:THREE.Plane

shadowPlane

The plane equation of the planar shadow surface.

Type
  • THREE.Plane

:number

width

The size of the shadow plane in the X-axis, in model units.

Type
  • number

Methods


extendShadowPlane(point)

Extends the shadow extents by the given shadow projection point.

Parameters:
Name Type Description
point THREE.Vector3

A point to include in the shadow plane extents.

Returns:

Returns this shadow plane to support method chaining.

Type
PD.ShadowPlane

resetShadowPlane( [box])

Resets the shadow plane extents to the given extents, or makes it empty.

Parameters:
Name Type Argument Description
box THREE.Box3 <optional>

An optional box to reset the extents to.

Returns:

Returns this shadow plane to support method chaining.

Type
PD.ShadowPlane

setExtents(box, padding)

Updates the rectangle geometry from bounding box.

Override this method for subclasses that use more complex geometry.

Parameters:
Name Type Default Description
box THREE.Box3

The new extents of the grid mesh.

padding number 0

An extra border area in model units, defaults to 0.

Returns:

Returns this shadow plane to support method chaining.

Type
PD.ShadowPlane

updateShadowPlane()

Resizes and positions the shadow plane to the current shadow extents.

This offsets the shadow plane mesh surface from the Z-axis mesh origin by its shadowOffset and sets its corners based on its extents.

Returns:

Returns this shadow plane to support method chaining.

Type
PD.ShadowPlane