HalfEdge
Extends:
Half Edges are created by Room.
Once rooms have been identified, Half Edges are created for each interior wall.
A wall can have two half edges if it is visible from both sides.
Constructor Summary
Public Constructor | ||
public |
constructor(room: Room, wall: Wall, front: boolean) Constructs a half edge. |
Member Summary
Public Members | ||
public |
center: Vector3 The center of this half edge |
|
public |
exteriorTransform: Matrix4 The exterior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall |
|
public |
Is this is the front edge or the back edge |
|
public |
The height of a wall |
|
public |
interiorTransform: Matrix4 The interior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall |
|
public |
invExteriorTransform: Matrix4 The inverse of the exterior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall |
|
public |
invInteriorTransform: Matrix4 The inverse of the interior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall |
|
public |
max: Vector3 The maximum point in space calculated from the bounds |
|
public |
min: Vector3 The minimum point in space calculated from the bounds |
|
public |
Reference to the next halfedge instance connected to this |
|
public |
The offset to maintain for the front and back walls from the midline of a wall |
|
public |
plane: Mesh The plane mesh that will be used for checking intersections of wall items |
|
public |
Reference to the previous halfedge instance connected to this |
|
public |
This is an array of callbacks to be call when redraw happens |
|
public |
Reference to a Room instance |
|
public |
Reference to a Wall instance |
Method Summary
Public Methods | ||
public |
computeTransforms(transform: Matrix4, invTransform: Matrix4, start: Vector2, end: Vector2) Calculate the transformation matrix for the edge (front/back) baesd on the parameters. |
|
public |
Get the corners of the half edge. |
|
public |
Emit the redraw event |
|
public |
distanceTo(x: Number, y: Number): Number Gets the distance from specified point. |
|
public |
exteriorCenter(): Vector2 Return the 2D exterior location that is at the center/middle. |
|
public |
Return the exterior distance of the exterior wall |
|
public |
exteriorEnd(): Vector2 Return the 2D exterior location that is at the end. |
|
public |
exteriorStart(): Vector2 Return the 2D exterior location that is at the start. |
|
public |
This generates the invisible planes in the scene that are used for interesection testing for the wall items |
|
public |
Get the ending corner of the wall this instance represents |
|
public |
If this is the front edge then return the back edge. |
|
public |
Get the starting corner of the wall this instance represents |
|
public |
getTexture(): Object Two separate textures are used for the walls. |
|
public |
halfAngleVector(v1: Vector2, v1: Vector2): Object Gets CCW angle from v1 to v2 |
|
public |
interiorCenter(): Vector2 Return the 2D interior location that is at the center/middle. |
|
public |
Return the interior distance of the interior wall |
|
public |
interiorEnd(): Vector2 Return the 2D interior location that is at the end. |
|
public |
interiorStart(): Vector2 Return the 2D interior location that is at the start. |
|
public |
setTexture(textureUrl: String, textureStretch: boolean, textureScale: Number) Set a Texture to the wall. |
|
public |
transformCorner(corner: Corner): Vector3 Transform the Corner instance to a Vector3 instance using the x and y position returned as x and z |
Public Constructors
Public Members
public center: Vector3 source
The center of this half edge
Properties:
Name | Type | Attribute | Description |
center | Vector3 | The center of this half edge |
public exteriorTransform: Matrix4 source
The exterior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall
Properties:
Name | Type | Attribute | Description |
exteriorTransform | Matrix4 | The exterior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall |
public front: boolean source
Is this is the front edge or the back edge
Properties:
Name | Type | Attribute | Description |
front | boolean | Is this is the front edge or the back edge |
public height: Number source
The height of a wall
Properties:
Name | Type | Attribute | Description |
height | Number | The height of a wall |
public interiorTransform: Matrix4 source
The interior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall
Properties:
Name | Type | Attribute | Description |
interiorTransform | Matrix4 | The interior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall |
public invExteriorTransform: Matrix4 source
The inverse of the exterior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall
Properties:
Name | Type | Attribute | Description |
invExteriorTransform | Matrix4 | The inverse of the exterior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall |
public invInteriorTransform: Matrix4 source
The inverse of the interior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall
Properties:
Name | Type | Attribute | Description |
invInteriorTransform | Matrix4 | The inverse of the interior transformation matrix that contains the homogeneous transformation of the plane based on the two corner positions of the wall |
public max: Vector3 source
The maximum point in space calculated from the bounds
Properties:
Name | Type | Attribute | Description |
max | Vector3 | The maximum point in space calculated from the bounds |
public min: Vector3 source
The minimum point in space calculated from the bounds
Properties:
Name | Type | Attribute | Description |
min | Vector3 | The minimum point in space calculated from the bounds |
public next: HalfEdge source
Reference to the next halfedge instance connected to this
Properties:
Name | Type | Attribute | Description |
next | HalfEdge | Reference to the next halfedge instance connected to this |
public offset: Number source
The offset to maintain for the front and back walls from the midline of a wall
Properties:
Name | Type | Attribute | Description |
offset | Number | The offset to maintain for the front and back walls from the midline of a wall |
public plane: Mesh source
The plane mesh that will be used for checking intersections of wall items
Properties:
Name | Type | Attribute | Description |
plane | Mesh | The plane mesh that will be used for checking intersections of wall items |
public prev: HalfEdge source
Reference to the previous halfedge instance connected to this
Properties:
Name | Type | Attribute | Description |
prev | HalfEdge | Reference to the previous halfedge instance connected to this |
Public Methods
public computeTransforms(transform: Matrix4, invTransform: Matrix4, start: Vector2, end: Vector2) source
Calculate the transformation matrix for the edge (front/back) baesd on the parameters.
Params:
Name | Type | Attribute | Description |
transform | Matrix4 | The matrix reference in which the transformation is stored |
|
invTransform | Matrix4 | The inverse of the transform that is stored in the invTransform |
|
start | Vector2 | The starting point location |
|
end | Vector2 | The ending point location |
public exteriorCenter(): Vector2 source
Return the 2D exterior location that is at the center/middle.
Return:
Vector2 | Return an object with attributes x, y |
public exteriorEnd(): Vector2 source
Return the 2D exterior location that is at the end.
Return:
Vector2 | Return an object with attributes x, y |
public exteriorStart(): Vector2 source
Return the 2D exterior location that is at the start.
Return:
Vector2 | Return an object with attributes x, y |
public generatePlane() source
This generates the invisible planes in the scene that are used for interesection testing for the wall items
public getOppositeEdge(): HalfEdge source
If this is the front edge then return the back edge. For example in a wall there are two halfedges, i.e one for front and one back. Based on which side this halfedge lies return the opposite HalfEdge
public getTexture(): Object source
Two separate textures are used for the walls. Based on which side of the wall this {HalfEdge} refers the texture is returned
public halfAngleVector(v1: Vector2, v1: Vector2): Object source
Gets CCW angle from v1 to v2
Params:
Name | Type | Attribute | Description |
v1 | Vector2 | The point a |
|
v1 | Vector2 | The point b |
public interiorCenter(): Vector2 source
Return the 2D interior location that is at the center/middle.
Return:
Vector2 | Return an object with attributes x, y |
public interiorEnd(): Vector2 source
Return the 2D interior location that is at the end.
Return:
Vector2 | Return an object with attributes x, y |
public interiorStart(): Vector2 source
Return the 2D interior location that is at the start.
Return:
Vector2 | Return an object with attributes x, y |
public setTexture(textureUrl: String, textureStretch: boolean, textureScale: Number) source
Set a Texture to the wall. Based on the edge side as front or back the texture is applied appropriately to the wall