-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72b8251
commit eaacfe2
Showing
3 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { | ||
MeshComponent, | ||
MeshComponentParams | ||
} from '../../core/MeshComponent'; | ||
|
||
import { | ||
Mesh, | ||
PlaneBufferGeometry, | ||
PlaneGeometry | ||
} from 'three'; | ||
|
||
interface PlaneParams extends MeshComponentParams { | ||
|
||
/** Geometry parameters */ | ||
geometry?: { | ||
|
||
/** | ||
* Width along the X axis. | ||
* Default is 10. | ||
*/ | ||
width?: number; | ||
|
||
/** | ||
* Width along the Y axis. | ||
* Default is 10. | ||
*/ | ||
height?: number; | ||
|
||
/** | ||
* Number of width segments. | ||
* Default is 1. | ||
*/ | ||
wSegments?: number; | ||
|
||
/** | ||
* Number of height segments. | ||
* Default is 1. | ||
*/ | ||
hSegments?: number; | ||
}; | ||
|
||
/** | ||
* Sets whether to build a buffered geometry | ||
* Default is false. | ||
*/ | ||
buffer?: boolean; | ||
} | ||
|
||
export class Plane extends MeshComponent { | ||
|
||
/** | ||
* @constructor Creates a Plane | ||
* @param params parameters | ||
*/ | ||
constructor(params?: PlaneParams); | ||
|
||
/** | ||
* Build lifecycle creates a mesh using input params. | ||
* @param params | ||
*/ | ||
build(params?: PlaneParams): Mesh; | ||
|
||
/** | ||
* Builds the geometry | ||
* @param params | ||
*/ | ||
buildGeometry(params?: PlaneParams): PlaneGeometry | PlaneBufferGeometry; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters