Jump to content

Whats this in c++


cassius
 Share

Recommended Posts

There was a collection of utility functions in the old scene loader sample. You may find those by searching the forum or download the old source. I, however, took this from the utility.cpp from rolands c++ scene loader sample - which might be a better choise because its more up-to-date.

 

TVec3 StringToVec3( const string& s, char delimiter  )
{
stringstream ss ;
ss << s ;

TVec3 v ;
if( delimiter == ' ' )
 ss >> v.X >> v.Y >> v.Z ;
else
{
 char d1, d2 ;
 ss >> v.X >> d1 >> v.Y >> d2 >> v.Z ;
}
return v ;
}

 

hth

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

It seams to be no longer in the download section - if there is no LEBuilder sample which contains the "scene loader utility.cpp" then you might post him about a re-release. Utilitys are most likely included in the gamlib source base too - it does thinks a little different and uses "framewerk" iirc, which doesnt matters for the helper/utillity functions though.

 

Finally the "scripts" folder holds some lua versions like :

 

-- // ...
  local toStart=string.Explode(moveToStart,",")
  x=tonumber(toStart[1])
  y=tonumber(toStart[2])
  z=tonumber(toStart[3])
  self.model:SetPosition(Vec3(x,y,z))

 

... which uses "," as delimiter which would be faster with a smaller memory footprint imo. ;)

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...