Created
July 19, 2012 01:51
-
-
Save tri-man/3140256 to your computer and use it in GitHub Desktop.
C版のコード
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct VECTOR | |
{ | |
float x; | |
float y; | |
float z; | |
}; | |
VECTOR VSet( float x, float y, float z ) | |
{ | |
VECTOR rtn; | |
rtn.x = x; | |
rtn.y = y; | |
rtn.z = z; | |
return rtn; | |
} | |
VECTOR VAdd( const VECTOR& in_val ) | |
{ | |
VECTOR rtn; | |
rtn.x = in_val.x + 1.0f; | |
rtn.y = in_val.y + 1.0f; | |
rtn.z = in_val.z + 1.0f; | |
return rtn; | |
} | |
int main() | |
{ | |
VECTOR vec = VAdd( VSet( 0.0f, 1.0f, 0.0f) ); | |
printf( "vec(%f,%f,%f)", vec.x, vec.y, vec.z ); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment