mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
A Whole New World (clang-format edition)
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
This commit is contained in:
@@ -205,21 +205,23 @@ MaterialEditor::MaterialEditor() {
|
||||
Vector3(x0 * zr0, z0, y0 *zr0)
|
||||
};
|
||||
|
||||
#define ADD_POINT(m_idx) \
|
||||
normals.push_back(v[m_idx]);\
|
||||
vertices.push_back(v[m_idx]*radius);\
|
||||
{ Vector2 uv(Math::atan2(v[m_idx].x,v[m_idx].z),Math::atan2(-v[m_idx].y,v[m_idx].z));\
|
||||
uv/=Math_PI;\
|
||||
uv*=4.0;\
|
||||
uv=uv*0.5+Vector2(0.5,0.5);\
|
||||
uvs.push_back(uv);\
|
||||
}\
|
||||
{ Vector3 t = tt.xform(v[m_idx]);\
|
||||
tangents.push_back(t.x);\
|
||||
tangents.push_back(t.y);\
|
||||
tangents.push_back(t.z);\
|
||||
tangents.push_back(1.0);\
|
||||
}
|
||||
#define ADD_POINT(m_idx) \
|
||||
normals.push_back(v[m_idx]); \
|
||||
vertices.push_back(v[m_idx] * radius); \
|
||||
{ \
|
||||
Vector2 uv(Math::atan2(v[m_idx].x, v[m_idx].z), Math::atan2(-v[m_idx].y, v[m_idx].z)); \
|
||||
uv /= Math_PI; \
|
||||
uv *= 4.0; \
|
||||
uv = uv * 0.5 + Vector2(0.5, 0.5); \
|
||||
uvs.push_back(uv); \
|
||||
} \
|
||||
{ \
|
||||
Vector3 t = tt.xform(v[m_idx]); \
|
||||
tangents.push_back(t.x); \
|
||||
tangents.push_back(t.y); \
|
||||
tangents.push_back(t.z); \
|
||||
tangents.push_back(1.0); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -256,15 +258,16 @@ MaterialEditor::MaterialEditor() {
|
||||
PoolVector<Vector3> uvs;
|
||||
|
||||
int vtx_idx=0;
|
||||
#define ADD_VTX(m_idx);\
|
||||
vertices.push_back( face_points[m_idx] );\
|
||||
normals.push_back( normal_points[m_idx] );\
|
||||
tangents.push_back( normal_points[m_idx][1] );\
|
||||
tangents.push_back( normal_points[m_idx][2] );\
|
||||
tangents.push_back( normal_points[m_idx][0] );\
|
||||
tangents.push_back( 1.0 );\
|
||||
uvs.push_back( Vector3(uv_points[m_idx*2+0],uv_points[m_idx*2+1],0) );\
|
||||
vtx_idx++;\
|
||||
#define ADD_VTX(m_idx) \
|
||||
; \
|
||||
vertices.push_back(face_points[m_idx]); \
|
||||
normals.push_back(normal_points[m_idx]); \
|
||||
tangents.push_back(normal_points[m_idx][1]); \
|
||||
tangents.push_back(normal_points[m_idx][2]); \
|
||||
tangents.push_back(normal_points[m_idx][0]); \
|
||||
tangents.push_back(1.0); \
|
||||
uvs.push_back(Vector3(uv_points[m_idx * 2 + 0], uv_points[m_idx * 2 + 1], 0)); \
|
||||
vtx_idx++;\
|
||||
|
||||
for (int i=0;i<6;i++) {
|
||||
|
||||
@@ -409,5 +412,4 @@ MaterialEditorPlugin::~MaterialEditorPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user