struct PF3d::Tri

Defined in:

pf3d/tri.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(p1 : PF2d::Vec3(Float64), p2 : PF2d::Vec3(Float64), p3 : PF2d::Vec3(Float64), shade : Float64 = 1.0, normal : PF2d::Vec3(Float64) | Nil = nil, clipped : Bool = false) #

[View source]
def self.new(p1 : PF2d::Vec3(Float64), p2 : PF2d::Vec3(Float64), p3 : PF2d::Vec3(Float64), t1 : PF2d::Vec3(Float64), t2 : PF2d::Vec3(Float64), t3 : PF2d::Vec3(Float64), shade : Float64 = 1.0, clipped : Bool = false) #

[View source]

Instance Method Detail

def *(mat : PF2d::Matrix) #

Multiply all points by a Matrix, returning a new Tri


[View source]
def clip(plane : PF2d::Vec, plane_normal : PF2d::Vec) #

Split the triangle based on which points are inside of a given plane Returns a tuple of 0-2 triangles


[View source]
def clipped : Bool #

[View source]
def map_points(&) #

[View source]
def normal #

Return the normal assuming clockwise pointing winding


[View source]
def normal=(normal : PF2d::Vec3(Float64) | Nil) #

[View source]
def p1 : PF2d::Vec3(Float64) #

[View source]
def p1=(p1 : PF2d::Vec3(Float64)) #

[View source]
def p2 : PF2d::Vec3(Float64) #

[View source]
def p2=(p2 : PF2d::Vec3(Float64)) #

[View source]
def p3 : PF2d::Vec3(Float64) #

[View source]
def p3=(p3 : PF2d::Vec3(Float64)) #

[View source]
def shade : Float64 #

[View source]
def shade=(shade : Float64) #

[View source]
def split(p1, p2, p3, t1, t2, t3) #

[View source]
def t1 : PF2d::Vec3(Float64) #

[View source]
def t1=(t1 : PF2d::Vec3(Float64)) #

[View source]
def t2 : PF2d::Vec3(Float64) #

[View source]
def t2=(t2 : PF2d::Vec3(Float64)) #

[View source]
def t3 : PF2d::Vec3(Float64) #

[View source]
def t3=(t3 : PF2d::Vec3(Float64)) #

[View source]
def x #

Get the average x value


[View source]
def y #

Get the average y value


[View source]
def z #

Get the average z value


[View source]
def z=(value : Float64) #

[View source]