MCPcopy
hub / github.com/g3n/engine / NewPerspective

Function NewPerspective

camera/camera.go:61–74  ·  view source on GitHub ↗

NewPerspective creates and returns a new perspective camera with the specified parameters.

(aspect, near, far, fov float32, axis Axis)

Source from the content-addressed store, hash-verified

59
60// NewPerspective creates and returns a new perspective camera with the specified parameters.
61func NewPerspective(aspect, near, far, fov float32, axis Axis) *Camera {
62
63 c := new(Camera)
64 c.Node.Init(c)
65 c.aspect = aspect
66 c.near = near
67 c.far = far
68 c.axis = axis
69 c.proj = Perspective
70 c.fov = fov
71 c.size = 8
72 c.projChanged = true
73 return c
74}
75
76// NewOrthographic creates and returns a new orthographic camera with the specified parameters.
77func NewOrthographic(aspect, near, far, size float32, axis Axis) *Camera {

Callers 2

LoadCameraMethod · 0.92
NewFunction · 0.85

Calls 1

InitMethod · 0.45

Tested by

no test coverage detected