MutableTriangle
-
Cmn
class MutableTriangle : Triangle
Represents a mutable triangle, defined by its three corners p0, p1 and p2 in order. See ImmutableTriangle for the immutable version.
Summary
Public constructors |
|
|---|---|
|
Constructs a degenerate |
Cmn
|
MutableTriangle(p0: MutableVec, p1: MutableVec, p2: MutableVec)Create the |
Cmn
|
Public functions |
||
|---|---|---|
open operator Boolean |
Equality for |
Cmn
|
open Int |
hashCode() |
Cmn
|
MutableTriangle |
populateFrom(input: Triangle)Fills this |
Cmn
|
open String |
toString() |
Cmn
|
Public properties |
||
|---|---|---|
open MutableVec |
One of the three points that define the |
Cmn
|
open MutableVec |
One of the three points that define the |
Cmn
|
open MutableVec |
One of the three points that define the |
Cmn
|
Inherited functions |
|||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
MutableTriangle
MutableTriangle()
Constructs a degenerate MutableTriangle with p0, p1, and p2 set to (0, 0).
MutableTriangle
MutableTriangle(p0: MutableVec, p1: MutableVec, p2: MutableVec)
Create the MutableTriangle from three existing MutableVec instances. Note that these instances will become the internal state of this MutableTriangle, so modifications made to them directly or through setters on this MutableTriangle will modify the input MutableVec instances too. This is to allow performance-critical code to avoid any unnecessary allocations. This can be tricky to manage, especially in multithreaded code, so when calling code is unable to guarantee ownership of the nested mutable data at a particular time, it may be safest to construct this with copies of the data to give this MutableTriangle exclusive ownership of those copies.
Public functions
equals
open operator fun equals(other: Any?): Boolean
Equality for MutableTriangle is defined using the order in which p0, p1 and p2 are defined. Rotated/flipped triangles with out-of-order vertices are not considered equal.
populateFrom
fun populateFrom(input: Triangle): MutableTriangle
Fills this MutableTriangle with the values from input.
Returns the modified instance to allow chaining calls.
| Returns | |
|---|---|
MutableTriangle |
|