AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Physics.h File Reference
#include "Geometry.h"
#include <cmath>
#include <cstdlib>
#include <iostream>

Go to the source code of this file.

Functions

float getWeight (float height, float width, float specificWeight)
 
float getOutOfWater (float width, float weight, float density)
 Get the height immersed in water.
 

Function Documentation

◆ getOutOfWater()

float getOutOfWater ( float  width,
float  weight,
float  density 
)
inline

Get the height immersed in water.

Parameters
height
width
weightspecific weight
Returns
float
50{
51 auto baseArea = getCircleAreaByRadius(width / 2.0f);
52 return weight / (baseArea * density);
53}
double getCircleAreaByRadius(double radius)
Definition: Geometry.h:53

References getCircleAreaByRadius().

Referenced by WorldObject::GetMinHeightInWater().

◆ getWeight()

float getWeight ( float  height,
float  width,
float  specificWeight 
)
inline
35{
36 auto volume = getCylinderVolume(height, width / 2.0f);
37 auto weight = volume * specificWeight;
38 return weight;
39}
double getCylinderVolume(double height, double radius)
Definition: Geometry.h:63

References getCylinderVolume().

Referenced by WorldObject::GetMinHeightInWater().