Apel is a library that brings particle animations to the table with flexible behaviour and a clean developer interface. It promises also lots of predefined shapes & paths to help the developer on their particle scene
The validation used to use the four vertices already existing within the instance, not the new vertex provided. Therefore, start using the new vertex and perform the check prior to anything else. There's no reason to set a local variable if an exception will be thrown.
Note that the invariant of a valid tetrahedron is easily broken because getVertex1() and others return a reference to a Vector3f that may be modified in-place, and there's no way to detect or raise an exception if that happens unless the getters return copies and the setters make defensive copies. The tradeoff is performance, especially on per-frame interceptors, if both the getter and setter are making copies. The alternative is to ditch the check altogether and just let users render the lines that fully connect the four vertices.
Fixes #40
The validation used to use the four vertices already existing within the instance, not the new vertex provided. Therefore, start using the new vertex and perform the check prior to anything else. There's no reason to set a local variable if an exception will be thrown.
Note that the invariant of a valid tetrahedron is easily broken because
getVertex1()
and others return a reference to a Vector3f that may be modified in-place, and there's no way to detect or raise an exception if that happens unless the getters return copies and the setters make defensive copies. The tradeoff is performance, especially on per-frame interceptors, if both the getter and setter are making copies. The alternative is to ditch the check altogether and just let users render the lines that fully connect the four vertices.