Changeset 471 for trunk/src/engine
- Timestamp:
- 09/21/15 19:13:26 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/engine/particle_engine.cc
r454 r471 231 231 datap->plane_normal = normalize_safe( datap->plane_normal, vec3(0.0f,1.0f,0.0f) ); 232 232 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 ) ); 234 234 return true; 235 235 } … … 751 751 { 752 752 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 ); 755 755 float phi = r.frange( 0.0f, 2* math::pi<float>() ); 756 756 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 ) + 759 759 edata.dir * cos_theta ); 760 760 }
Note: See TracChangeset
for help on using the changeset viewer.