M
Morten Nielsen
I'm trying to convert the following struct from C to C#, but have a problem
with the two pointers that point back to the same structure.
struct BSP_Node {
byte axis;
float plane;
BSP_Node *left; // ARGH!
BSP_Node *right; // ARGH!
bool leaf;
Object *objects;
};
First I tried creating a structure like the one below, but the compiler
complains about the cycle that 'left' and 'right' creates.
public struct BSP_Node
{
public byte axis;
public float plane;
public BSP_Node left;
public BSP_Node right;
public bool leaf;
public object objects;
}
Does anyone know how to translate this structure correctly ? The ref keywork
can't be used either, so that I could make 'left' and 'right' work like
pointers.
Regards
/Morten Nielsen
with the two pointers that point back to the same structure.
struct BSP_Node {
byte axis;
float plane;
BSP_Node *left; // ARGH!
BSP_Node *right; // ARGH!
bool leaf;
Object *objects;
};
First I tried creating a structure like the one below, but the compiler
complains about the cycle that 'left' and 'right' creates.
public struct BSP_Node
{
public byte axis;
public float plane;
public BSP_Node left;
public BSP_Node right;
public bool leaf;
public object objects;
}
Does anyone know how to translate this structure correctly ? The ref keywork
can't be used either, so that I could make 'left' and 'right' work like
pointers.
Regards
/Morten Nielsen