Search found 3912 matches

by albinopapa
November 20th, 2019, 3:16 am
Forum: Everything
Topic: Early out if statements
Replies: 1
Views: 9

Re: Early out if statements

Okay, so I tested a fuller AABB collision test with 20 iterations like the Circle tests. There aren't any sqrt calls, but there are 4 branches, two for early out detection and two for determining values. The two branches used to exit the function early I can combine to make one return thus eliminati...
by albinopapa
November 20th, 2019, 2:52 am
Forum: Everything
Topic: HW 5 (Beginner) Confusion
Replies: 2
Views: 8

Re: HW 5 (Beginner) Confusion

Two of the signs are wrong in this if statement

Code: Select all

	if (left_mobile < right_fixed &&
		right_mobile < left_fixed &&
		top_mobile < bottom_fixed &&
		bottom_mobile < top_fixed)
	{
		colliding = true;
	}
	else
	{
		colliding = false;
	}
by albinopapa
November 20th, 2019, 2:46 am
Forum: Everything
Topic: HW 5 (Beginner) Confusion
Replies: 2
Views: 8

Re: HW 5 (Beginner) Confusion

Chili will or should have covered this, but one & is for bitwise operations between integral types: 0b11001010 & 0b10000000 = --------------------- 0b10000000 The double && ( double ampersand ) is logical AND true && true = true true && false = false false && true = false false && false = false The ...
by albinopapa
November 19th, 2019, 8:34 pm
Forum: Everything
Topic: Early out if statements
Replies: 1
Views: 9

Early out if statements

In an endeavor to find performance increasing code, one thing I wanted to look at was branching and to be more specific, using if statements to exit from a function early. I've most often seen this technique in physics or ray-tracing algorithms ( both are basically the same really ), but I have seen...
by albinopapa
November 19th, 2019, 7:43 pm
Forum: Everything
Topic: Tutorial 5 Beginner : Why isn't my code acting like Chili's?
Replies: 2
Views: 13

Re: Tutorial 5 Beginner : Why isn't my code acting like Chili's?

if (x > 200) { if (x < 300) { shapeIsChanged = true; } } ... shapeIsChanged = wnd.kbd.KeyIsPressed(VK_SHIFT); You have 2 conditions that change the behavior of the shape with the latter taking precedence over the former. The ( shapeIsChanged = wnd.kbd.KeyIsPressed(VK_SHIFT); ) line isn't in the ori...
by albinopapa
November 18th, 2019, 11:35 pm
Forum: Everything
Topic: Raytracing
Replies: 25
Views: 149

Re: Raytracing

CUDA is only accelerated for nVidia graphics cards. It falls back to using the CPU if no nVidia graphics card is present on the system. So for us AMD owners, it is totally important and relevant. Granted, nVidia owns like 70-80% of the market on graphics cards currently, that might not always be the...
by albinopapa
November 18th, 2019, 8:10 am
Forum: Everything
Topic: Raytracing
Replies: 25
Views: 149

Re: Raytracing

I personally haven't run into an issue with devs/library authors not at least making a VS2017 option for the CMake builds. I suppose what you could do is go ahead and make the CMake build for VS2015 then just open in VS2017/VS2019 and update the SDK and build version. I really do hate CMake though, ...
by albinopapa
November 17th, 2019, 3:21 am
Forum: Everything
Topic: Help with projection matrix (again :) )
Replies: 3
Views: 28

Re: Help with projection matrix (again :) )

Normally, you'd "move" the camera around following some target ( maybe the player ) while everything else is in World coordinates. So, if your player is at { 100, 0, 200 } and your camera is at { 100, 0, 100 } then one of the transformations in the View transform matrix is the negated translation. T...
by albinopapa
November 16th, 2019, 10:09 pm
Forum: Everything
Topic: allocate_shared homework
Replies: 4
Views: 33

Re: allocate_shared homework

One thing I forget about is that Box2D's b2BlockAllocator actually this allocator is more like the std::pmr::monotonic_buffer_resource. b2BlockAllocator uses malloc to allocate a memory pool ( b2Chunk ), then grabs memory from the pool to construct object there. If the chunk is exhausted or the allo...
by albinopapa
November 16th, 2019, 9:19 pm
Forum: Everything
Topic: allocate_shared homework
Replies: 4
Views: 33

Re: allocate_shared homework

Also, with std::pmr::polymorphic_allocator, you don't even HAVE to create an allocator if you are just wrapping a third party memory manager. Here's the same example using the polymorphic_allocator already defined in the STL. int main( int argc, char* argv[] ) { using LocalAllocWin32 = std::pmr::pol...