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)
|
||||
|
@ -1105,7 +1105,7 @@ void mtex_normal(vec3 texco, sampler2D ima, out vec3 normal)
|
||||
// It needs to be done because in Blender
|
||||
// the normal used points inward.
|
||||
// Should this ever change this negate must be removed.
|
||||
vec4 color = texture2D(ima, texco.xy);
|
||||
vec4 color = texture2D(ima, texco.xy);
|
||||
normal = 2.0*(vec3(-color.r, color.g, color.b) - vec3(-0.5, 0.5, 0.5));
|
||||
}
|
||||
|
||||
@ -1190,7 +1190,7 @@ void mtex_bump_init_viewspace( vec3 surf_pos, vec3 surf_norm,
|
||||
}
|
||||
|
||||
void mtex_bump_tap3( vec3 texco, sampler2D ima, float hScale,
|
||||
out float dBs, out float dBt )
|
||||
out float dBs, out float dBt )
|
||||
{
|
||||
vec2 STll = texco.xy;
|
||||
vec2 STlr = texco.xy + dFdx(texco.xy) ;
|
||||
@ -1945,22 +1945,23 @@ 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 */
|
||||
float c = abs(dot(Incoming, Normal));
|
||||
float g = eta * eta - 1.0 + c * c;
|
||||
float result;
|
||||
/* compute fresnel reflectance without explicitly computing
|
||||
* the refracted direction */
|
||||
float c = abs(dot(Incoming, Normal));
|
||||
float g = eta * eta - 1.0 + c * c;
|
||||
float result;
|
||||
|
||||
if(g > 0.0) {
|
||||
g = sqrt(g);
|
||||
float A =(g - c)/(g + c);
|
||||
float B =(c *(g + c)- 1.0)/(c *(g - c)+ 1.0);
|
||||
result = 0.5 * A * A *(1.0 + B * B);
|
||||
}
|
||||
else
|
||||
result = 1.0; /* TIR (no refracted component) */
|
||||
if(g > 0.0) {
|
||||
g = sqrt(g);
|
||||
float A =(g - c)/(g + c);
|
||||
float B =(c *(g + c)- 1.0)/(c *(g - c)+ 1.0);
|
||||
result = 0.5 * A * A *(1.0 + B * B);
|
||||
}
|
||||
else {
|
||||
result = 1.0; /* TIR (no refracted component) */
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
float hypot(float x, float y)
|
||||
@ -2135,13 +2136,13 @@ void node_tex_environment_empty(vec3 co, out vec4 color)
|
||||
void node_tex_image(vec3 co, sampler2D ima, out vec4 color, out float alpha)
|
||||
{
|
||||
color = texture2D(ima, co.xy);
|
||||
alpha = color.a;
|
||||
alpha = color.a;
|
||||
}
|
||||
|
||||
void node_tex_image_empty(vec3 co, out vec4 color, out float alpha)
|
||||
{
|
||||
color = vec4(0.0);
|
||||
alpha = 0.0;
|
||||
alpha = 0.0;
|
||||
}
|
||||
|
||||
void node_tex_magic(vec3 p, float scale, float distortion, out vec4 color, out float fac)
|
||||
|
@ -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