forked from bartvdbraak/blender
style cleanup
This commit is contained in:
parent
6cff0b71a7
commit
cb0b3558af
@ -1142,7 +1142,7 @@ static ID *is_dupid(ListBase *lb, ID *id, const char *name)
|
||||
* Normally the ID that's being check is already in the ListBase, so ID *id
|
||||
* points at the new entry. The Python Library module needs to know what
|
||||
* the name of a datablock will be before it is appended; in this case ID *id
|
||||
* id is NULL;
|
||||
* id is NULL
|
||||
*/
|
||||
|
||||
static int check_for_dupid(ListBase *lb, ID *id, char *name)
|
||||
|
@ -1946,7 +1946,7 @@ void shade_alpha_obcolor(vec4 col, vec4 obcol, out vec4 outcol)
|
||||
float fresnel_dielectric(vec3 Incoming, vec3 Normal, float eta)
|
||||
{
|
||||
/* compute fresnel reflectance without explicitly computing
|
||||
the refracted direction */
|
||||
* the refracted direction */
|
||||
float c = abs(dot(Incoming, Normal));
|
||||
float g = eta * eta - 1.0 + c * c;
|
||||
float result;
|
||||
@ -1957,8 +1957,9 @@ float fresnel_dielectric(vec3 Incoming, vec3 Normal, float eta)
|
||||
float B =(c *(g + c)- 1.0)/(c *(g - c)+ 1.0);
|
||||
result = 0.5 * A * A *(1.0 + B * B);
|
||||
}
|
||||
else
|
||||
else {
|
||||
result = 1.0; /* TIR (no refracted component) */
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -91,10 +91,10 @@ void SCA_PropertySensor::PrecalculateRangeExpression()
|
||||
//The context is needed to retrieve the property at runtime but it creates
|
||||
//loop of references
|
||||
pars.SetContext(this->AddRef());
|
||||
STR_String checkstr = "(" + m_checkpropval + " <= "
|
||||
+ m_checkpropname + ") && ( "
|
||||
+ m_checkpropname + " <= "
|
||||
+ m_checkpropmaxval + ")";
|
||||
STR_String checkstr = ("(" + m_checkpropval + " <= " +
|
||||
m_checkpropname + ") && ( " +
|
||||
m_checkpropname + " <= " +
|
||||
m_checkpropmaxval + ")");
|
||||
|
||||
m_range_expr = pars.ProcessText(checkstr);
|
||||
}
|
||||
|
@ -141,8 +141,7 @@ bool SCA_RandomActuator::Update()
|
||||
int res;
|
||||
/* The [0, 1] interval is projected onto the [min, max+1] domain, */
|
||||
/* and then rounded. */
|
||||
res = (int) floor( ((m_parameter2 - m_parameter1 + 1) * m_base->DrawFloat())
|
||||
+ m_parameter1);
|
||||
res = (int)floor( ((m_parameter2 - m_parameter1 + 1) * m_base->DrawFloat()) + m_parameter1);
|
||||
tmpval = new CIntValue(res);
|
||||
}
|
||||
break;
|
||||
@ -172,8 +171,7 @@ bool SCA_RandomActuator::Update()
|
||||
}
|
||||
break;
|
||||
case KX_RANDOMACT_FLOAT_UNIFORM: {
|
||||
float res = ((m_parameter2 - m_parameter1) * m_base->DrawFloat())
|
||||
+ m_parameter1;
|
||||
float res = ((m_parameter2 - m_parameter1) * m_base->DrawFloat()) + m_parameter1;
|
||||
tmpval = new CFloatValue(res);
|
||||
}
|
||||
break;
|
||||
@ -239,8 +237,7 @@ bool SCA_RandomActuator::Update()
|
||||
/* controlling parameter. Using the 'normal' exponent is not very */
|
||||
/* intuitive... */
|
||||
/* tmpval = new CFloatValue( (1.0 / m_parameter1) */
|
||||
tmpval = new CFloatValue( (m_parameter1)
|
||||
* (-log(1.0 - m_base->DrawFloat())) );
|
||||
tmpval = new CFloatValue((m_parameter1) * (-log(1.0 - m_base->DrawFloat())));
|
||||
|
||||
}
|
||||
break;
|
||||
|
@ -719,8 +719,8 @@ void CcdPhysicsEnvironment::processFhSprings(double curTime,float interval)
|
||||
{
|
||||
if (ctrl->getConstructionInfo().m_do_fh)
|
||||
{
|
||||
btVector3 lspot = cl_object->getCenterOfMassPosition()
|
||||
+ rayDirLocal * resultCallback.m_closestHitFraction;
|
||||
btVector3 lspot = cl_object->getCenterOfMassPosition() +
|
||||
rayDirLocal * resultCallback.m_closestHitFraction;
|
||||
|
||||
|
||||
|
||||
|
@ -91,9 +91,9 @@ protected:
|
||||
/// calculate one color component
|
||||
unsigned char calcColor (unsigned int val, short idx)
|
||||
{
|
||||
return (((m_matrix[idx][0] * (VT_R(val)) + m_matrix[idx][1] * (VT_G(val))
|
||||
+ m_matrix[idx][2] * (VT_B(val)) + m_matrix[idx][3] * (VT_A(val))
|
||||
+ m_matrix[idx][4]) >> 8) & 0xFF);
|
||||
return (((m_matrix[idx][0] * (VT_R(val)) + m_matrix[idx][1] * (VT_G(val)) +
|
||||
m_matrix[idx][2] * (VT_B(val)) + m_matrix[idx][3] * (VT_A(val)) +
|
||||
m_matrix[idx][4]) >> 8) & 0xFF);
|
||||
}
|
||||
|
||||
/// filter pixel template, source int buffer
|
||||
|
Loading…
Reference in New Issue
Block a user