Shale::Matrix4(T)
Inherits Indexable::Mutable < Indexable < Enumerable < Iterable < Struct < Value < Object
Matrix4
Description
FIXES:
- Figure out the best flow for the data setting and method operations
- Not sure about the efficency of the value setting, like with #identity, then doing out of order changes to other indices, what if, at all, performance loss is there
Constants
Constructors
Instance methods
Reason for flipping [x, y] is to match what is conventionally written in something like C where a multidim array would be equalivant matrix[y][x]
Not sure to have it like you would if writting on paper (x, y), maybe with symbols [x: 0, y: 0]?
Identity will set @data points
Description
The matrix is setup as such: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
Appends this struct's name and instance variables names and values to the given IO.
struct Point
def initialize(@x : Int32, @y : Int32)
end
end
p1 = Point.new 1, 2
p1.to_s # "Point(@x=1, @y=2)"
p1.inspect # "Point(@x=1, @y=2)"
Perspective proc
Description
Pretty prints self into the given printer.
By default appends a text that is the result of invoking
#inspect on self. Subclasses should override
for custom pretty printing.
Returns the element at the given index, without doing any bounds check.
Indexable makes sure to invoke this method with index in 0...size,
so converting negative indices to positive ones is not needed here.
Clients never invoke this method directly. Instead, they access
elements with #[](index) and #[]?(index).
This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.
Sets the element at the given index to value, without doing any bounds check.
Indexable::Mutable makes sure to invoke this method with index in
0...size, so converting negative indices to positive ones is not needed
here.
Clients never invoke this method directly. Instead, they modify elements
with #[]=(index, value).
This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.