remove some odd static_cast<>

This commit is contained in:
Garux
2025-11-01 20:49:05 +05:00
parent 17d6588d1a
commit 2f17128f06
26 changed files with 372 additions and 380 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ inline void default_angle( float& angle ){
angle = ANGLEKEY_IDENTITY;
}
inline void normalise_angle( float& angle ){
angle = static_cast<float>( float_mod( angle, 360.0 ) );
angle = float_mod( angle, 360.0 );
}
inline void read_angle( float& angle, const char* value ){
if ( !string_parse_float( value, angle ) ) {
+3 -3
View File
@@ -37,9 +37,9 @@ inline void default_angles( Vector3& angles ){
angles = ANGLESKEY_IDENTITY;
}
inline void normalise_angles( Vector3& angles ){
angles[0] = static_cast<float>( float_mod( angles[0], 360 ) );
angles[1] = static_cast<float>( float_mod( angles[1], 360 ) );
angles[2] = static_cast<float>( float_mod( angles[2], 360 ) );
angles[0] = float_mod( angles[0], 360 );
angles[1] = float_mod( angles[1], 360 );
angles[2] = float_mod( angles[2], 360 );
}
inline void read_angle( Vector3& angles, const char* value ){
if ( !string_parse_float( value, angles[2] ) ) {
+13 -13
View File
@@ -179,7 +179,7 @@ void cartesian( const double Long, const double Lat, float cart[3] ) {
void sphere_construct_fill( Vector3 radiiPoints[SPHERE_FILL_POINTS] ){
float cart[3];
int k = 0;
const double step = c_pi / static_cast<double>( SPHERE_FILL_SIDES );
const double step = c_pi / SPHERE_FILL_SIDES;
radiiPoints[k++] = Vector3( 0.0, 0.0, -1.0 );
for( int i = 0; i < SPHERE_FILL_SIDES * 2; i += 2 ) {
@@ -408,40 +408,40 @@ void sphere_construct_wire( Vector3 radiiPoints[SPHERE_WIRE_POINTS] ){
for ( int i = 0; i < SPHERE_WIRE_SIDES; ++i )
{
double ds = sin( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
double dc = cos( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
const double ds = sin( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
const double dc = cos( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
radiiPoints[k++] =
Vector3(
static_cast<float>( dc ),
static_cast<float>( ds ),
dc,
ds,
0.f
);
}
for ( int i = 0; i < SPHERE_WIRE_SIDES; ++i )
{
double ds = sin( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
double dc = cos( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
const double ds = sin( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
const double dc = cos( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
radiiPoints[k++] =
Vector3(
static_cast<float>( dc ),
dc,
0.f,
static_cast<float>( ds )
ds
);
}
for ( int i = 0; i < SPHERE_WIRE_SIDES; ++i )
{
double ds = sin( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
double dc = cos( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
const double ds = sin( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
const double dc = cos( ( i * 2 * c_pi ) / SPHERE_WIRE_SIDES );
radiiPoints[k++] =
Vector3(
0.f,
static_cast<float>( dc ),
static_cast<float>( ds )
dc,
ds
);
}
}