Sign in to follow this  

Unity [solved] 'member' is not a type request for member of non-aggre...

Recommended Posts

edit: this problem is solved, I am now asking for help here. I can't understand why my compiler is throwing these errors:
In member function `env_cell* env_cell::findCell(float, float)': 'right' is not a type
(likewise for left, top and bottom) Here is my class:
//individual cell in the environment
class env_cell{
  float top,left,bottom,right;
  int id;
  CheightMap heightMap; //height map
  env_map* map; //pointer to map handler object
  std::vector<env_cell*> visCells; //cells that can be seen from this cell
  std::vector<env_cell*>::iterator visCellsI; //visible cells iterator
  GLuint opaqueDraw, transDraw; //compiled static mesh and bsp display lists
  std::vector<entity*> entities; //pointers to entities within the cell
  prop_static staticProps[]; //static props linked to the cell
  bsp_detail detail[]; //bsp geometry linked to the cell cell
  std::vector<light*> lights; //pointers to lights in the cell
  float startHeight; //starting z height from z = 0
  int nextVisCellPos,nextStaticProp,nextBsp,nextLight;
  env_cell(int sId,float sTop,float sLeft,float sBottom,float sRight){
    id = sId;
    top = sTop;
    left = sLeft;
    bottom = sBottom;
    right = sRight;
    opaqueDraw = glGenLists(1);
    transDraw = glGenLists(1);
  //set the height map and z start
  void setHeight(CheightMap sHeightMap,float sStartHeight){
    heightMap = sHeightMap;
    startHeight = sStartHeight;
  //adds a cell pointer to the array of cells this cell can see
  void addVisCell(env_cell* visCell){
    nextVisCellPos ++;
  //adds a static prop to the cell
  void addStaticProp(prop_static prop){
    staticProps[nextStaticProp] = prop;
    nextStaticProp ++;
  //adds some bsp geometry to the cell
  void addBspDetail(bsp_detail bsp){
    detail[nextBsp] = bsp;
    nextBsp ++;
  //renders the static props and bsp detail into display lists
  void compileDispLists(){
    //make opaque & transparent geometry into display lists
    //build opaque geometry
      //just draw a floor now (rather than combine static props and bsp)
    		//glNormal3f(0,1,0); //up
  //what about light maps?
  //add a pointer to a light within the cell
  void addLight(light * thisLight){
    nextLight ++;
  //returns the pointer of the cell a position is in
  env_cell* findCell(float x,float z){
    env_cell * foundCell;
    for(visCellsI = visCells.begin();visCellsI != visCells.end();visCellsI++){
      //if point is inside the cell
      if(x<=visCellsI->right && x>=visCellsI->left && z<=visCellsI->top && 
      z>=visCellsI->bottom){ //THIS LINE
        foundCell = &(*visCellsI);
    //if a cell was found
      return foundCell; //return new cell
    } else {
      return this; //keep current cell assigned

(errors thrown on line commented "THIS LINE")
if(x<=visCellsI->right && x>=visCellsI->left && z<=visCellsI->top && z>=visCellsI->bottom)

I don't see why It can't find the members. There is another point where the same logic is processed (finding a cell pointer on the whole map not just adjacent cells to a given cell), also throwing errors. Ask for any more info because I don't know what else to say about it. [Edited by - Bozebo on April 25, 2010 8:30:04 PM]

Share this post

Link to post
Share on other sites
if(x <= (*visCellsI)->right && x >= (*visCellsI)->left && z <= (*visCellsI)->top && z >= (*visCellsI)->bottom)

(You have to dereference the iterator and the pointer)

Share this post

Link to post
Share on other sites
Original post by pablo24
if(x <= (*visCellsI)->right && x >= (*visCellsI)->left && z <= (*visCellsI)->top && z >= (*visCellsI)->bottom)

(You have to dereference the iterator and the pointer)

Oh wow thanks. That solved a bunch of problems.

Would it be faster to dereference once and store it in the function or dereference 4 times as you examplified?

[Edited by - Bozebo on April 25, 2010 7:38:00 PM]

Share this post

Link to post
Share on other sites
Original post by Bozebo
Would it be faster to dereference once and store it in the function or dereference 4 times as you examplified?

Conceptually, probably.

In terms of code, no. The compiler will make the transformation assuming that it helps.

However, the resulting code is probably cleaner. Try writing it both ways and see what looks better to you.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Similar Content

    • By sprotz
      I like unity3d but the installation size is too big. the package itself is 1GB and the installation is 5GB. What are some good, easy 3d game engines similar to Unity that have smaller file sizes? Excluding engines that lack editors like level editors, world editors etc, with an easy enough scripting language, physics and good documentation.
    • By Canislupus54
      I'm looking for a team to help me out with a 3D platformer. Basically, you jump between platforms with parkour elements and you fight enemies with a mix of melee and ranged attacks. This is purely a hobby project. I'm not promising any payment, ever. You can do it for experience, to learn, for fun, whatever, as long as you don't expect to get paid. Right now I need a 3D modeler and animator. Reply or email me at if you're interested. Thanks.
    • By Pixelated_Nate
      Hi all!
      We are looking for a C# programmer for our 2D Action RPG titled Adavia, made in Unity.
      The game itself is akin to Legend of Zelda: Link to the Past, though we're also adding in traditional RPG elements such as Character Creation.
      This is more of a hobby than anything commercial, if it somehow does manage to go commercially, all revenue will be split equally among the team.
      If you're interested, we ask that you be comfortable with:
      Unity Coding A.I's for enemies and NPCs. Working with GUI's. Communicating regularly with the team via Skype (text only). If you have any questions or would like to apply, please contact me at
    • By MrGiratinaORIGINAL

      I'm the co-director of LM Team, a 7-member team currently constructing a fangame based upon the Mega Man series. We've been working for about 2 years now, and both of our current programmers are busy for the next 6 months or so. Because of this, we're currently looking for a programmer (or more) to take care of gameplay and animation programming. We already have a base system in place that may optionally be built upon. This will be a hobby project to invest your free time in, not a gamedev gig.
      We're currently about 67% done with the OST, 75% done with the design work, and 33% done with the graphical work. As such, the specifications of what we need should remain pretty stagnant from now on.
      Here's some links of our team's work, to give you an idea of what we're currently capable of achieving:
      Actual Y+1 Stuff:
      - Current public playlist of music
      - Old footage of the first boss of the game, since been altered slightly based on feedback
      - Mockups
      m9m (director, composer):
      - Grand Dad Reboot - Ominous Cavern
      - Lands of Onlup
      - Mega Man Revolution Remix - Wily 2
      MrKyurem (co-director, main designer, me):
      - Boil Man - 10th place in Make a Good Mega Man Level 2 Contest
      NaOH (programmer [not programmer who is currently working on the engine]):
      - Programmer for Make a Good Mega Man Level 2 Contest's release game (did co-op mode and leaderboard functionality)
      - 15 years of programming experience
      - Castlevania 3 controls romhack
      - GML code beautifier
      - Beat-Em-Up engine
      Alm (artist):
      - Cutscene for a personal project
      - Tileset for Boil Man's stage in MaGMML2
      - Concept sprite
      Valo (artist):
      - Jungle Man tileset in Mega Man SD
      - Boxart for Mega Man SD
      - Wily sprite
      Karakato (artist):
      - Robot Masters in BCA
      - Idol Woman
      - Stage Select for separate project
      Deathro (composer):
      - Through the Eye of a Prism - 2nd place in Famicompo 2015's Original category
      - Mega Man SFR - Wily 2
      - Geno Force - Silent Breeze
      If you're interested in joining, I'd recommend signing up to Discord, as we almost exclusively communicate through this.
      Discord Tags:
    • By ilovegames
      You are the commander of a special forces squadron. You were given a task that appeared simple at first glance - to check for suspicious activity in the building of an abandoned psychiatric hospital. But you could not even imagine what you will actually have to face.

  • Popular Now