Random Chitchat 2012-2016
That's how it normally goes, but they're both pretty much interchangeable if you want.
Thanks given by:
This just reinforces the point that my jokes are terrible...
Thanks given by:
I had an idea on how we could let the server know what the bounding boxes are for a block. We simply create a list of boundingboxes in the block handler. Here is kinda what I mean:
BlockHandler.h:
typedef std::vector<cBoundingBox> BoundingBoxes;

/// Returns a list of bounding boxes. For example a cauldron returns 5 because it has 5 faces that are solid but a full block returns 1
virtual BoundingBoxes & GetBoundingBoxes(Vector3i a_Pos);

BlockHandler.cpp:
cBlockHandler::BoundingBoxes & cBlockHandler::GetBoundingBoxes(Vector3i a_Pos)
{
	cBlockHandler::BoundingBoxes BBS;
	
	if (cBlockInfo::IsSolid(m_BlockType))
	{
		cBoundingBox BB(a_Pos, 1, 1);
		BBS.push_back(BB);
	}

	return BBS;
}

Then when the server needs to know if an entity is in a block it loops through the list and checks if the bounding boxes intersect with the bounding box of an entity. This method would be usefull for for example a cauldron since it's more like a hollow block.


EDIT:

Another idea is to let the blockhandler itself check if an entity is inside.
Thanks given by:
Not a bad idea! At least it would make the plugin development a lot easier and also the regular development Smile though I can't think of much of a usage Wink. Could you explain that a little more?
Thanks given by:
Well for example thanks to this we could throw items directly agains fences instead of stopping the item in front it
[Image: 8OuzR.png]
Thanks given by:
Oh yes! And we also would be able to punch them through Smile
Thanks given by:
I don't think that would work if you have a different texture pack thoughTongue
Thanks given by:
(05-16-2014, 11:59 PM)STR_Warrior Wrote: I don't think that would work if you have a different texture pack thoughTongue

No, that was not what I meant. Isn't it possible to throw items over a fence?
Thanks given by:
You need to think this one through properly, though - you don't want to create a vector of bounding boxes for each and every block in the chunk - there's 64Ki blocks per chunk!
Thanks given by:
Yes, I think this might be a bigger project and really needs proper planning.

>>> BRANCHING TIME <<<Big Grin
Thanks given by:




Users browsing this thread: 14 Guest(s)