MCPcopy Create free account
hub / github.com/AryanpurTech/BlueEngine / build

Method build

crates/blue_engine_core/src/objects/instance.rs:38–49  ·  view source on GitHub ↗

Gathers all information and builds a Raw Instance to be sent to GPU

(&self)

Source from the content-addressed store, hash-verified

36
37 /// Gathers all information and builds a Raw Instance to be sent to GPU
38 pub fn build(&self) -> InstanceRaw {
39 let position_matrix = Matrix4::IDENTITY * Matrix4::from_translation(self.position);
40 let rotation_matrix = Matrix4::from_quat(
41 Quaternion::from_rotation_x(self.rotation.x)
42 * Quaternion::from_rotation_y(self.rotation.y)
43 * Quaternion::from_rotation_z(self.rotation.z),
44 );
45 let scale_matrix = Matrix4::IDENTITY * Matrix4::from_scale(self.scale);
46 InstanceRaw {
47 model: position_matrix * rotation_matrix * scale_matrix,
48 }
49 }
50
51 /// Sets the position
52 pub fn set_position(&mut self, position: impl Into<Vector3>) {

Callers 2

mainFunction · 0.45
update_loopMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected