Ignore:
Timestamp:
09/21/15 19:13:26 (10 years ago)
Author:
epyon
Message:
  • full math library
  • GLM dependency removed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/engine/particle_engine.cc

    r454 r471  
    231231        datap->plane_normal = normalize_safe( datap->plane_normal, vec3(0.0f,1.0f,0.0f) );
    232232        datap->bounce       = table->get<float>("bounce", 0.0f );
    233         datap->distance     = -math::dot( datap->plane_normal, datap->plane_point ) / math::sqrt( math::dot( datap->plane_normal, datap->plane_normal ) );
     233        datap->distance     = -math::dot( datap->plane_normal, datap->plane_point ) / sqrt( math::dot( datap->plane_normal, datap->plane_normal ) );
    234234        return true;
    235235}
     
    751751                                        {
    752752                                                float emission_angle = math::radians( edata.angle );
    753                                                 float cos_theta = r.frange( math::cos( emission_angle ), 1.0f );
    754                                                 float sin_theta = math::sqrt(1.0f - cos_theta * cos_theta );
     753                                                float cos_theta = r.frange( cos( emission_angle ), 1.0f );
     754                                                float sin_theta = sqrt(1.0f - cos_theta * cos_theta );
    755755                                                float phi       = r.frange( 0.0f, 2* math::pi<float>() );
    756756                                                pinfo.velocity  = orient *
    757                                                         ( edata.odir * ( math::cos(phi) * sin_theta ) +
    758                                                         edata.cdir * ( math::sin(phi)*sin_theta ) +
     757                                                        ( edata.odir * ( cos(phi) * sin_theta ) +
     758                                                        edata.cdir * ( sin(phi)*sin_theta ) +
    759759                                                        edata.dir  * cos_theta );
    760760                                        }
Note: See TracChangeset for help on using the changeset viewer.