Bubble Lava Lamp

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Bubble Lava Lamp

Post by MrGodin » July 24th, 2018, 6:09 am

Hey folks, I was playing around with some partitioning and spherical physics when all of a sudden this happened. Reminds me of a lava lamp from back in the 70's
Built with VS 2017 on Windows 10
There is a text file called runData in the Solution Explorer you can alter a couple numbers that the app will load in and parse so you just change the text file.
This runs best in release mode.
I found with the data used in runData.txt on my machine gives the best results, yielding about 57 fps.
I know i have alot of work to do with this yet but I found the visuals pleasing
Peace Out
Attachments
CBaller2.zip
(62.98 KiB) Downloaded 125 times
Curiosity killed the cat, satisfaction brought him back

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Bubble Lava Lamp

Post by chili » July 27th, 2018, 2:53 pm

Sounds like something I need to check out :)
Chili

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Bubble Lava Lamp

Post by albinopapa » July 27th, 2018, 6:02 pm

Why capture by value?

Code: Select all

			m_components.erase(std::remove_if(std::begin(m_components), std::end(m_components),
				[=](const std::unique_ptr<Component>& comp)
			{
				return comp.get() == m_componentArray[getComponentTypeID<Type>()];
			})
				, std::end(m_components));
That means that for each component in m_components, make a copy of the m_componentArray array. Wouldn't it be better to capture by reference?

Code: Select all

			m_components.erase(std::remove_if(
				std::begin(m_components),
				std::end(m_components),
				[=](const std::unique_ptr<Component>& comp)
			{
				return comp.get() == m_componentArray[getComponentTypeID<Type>()];
			})
				, std::end(m_components));
Actually, in this case, you could just get away with capturing the 'this' pointer.

It's in the GameObject::Remove() function btw.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Bubble Lava Lamp

Post by albinopapa » July 27th, 2018, 6:05 pm

Though, I suppose if you were to throw in some multithread support, you'd probably want to capture by value on some things, but I'm not so sure this instance would be a candidate.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Bubble Lava Lamp

Post by MrGodin » July 28th, 2018, 1:07 am

@ chili, I am no where near your comprehension of coding so don't laugh lol
Curiosity killed the cat, satisfaction brought him back

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Bubble Lava Lamp

Post by MrGodin » July 28th, 2018, 1:38 am

@albino.. i'm just a fuck around hobby guy, if it works it works .. to a fault i tend to do that lol ;) Peace brother
Curiosity killed the cat, satisfaction brought him back

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Bubble Lava Lamp

Post by albinopapa » July 28th, 2018, 7:56 am

Coolio, peace.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply