pub struct Object {
pub mass: f64,
pub temperature: f64,
pub is_celsius: bool,
pub specific_heat_capacity: f64,
pub density: f64,
pub kinetic_energy: f64,
pub velocity: [f64; 3],
pub acceleration: [f64; 3],
pub position: [f64; 3],
}Fields§
§mass: f64The object’s mass in kilograms (kg).
temperature: f64The object’s temperature in kelvin (K).
is_celsius: boolSpecifies if the object’s temperature is in Celsius or not (˚C).
specific_heat_capacity: f64The object’s specific heat capacity in joule per kilogram kelvin (J/kg K).
density: f64The object’s density in grams per milliliter (g/ml).
kinetic_energy: f64The object’s kinetic energy in joules (J).
velocity: [f64; 3]The object’s velocity in a three-dimensional in meter per second (m/s).
acceleration: [f64; 3]The object’s acceleration in a three-dimensional space in meter per second (m/s).
position: [f64; 3]The position of the object’s center in a three-dimensional space (x, y, z).
Implementations§
Source§impl Object
You can create a new object inside a variable.
impl Object
You can create a new object inside a variable.
§Examples
use openphys::utils::object::Object;
let obj1 = Object {
mass: 14.4,
..Object::default()
};Sourcepub fn new() -> Self
pub fn new() -> Self
You can create a new empty object using the Object::new() function.
§Examples
use openphys::utils::object::Object;
let obj1 = Object::new();Sourcepub fn default() -> Self
pub fn default() -> Self
You can create an object with some reasonable defaults with the Object::default()
function.
§Examples
use openphys::utils::object::Object;
let obj1 = Object::default();Also, you can create an object with some changed values and some default values, like this:
use openphys::utils::object::Object;
let obj1 = Object {
mass: 1.0,
temperature: 20.0,
is_celsius: true,
..Object::default()
};